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

Add emigrate-nobles.lua #1382

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

ong-yinggao98
Copy link

@ong-yinggao98 ong-yinggao98 commented Jan 28, 2025

Adds a script to allow players to make inherited nobles emigrate to govern their rightful lands.
For those who want a non-violent way of getting unnecessary nobles to stop imposing on them and do their jobs.

  • Argument handling
    • Select specific noble for emigration by ID
    • Select all nobles
  • Allow immigration of your rightful ruler (if your original died and the heir is off-site)
  • Make sure when noble leaves:
    • Noble has been unassigned items of office
    • Noble has been unassigned from military squads
    • Noble takes family with him/her (as an option)
    • Noble is not in a strange mood
    • Noble stops social activities

@ong-yinggao98 ong-yinggao98 marked this pull request as ready for review January 29, 2025 16:25
@ong-yinggao98
Copy link
Author

Ideally I would have noble items unassigned but I can't seem to find them. I guess I could assume that players who want to be rid of their nobles would not assign items to them first...

Copy link
Member

@myk002 myk002 left a comment

Choose a reason for hiding this comment

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

doc review done

Tired of inherited nobility freeloading off your fortress making inane demands? Use this tool
to have them (willingly) emigrate to their rightful lands.

The unit must not be assigned to a squad.
Copy link
Member

Choose a reason for hiding this comment

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

is this a limitation, or is the script interpreting squad assignment as an indicator that the player wants to keep the noble? I think we can unassign from squads programmatically.

Copy link
Author

Choose a reason for hiding this comment

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

It was a limitation as I had not implemented that logic yet. I'll see what I can do (probably reference stuck-squad and uniform-unstick).

docs/emigrate-nobles.rst Outdated Show resolved Hide resolved
docs/emigrate-nobles.rst Outdated Show resolved Hide resolved
docs/emigrate-nobles.rst Outdated Show resolved Hide resolved
docs/emigrate-nobles.rst Outdated Show resolved Hide resolved
@ong-yinggao98
Copy link
Author

ong-yinggao98 commented Jan 30, 2025

@myk002 I have added some logic to remove the unit from the squad, namely:

  1. Modify squad.positions
  2. Modify unit.military
  3. For commanders/captains: modify entity.positions.assignments
  4. Modify histfig.entity_links to represent former membership

This probably should become a future PR to the Military module at some point.

Hopefully that's all, but if I immediately booted the unit after removing from squad, it will probably leave with the gear since it won't have time to put the stuff back. I could make it drop it all but it could wind up naked if the uniform is shaped or replaces civilian outfit.

Which of the following would you recommend?

  • Let the unit leave with the gear
  • Let the unit drop his uniform
  • Cancel the emigration and let the user remove the squad assignment himself

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

2 participants