add a mount to a unit

All discussions & material related to Command's Lua interface

Moderators: michaelm75au, angster, RoryAndersonCDT, MOD_Command

Post Reply
orca
Posts: 545
Joined: Wed Nov 06, 2013 4:59 pm

add a mount to a unit

Post by orca »

I'm trying to add M142 HIMARS Spiral 3 to a unit. In the editor it says the ID is 3440 for this mount. I've found examples of adding a mount to a unit and have tried to use this.

such as:
ScenEdit_UpdateUnit({name='MYUNIT',mode='add_mount',arc_mount={'360'},dbid=3440})

but I get an error saying "Object reference not set to an instance of an object." Does this mean my dbid for the mount is incorrect? If this is the case how do I find out the dbid of a mount?
User avatar
blu3s
Posts: 1179
Joined: Fri Jul 08, 2022 9:45 am

Re: add a mount to a unit

Post by blu3s »

You need to use guid instead of name in the updateunit function.
User avatar
KLAB
Posts: 505
Joined: Tue Feb 27, 2007 5:24 pm

Re: add a mount to a unit

Post by KLAB »

https://www.matrixgames.com/forums/view ... 6&t=398167

We sort of covered it here and someone cleverer than me came up with some cool code.. Hope it helps?
K
Post Reply

Return to “Lua Legion”