New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Undeploy on move order for TS units #16142
Conversation
This feature is nice but has also has some negatives, force move is mostly used for crushing infantry and I select my tick tanks with 'select units by type'. What if I want some of my tanks deployed and shooting while others go for crushing? There is no way to select all undeployed tick tanks for this issue to be avoided. |
Ha, I hadn't considered that. Thanks for pointing this out!
Well, now there is. 😉 |
IMO This functionality should be enabled by setting something like "UndeployOnMove" to true |
Do you mean setting it per unit type in yaml? Sure, that can be arranged, but I need a bit more context for that:
|
I don't like the idea of hardcoding
|
I'm busy rewriting this now. However, I'm stuck at step 4. I can pass the target location to the new actor, but how do I make it actually perform a move activity? |
If you didn't already find it, use |
Thanks! Yeah, I tried starting the activity from the constructor, but that didn't work. It sounds like the |
Reimplemented according to the approach suggested by pchote. Additionaly:
The code does not yet work for aircraft because the OrderTargeters rely on knowing |
Nice work! Will it also work on construction yards? Actually It would be really nice if you could click on a con yard, force move it, queue a deploy. It would require less attention and would be more efficient overall |
That was actually what I was thinking as well. Unfortunately, MCVs work with |
This should now fully work for aircraft as well, although I cannot test it since there are no relevant units in the default mods. |
I'd prefer if the "separate selection criteria" commit could be handled in a separate PR, and then implemented using conditions so that it could fix #15370. As-is, its a bit much of a scope creep and not really needed for the main purpose of this PR. |
Can you then please squash/rework the remaining commits so the history only contains the final implementation? |
I guess that means |
The idea from #4783 was to move it onto |
5fb6a6e
to
a04ad12
Compare
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some more detailed thoughts, and it looks like this will want to depend on #16246 too.
Update:
|
#16246 has been merged, so this needs a rebase now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still wrapping my head around this, but have a couple of initial questions/comments:
I checked vanilla TS, and it cops out by only supporting the move cursor on standard clear terrain. You get a move-blocked cursor when mousing over tunnels and even tiberium. |
9cce67e
to
a6f8dd6
Compare
I've finally managed to get it working for
I can understand why; Having actors switch out like that gets pretty head-ache inducing 😛 |
Adding this to the release milestone, but I expect to wait until after the aircraft activities and #16481 are merged before looking at this in detail again. |
Disallow undeploy when unable to move. Add undeploy on Move for Transforms. Make GrantConditionOnDeploy fully compatible with order queues. Removed unused UndeployForGrantedCondition activity. Make sure move part is interruptible. Undeploy on move also applies to aircraft. Make Transforms fully compatible with order queues.
Rebased. |
Transferring orders created for one actor over to another actor is asking for a lot of trouble:
At the risk of falling into the "everything is a <X>" trap, I do think our newly introduced activity interface concept provides a clean solution that doesn't require another total rewrite here:
The workarounds in |
If we go down the |
@@ -57,17 +58,23 @@ public class GrantConditionOnDeployInfo : PausableConditionalTraitInfo | |||
[VoiceReference] | |||
public readonly string Voice = "Action"; | |||
|
|||
[Desc("Can this actor be ordered to move when deployed? [Always, ForceOnly, Never]")] | |||
public readonly UndeployOnMoveType UndeployOnMove = UndeployOnMoveType.Always; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default behavior for GrantConditionOnDeploy
is to have nothing to do with movement, so the default here really should be UndeployOnMoveType.Never
to match. Mods must explicitly opt-in to having the deploy affect movement, so it it logical for them to opt in to having movement affect the deploy at the same time.
This otherwise breaks usecases that have nothing to do with movement - e.g. deploy to activate gap generation or cloak.
I can take this over. This is real close to being mergable, so it would be a shame to leave it at the (hopefully) last hurdle. |
16e0d55 implements my suggestion above, which seems to work well enough. I'll open a new PR once I have a chance to go through in more detail and make sure I understand the rest of the changes, apply any other comments I might have, and maybe split the last commit into a few smaller ones. Edit |
Fixes #13039.
Fixes #16600.
This only applies to units that use the GrantConditionOnDeploy trait, not units that use the Transforms trait, so this does not yet work for MCVs.