Question about makeown:
I used it on a dwarven caravan guard, but he's not listed as a citizen or member of anything (no blue text in his description). I can force him into a squad using DT and he'll follow station orders, but he won't go and train or put on a uniform, or in fact any clothes at all. He was wearing them at one point, but then dropped everything when I forced him into a squad. Removing him from the squad via DT doesn't make him wear anything either.
Is there any way of making him a full member of the fortress, or does makeown only work for making civilians?
We were trying to make this work over in the
☼Masterwork Succession Fortress: Exultationhexxed☼ game, because migration never started beyond the hardcoded waves.
Here's my current attempt to supplement tweak makeown by creating a new historical figure record. It's still clearly incomplete.
function find_entity(id)
for ii = 0,#df.global.world.entities.all - 1 do
if df.global.world.entities.all[ii].id == id then
return ii
end
end
return -1
end
function create_hist_fig(unit)
if unit.flags1.important_historical_figure == true then
print("Already a historical figure.")
return
end
new_fig_id = df.global.hist_figure_next_id
new_hist_fig = df.historical_figure:new()
new_hist_fig.profession = unit.profession
new_hist_fig.race = unit.race
new_hist_fig.caste = unit.caste
new_hist_fig.sex = unit.sex
new_hist_fig.appeared_year = unit.relations.birth_year
new_hist_fig.born_year = unit.relations.birth_year
new_hist_fig.born_seconds = unit.relations.birth_time
new_hist_fig.curse_year = unit.relations.curse_year
new_hist_fig.curse_seconds = unit.relations.curse_time
new_hist_fig.anon_1 = unit.relations.anon_2
new_hist_fig.anon_2 = unit.relations.anon_3
new_hist_fig.old_year = unit.relations.old_year
new_hist_fig.old_seconds = unit.relations.old_time
new_hist_fig.died_year = -1
new_hist_fig.died_seconds = 1
new_hist_fig.name:assign(unit.name)
new_hist_fig.civ_id = unit.civ_id
new_hist_fig.population_id = unit.population_id
new_hist_fig.breed_id = -1
new_hist_fig.unit_id = unit.id
new_hist_fig.id = new_fig_id
civ_link = df.histfig_entity_link_memberst:new()
civ_link.entity_id = df.global.ui.civ_id
civ_link.link_strength = 100
fort_link = df.histfig_entity_link_memberst:new()
fort_link.entity_id = df.global.ui.group_id
fort_link.link_strength = 100
new_hist_fig.entity_links:insert('#', civ_link)
new_hist_fig.entity_links:insert('#', fort_link)
df.global.world.history.figures:insert('#', new_hist_fig)
df.global.hist_figure_next_id = df.global.hist_figure_next_id + 1
unit.flags1.important_historical_figure = true
unit.flags2.important_historical_figure = true
unit.hist_figure_id = new_fig_id
unit.hist_figure_id2 = new_fig_id
newhist_loc = df.global.world.history.figures[#df.global.world.history.figures - 1]
df.global.ui.main.fortress_entity.histfig_ids:insert('#', new_fig_id)
df.global.ui.main.fortress_entity.hist_figures:insert('#', newhist_loc)
civ_index = find_entity(df.global.ui.main.fortress_entity.entity_links[0].target)
df.global.world.entities.all[civ_index].histfig_ids:insert('#', new_fig_id)
df.global.world.entities.all[civ_index].hist_figures:insert('#', newhist_loc)
end
unit = dfhack.gui.getSelectedUnit()
create_hist_fig(unit)
The guards, when converted, will:
- show up in Dwarf Therapist (because their histfig's are listed for the fortress entity)
- can set and will obey labor preferences
- claim bedrooms
- have strange moods
- join squads (not lead them)
- equip uniforms and weapons as soldiers
- go to training
- obey squad orders to attack, move, etc.
The game doesn't seem to break, and in particular, it will keep creating more historical entities without complaint. (Thanks, Ag!)
The biggest problem is noble assignments and squad leadership. They show up in the list to be made a noble, but once you exit the window, the position remains unfilled.
I think that's an improvement over just tweak makeown, but doesn't do everything necessary to truly add the dwarf to the fortress.