DFHack / dfhack

Memory hacking library for Dwarf Fortress and a set of tools that use it
Other
1.86k stars 471 forks source link

Prevent labors from being set on visitors #4973

Open adiamaq opened 2 days ago

adiamaq commented 2 days ago

So to explain this issue, there seems to be a bug in the game, where if you have visitors , let's say, 20, and you have a total of 30 population, in the Labor tab there will only show 10 of them (the original dwarves). However, if you go to any of those visitors and click on their own labour tab, you can assign works there. Yeah, 2 years later, those visitors will ask for citizenship, but meanwhile you're unable to see them in main labor matrix. Would it be possible to display everyone in the main Labor tab? Or maybe force the conversion of those visitors

myk002 commented 2 days ago

You can use makeown to force the conversion of visitors to citizens.

could the "fix" here possibly be to disallow setting of labors for visitors from their info sheets? I'm not sure that capability is intended.

adiamaq commented 2 days ago

Ah awesome, makeown will do! Is there a way to select all visitors at once?

ab9rf commented 2 days ago

i am fairly certain that the ability to manipulate the labors of nonresidents is a bug

myk002 commented 2 days ago

Ah awesome, makeown will do! Is there a way to select all visitors at once?

This should do it:

:lua for _,unit in ipairs(world.units.active) do if dfhack.units.isActive(unit) and dfhack.units.isVisitor(unit) then print('Converting ' .. dfhack.units.getReadableName(unit)) reqscript('makeown').make_own(unit) end end

Note that this will also pick up forgotten beasts, who are classified as "visitor, unwanted"