While digging into
modtools/create-unit for one of my scripts (thank you whoever made those createFigure and createNemesis functions, you saved me a lot of time), I noticed a slight error but I'm too inept to work out how to have two separate pulls on the go at the same time so I'll just mention it here
For a historical figure, their
unit_id2 is the ID for their nemesis. During
createFigure, the created figure is instead being assigned the unit's id a second time. The differences between
unit_id and
unit_id2 is easy to miss because I think a bunch of the worldgen figures(?) happen to have unit and nemesis IDs that are the same value.
I
think the only edits that need to be are:
- In createFigure, remove hf.unit_id2 = trgunit.id so the historical figure's unit_id2 remains at the default value of -1 (at least, I think that's how it works, otherwise just make it assign -1 :b). Not that this edit is that vital.
- In createNemesis, just before return nem add something like df.historical_figure.find(trgunit.hist_figure_id).unit_id2 = id
... or do something better than that. As far as I can tell, a historical figure that's attached to a unit always needs a nemesis, so it's fine to assume that
createNemesis will always be used.
Edit: In the process of acquiring knowledge on how companions work that'll probably be invalidated come next update when that system is possibly getting overhauled, I've worked out a couple of anon values, but couldn't find/work out which file I was supposed to edit.
For a
histfig_hf_link_companionst (which is a
histfig_hf_link stored in a
historical_figure's
histfig_links), the value of
anon_1 is the ID of the agreement that was made between the player and the companion to have them join the adventurer (see
df.global.world.agreements), and the value of
anon_2 is the ID of the party involved in that agreement that the historical figure that this histfig link is on appears in (
not the party that the listed
target_hf appears in)... if that makes any sense, I can try to elaborate a bit more if not
Edit Edit: I also figured out that
unk_1,
unk_2, and
unk_3 in
df.global.ui_advmode are the last x, y, and z coordinates of the adventurer's army (set/updated when the travel screen is opened, or you move on the travel screen)... then I discovered this was already known because it was used in
questport Q.Q These style of coordinates are also
anon_1,
anon_2, and
anon_3 in agreements, but I'm not sure if it represents the army position of one of the parties, or whether it just represents where the agreement took place.
Does anybody know how the army position style of coords are calculated? I'm fake generating some agreements and so need to know how to make the coords, otherwise I'll just slap in the adventurer's last army coords and call it good enough