Skip to content
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

Move RollOfUnit() to after the "finished building" animation #6456

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

lL1l1
Copy link
Contributor

@lL1l1 lL1l1 commented Sep 21, 2024

Description of the proposed changes

Fixes #5625. UEF and Cybran air factories have an animation that locks the unit's orientation, interfering with the rolloff rotation. The changes move the rolloff rotation to happen after the animation finishes.

Testing done on the proposed changes

Spawn factories, give a rally point on one side, order an engineer, and then change the rally point to the other side before the engineer finishes building and see that it now gets rotated correctly in the UEF and Cybran factories.

   CreateUnitAtMouse('xab1401', 0,    0.14,   -8.65, -0.00000)
   CreateUnitAtMouse('xsb0302', 0,   -4.04,    2.16,  0.00000)
   CreateUnitAtMouse('ueb0302', 0,   11.96,    2.16,  0.00000)
   CreateUnitAtMouse('urb0302', 0,    3.96,    2.16,  0.00000)
   CreateUnitAtMouse('uab0302', 0,  -12.04,    2.16,  0.00000)

Checklist

  • Changes are annotated, including comments where useful
  • Changes are documented in the changelog for the next game version

Fixes engineers built in UEF & Cybran air factories not being rotated after completion
@lL1l1 lL1l1 added type: bug area: sim Area that is affected by the Simulation of the Game labels Sep 21, 2024
Copy link
Contributor

@clyfordv clyfordv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This introduces a bug where the a land unit built from a relevant air fac wants to nav back to the roll off point after the rally point. See something similar here where an order is slipped in right at the moment of construction with odd behavior: https://discord.com/channels/197033481883222026/1144605729911738439/1238254471662927943

Stock:
image

With change:
image

My read on why this occurs is that the rally point order chain issuing is extra special somewhere in the engine (apropos nothing it would be nice to expose that to lua a little more, to enable more sophisticated roll off behavior). I think if you want to implement this as-is you'll have to manually re-check the unit's orientation and update if necessary.

Move `IssueToUnitMoveOffFactory` to the tick of `OnStopBuild`
Remove `RollOffUnit` as its dual functionality of `IssueToUnitMoveOffFactory` and spinning the unit has to be split into two separate locations
@lL1l1
Copy link
Contributor Author

lL1l1 commented Oct 23, 2024

This fixes it but the code style may be sloppy, although I think it's the most efficient solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: sim Area that is affected by the Simulation of the Game type: bug
Projects
None yet
2 participants