...
That was renamed a long time ago. It should be unit.relationship_ids.GroupLeader instead - does that work for you?
Yep, that fixed the error.
math.pow was replaced with the ^ operator when we switched to Lua 5.3 in 0.43.05 - try that.
Ok, did that. There was also one other place where pow was used instead of ^. After replacing both of them with ^, I fired about 30 ballista rounds at a siege that showed up at the perfect moment without any errors or other problems.
Hopefully that is it for siege-engine bugs.
Geez, has nobody used siege-engine in the past 2 years?
Bear in mind that this doesn't show up if you just play around with siege-engine a bit using unskilled operators. I tried embarking in vanilla to test a couple of things, lucked out and landed on top of a Roc lair, and fired ballista bolts at both the Roc and a herd of boars for a while without any errors. I had to dig around in the c++ code to figure out why, but dabbling operators can't aim at specific creatures (only an area), and the buggy code is only executed when weighting targets for the random target creature selection algorithm. You have to fire a siege weapon with a trained operator at an area containing creatures to get an error thrown.
Are you using the -setUnitToFort argument, or anything else to adjust civ IDs? Better question: how exactly are you running create-unit (what arguments)?
Here are the relevant script calls:
foe/reaction-trigger -reactionName DEPLOY_MINE_HE -command [ modtools/create-unit -race LANDMINE -caste HE -domesticate -location [ \\LOCATION ] ]
foe/reaction-trigger -reactionName MANUFACTURE_PROTECTAPONY_MINIGUN -command [ modtools/create-unit -race PROTECTAPONY_MINIGUN -caste NORMAL -domesticate -location [ \\LOCATION ] ]
foe/reaction-trigger -reactionName MANUFACTURE_SPRITEBOT -command [ modtools/create-unit -race SPRITEBOT -caste MALE -domesticate -location [ \\LOCATION ] ]
FYI foe/reaction-trigger is literally just modtools/reaction-trigger with bug fixes/expanded functionality (which doesn't matter in this case). I put the code for it
here a couple of weeks back, if you want to take a look.
Now that you mention it, the script call has -domesticate but not -setUnitToFort. Going by the lua code for create-unit, -setUnitToFort sets the civ and group ID to your fort's, while -domesticate only sets the group ID. I just created a unit to confirm it, and gui/gm-editor says that it's civ_id is -1. That might be the problem. I will add -setUnitToFort to my create-unit calls and see if it fixes things.