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

rejuvenate --force needs to break mother/infant rider relationship #4894

Closed
ab9rf opened this issue Aug 31, 2024 · 4 comments · Fixed by DFHack/scripts#1284 or DFHack/scripts#1295
Closed
Assignees
Labels
bug good first issue Good for newcomers

Comments

@ab9rf
Copy link
Member

ab9rf commented Aug 31, 2024

when rejuvenate --force is used, the script changes the occupation of infants that are aged up but does not break the mother/infant "rider" relationship causing mothers to perpetually attempt to pick up their abandoned "baby" (who is now an adult)

related discord discussion

@ab9rf
Copy link
Member Author

ab9rf commented Aug 31, 2024

further update: on research, the problem may be that the aged-up babies are not being removed from the ANY_BABY categorized unit subvector when they're forcibly aged up. the game periodically checks to see if, for any given unit M, there is a unit B on this vector for whom M is the unit's Mother but not RiderMount (in M's relationship_ids table), then if M can path to B, M will cancel whatever she is doing and initiate a SeekInfant job for B, regardless as to whether B is still a baby or not

thus, when aging up a baby to not-baby, it's necessary to:

  • clear (set to -1) the RiderMount id in the former baby's relationship_ids table
  • remove the former baby from the ANY_BABY unit category vector

it's probably also a good idea to set the former baby's mount_type to STANDARD

p.s. code ref for this is unitst::evaluate_orders_high_priority, which in 50.13 steam (win64) is at 0x140743160, specifically starting at or about 0x140743683

@ab9rf ab9rf added bug good first issue Good for newcomers labels Aug 31, 2024
@ahlove3
Copy link

ahlove3 commented Sep 1, 2024

Commenting to say I'm taking a look at this

@ahlove3
Copy link

ahlove3 commented Sep 1, 2024

Submitted a PR

@ab9rf
Copy link
Member Author

ab9rf commented Sep 1, 2024

we should consider centralizing age transition emulation in either a lua library or in the core

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment