#Set unit target of type(persistently)
1 messages · Page 1 of 1 (latest)
Pull request up here: https://github.com/beyond-all-reason/Beyond-All-Reason/pull/5619
This is tight
This got merged into base game recently so should be in the next release
I just saw it by accident by looking at the repo. I hope info about such additions will be announced somehow 
Yeah I was planning to just tell NotReal about it when it gets released
Hey @rancid verge this widget is now in the base game, try it out! If you alt + set target + left click on an enemy it'll keep setting target on anything of that type in range(until you clear target or set target again).
Use cases include:
- Targeting sheldons (so they get shot even as they dance in and out of vision)
- Targeting comm in t1 phase
- Targeting bombers with your AA
- Probably lots of other stuff
This is a wonderful addition!
I assume it works both for right-click settarget and alt+s settarget?
gaming
I want to make a microblog post about this widget being added + reminder that #1269614487715971095 and #1299275801816203314 exists (because I don't think they were ever 'announced'). Are you ok with that?
Please do! Where would I find it later, on the official BAR website?
https://www.beyondallreason.info/development/microblog and #📰|development-blog
I am not sure, need to test. But it should work for those. If it doesn't, it's a bug.
I never even heard of alt+s settarget, what is that?
there is set-target-no-ground which triggers only when you target the unit
I don't remember which one is default now (S)
The widget expects 1 argument for the set target command, instead of an area
If you want, you could run the draft by me before you post. I've done some technical writing at work. If not you can just post it
Set persistently targeted unit type by Flameink
All units of the same type (i.e. all Starlights if you click on Starlight) will be automatically set-targeted when they come into range of the ordered units. Clear target/other set target commands will cancel this behavior.
Usage: Alt + set target + click on a unit
I just go with basics, so regular player has a chance of seeing it any trying it out 😉
Oh yeah, that's perfect! Thank you for spreading the word!
#📰|development-blog message
@slate sorrel is there anyreason to not have this thread closed?
Not really, it's in the game already haha. Maybe it could be improved? Idk how though
Wow, op QOL thing. It work also when you ALT + set target an allied units type ?
You can't set target on ally units can you? For what?
I talked of this with someone and he asked the question, as it is unit type, would make sense that is could work even with allied units. But i guess not if you manage only the nominal case.
It manage SHIFT also ? Like you ALT + SHIFT + SET TARGET jam & radar bot, does it auto set target both units ?
Anyway, just learn about it, need to practice it, look cool in theory !
There's only one "slot" for the targeted type. I can add multiple slots but that's further work. Basically, any time you do an alt + set target it sets the new type, and any time you do any other set target thing it clears it.
I'm still not sure what would be a situation where you're setting target on allies. Don't you only shoot enemies?
To preconfigure the "set target on an unit type" before even the need to encounter an enemie of that type ?
That's what I was wondering recently if it should be possible to add multiple types.
Also, if I set the target on the cor commander I would expect it to target the arm commander. Same with jammers - if I select an arm bot jammer I would expect it to target cor too (and probably vehicle jammers too) 
And then, the logical step would be to be able to 'undo' selection so if I miss click I wouldn't break my long list of targets. And then it would make sense to persist it between matches. And then we end up with a custom smart targeting per unit type, which I like but I'm afraid it's a bit more controversial XD
I see. That doesn't seem super intuitive to me but I see how it would work. I think it's not too hard to add, but we'd need some feedback to let the user know it actually happened. Maybe some ui or something
Yeah I'd want gdt approval before doing something like this. But it would make sense for it to persist between matches like an auto group. I think the first step is getting people to use the feature as it is in the first place
First bug i found, when you "Stop" a unit it don't clear unit type target, "Stop" should have same behavior than "clear target" with this new ALT + SET TARGET
Oh, does stop clear normal set target?
Yes, it is often used to "Stop" because it is one click instead of the 2 clicks of "CTRL" + "S" of clear target
doesn't seem to work with the settargetnoground directive that i have set in keybinds.. would probably be nice to have that as SuperKitowiec mentioned since this functionality is pretty much all about targeting units and not the ground
am excited to use this though 👍
What is that directive, can you tell me about it?
all i know is that in uikeys.txt, i have:
bind Alt+sc_y settarget
bind sc_y settargetnoground
and if you try to use settargetnoground, it won't let you target the ground (in case you were to miss the unit you're trying to set target to).. which seems like it would be useful for this widget if possible to key off of
The fact "unit type set target" need to be in range is counter intuitive with classic "set target" which you can set even out of range.
For example with LRPC, i tried "unit type set target" on vanguard, but it does nothing outside of range and nothing even if in range sometimes, so i guess when it can't reach it, it don't "set target", it is weird as i never know if it work or not.
I guess it is for performance that you keep "set target" only when in range, but maybe need a check on "particular units/builds" like LRPC on hills or take a margin because how plasma work (more range on hills, maybe take max bonusRange from highest hill and add it to range check, idk)
Yes, i think "blueprint widget" did the work as when you set winds blueprints, it work with the equivalent wind of the 3 factions, maybe look how they do for "same kind of unit type", like if you ALT + SET TARGET on a com, it would be op it work for all com COR/ARM/LEG
Do you have a replay? It really should be setting the target if it's within 1.5x of the unit's range
I think what might be going on is that I am using a simple distance calculation instead of something like Spring.CanShootAt(target). If you had a case where it wasn't setting target on something that it could shoot at that would be awesome
Yes, next time it happen i keep replay & timecode (last time happen it was on a long high OS atg game).
It is a complex case because LRPC with bonus range from big hills + having to set target on vanguards that can climb behind hills, not sure a "simple distance calculation" is enough for this, furthermore having vanguards in LOS and in "raw range" of lrpc but not set target is weird even if it can't shoot at it because behind a hill
https://www.beyondallreason.info/replays?gameId=1008ea68cd348e73231cf08a41cd82a3
On this replay i tried "unit type set target" t3 units with 3 lrpc and it never worked
When you say t3 units do you mean in general? Because it'll only do one thing (e.g. titans) at a time
Also if you have timestamp that would help
Thanks for the replay btw!
I ALT + set target titans, vanguards, razors, maras, nothing worked, it was almost at max range of LRPC
43:23 I want to ALT + set target razors, it just don't work so i "set target" just one
47:45 razors
49:28 titans
51:44 rezzers
56:00 Behemoths
Nothing work for "ALT + set target", maybe it is the "performance patch" and units are too far
What is the "performance patch"?
By "performance patch" i mean the code that allow this "set unit target of type" with 1,5 max range iirc
Oh, was the range getting extended further than 1.5x with terrain?
Possible, check replay, i gave timecode.
Hills are really high on ATG with huge range of LRPC.
Each time i tried "set unit target of type" each kind of unit at almost max range it don't work
@slate sorrel
just noticed that pressing stop doesn't stop this command (while it does so for normal set target)
Thanks for the bug report! Feel free to fix it since it should be an easy fix.
Should be a matter of adding a new break condition in https://github.com/beyond-all-reason/Beyond-All-Reason/pull/5619/files#diff-bdd84f446b4acccc7480f785adfecae5fc760a8ebedf673a34559a91c131be46R104 around line 104
I may also fix it but I wouldn't hold my breath lol. Normal work is kind of working me atm
#1401059627625611284 message
It happen again recently with LRPC on big hills of glitters, impossible to use the feature "unit type set target".
The "performance limitation" is bugged with this use case, there is unit in range and in LOS and you just can't set "unit type set target" 
Thank you! I should probably have a separate case for LRPC's to make them just scan the whole map. I don't think bumping it up to 2x range is likely to really fix the issues
Hmm, I tried it and it appears to set target properly on stuff even beyond the boosted hill range
@onyx girder
It definitely doesn't seem like a range issue or anything. 1.5x of an LRPC range pretty much covers the whole map
Yeah weird, in sandbox game i can't reproduce it, idk what make it bug in real game
Maybe the widget crashed at some point and that's why it stopped working?
I suspect this also, it was like it didn't work for any kind of units,
would make sense
I did notice it wasn't working on glitters even though it works in sandbox today
ok the widget is straight up not working in live games. something's up.
It's definitely working in skirmish but not working at all in multiplayer games
That's odd. Maybe it's issuing too many commands or something?
Maybe you run skirmish in dev mode with slightly different version? Or you have some old version in widgets folder so it overrides the live one?
Maybe. I'm trying to figure out how I can even debug something like this
I took the same game that I just launched a live match on, andd went into skirmish there
no dev mode
Spring.echo every other line 
Yes, but how do I play live matches with a modified game? Can i Just Do that?
Copy it to the widgets folder and modify it there
If I copy the same widget into the widgets folder in a live game it works
Yeah
(like my area filter)
I'm wondering if they'll let me just yolo in a change to lower the layer(which would make it go first i think?)
Hotfix is a hotfix 
You can check if layers break it by modifying the one in the widgets folder I think
Or the dev one I guess. (Did you update the fork?)
Though that wouldn't tell me if there was a widget that only was active during a live game was screwing up the layer thing
Are there any widgets which are active only in multiplayer?
I have no idea
do you know if user widgets go before or after the game ones?
I tried setting the layer of the widget in the dev game to 10000000 and -1000000 and it didn't make any difference
Pretty sure they are after (as they have to override the game ones). Also, you can see the load order in logs
I'm thinking to put some kind of telemetry in the game about it so I can tell what's going on
Made a thread https://discord.com/channels/549281623154229250/1435076896382648350 to collect all the feedback
You did something ?
I just had a long game atg and the "set unit target" worked, nice
Tbh, for me it was never broken, the worst kind of the issue xd
Nvm, just got it broken again, 🤣 it is like very random for this widget to be functional it seems
Yeah I think it's some layering thing
Some news about this widget often broken in PVP ?
You mean there are new reports or are you asking if there are new ones?
Just want to know if someone take a look to make this important QOL feature reliable on PVP.
@slate sorrel You stopped your investigation to fix it or ?
https://github.com/beyond-all-reason/Beyond-All-Reason/pull/6074
I have this pr that's waiting for a merge that I'm blocked on
But tbh I am just throwing stuff at the wall here, if anyone has any ideas I'm all ears
what about second verison of the widget which will log everything?
also, gemini suggested that the issue could be in hardcoding myAllyTeam but I see this PR changes it
The prospective fix got merged, @onyx girder maybe you can give it a try? Just make sure you're in a 55f8260 lobby
It seems to work for me at the moment in multiplayer.
Seems to work, i take time to get more PVP games with lot of cases, but seems to work
Awesome!!!!
I did add the debug version along with some random fixes, and the random fixes seem to have fixed it. Maybe give it another try?
Also I have a PR for snapping the command to a nearby unit(with indicator line): https://github.com/beyond-all-reason/Beyond-All-Reason/pull/6847
My laptop hates me so no screen recording, but be assured that it is way more usable now
Hey @vale cloud , I added the snapping and it seems pretty nice and a usability bump. Do you think it would be worthwhile to add something similar to the normal area filtered commands in cmd_area_commands_filter?
You can try it out with just alt + set target. It should display a snapping line to the unit it will target within 100 elmos.
We could use WG to poll in one place and then forward the result to the appropriate widget.
Sounds good 
Well, i have a little more PVP games experience now, it worked everytime, sound very good !
I get back the habit to use this op feature, if it fail a single time you will ear me
GG
Cortex