Page 1 of 1

Lua Adding Mounts

Posted: Thu Nov 26, 2020 3:57 am
by Kushan04
I'm trying to add mounts to units via Lua. In this test I was trying to add another M1A2 SEP Abrams mount to an existing armored unit.

>> ScenEdit_UpdateUnit({guid='P40YQP-0HM4HQ52CI28L',mode='add_mount',dbid=2883})

BUT Its kicking back an error:

ScenEdit_UpdateUnit 0 : ,No targeting arcs supplied for mount M1A2 SEP Abrams Main Battle Tank

I've tried all the arc settings from ScenEdit_UpdateUnit. Anyone have an idea what I'm doing wrong? I'm sure its something simple and right in front of my face.

RE: Lua Adding Mounts

Posted: Thu Nov 26, 2020 5:01 am
by michaelm75au
A mount requires an arc; same as if you added thru the editor.

local arc360 = {'360'}
local ok = ScenEdit_UpdateUnit({guid='P40YQP-0HM4HQ52CI28L',mode='add_mount',dbid=2883,arc_mount=arc360})
print(ok)