Lua Adding Mounts

All discussions & material related to Command's Lua interface

Moderators: angster, RoryAndersonCDT, michaelm75au, MOD_Command

Post Reply
Kushan04
Posts: 1169
Joined: Tue Jun 28, 2005 9:27 pm
Location: USA
Contact:

Lua Adding Mounts

Post 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.
User avatar
michaelm75au
Posts: 12457
Joined: Sat May 05, 2001 8:00 am
Location: Melbourne, Australia

RE: Lua Adding Mounts

Post 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)
Michael
Post Reply

Return to “Lua Legion”