Setting Loadout

All discussions & material related to Command's Lua interface

Moderators: angster, RoryAndersonCDT, michaelm75au, MOD_Command

Post Reply
User avatar
Gunner98
Posts: 5967
Joined: Fri Apr 29, 2005 12:49 am
Location: The Great White North!
Contact:

Setting Loadout

Post by Gunner98 »

This is probably another simple syntax issue but I've messed around a dozen ways:


local a=ScenEdit_GetUnit({name='20th Esc de Tpt BAF', side='NATO Sp'})
ScenEdit_SetLoadout ({UnitName='a', LoadoutID=14481, TimeToReady_Minutes=60})

Just trying to set the loadout of a unit on a base. Returns that it can't find the unit.

Any ideas? Thanks

B

Image
Attachments
Loadout.jpg
Loadout.jpg (75.08 KiB) Viewed 118 times
Check out our novel, Northern Fury: H-Hour!: http://northernfury.us/
And our blog: http://northernfury.us/blog/post2/
Twitter: @NorthernFury94 or Facebook https://www.facebook.com/northernfury/
KnightHawk75
Posts: 1850
Joined: Thu Nov 15, 2018 7:24 pm

RE: Setting Loadout

Post by KnightHawk75 »

Yup just syntax issue. No quotes around a. Also make it a.name or a.guid.

ScenEdit_SetLoadout ({UnitName=a.guid, LoadoutID=14481, TimeToReady_Minutes=60})

as for the GetUnit call, either the side doesn't exist\match with unit's side, or unit name is off (leading\trailing space or something) or is duplicated (2+ units with same name) on the side which can cause issues.
User avatar
Gunner98
Posts: 5967
Joined: Fri Apr 29, 2005 12:49 am
Location: The Great White North!
Contact:

RE: Setting Loadout

Post by Gunner98 »

Thank you once again. Worked like a charm and helps that I'm awake this morning as well...

Cheers
Check out our novel, Northern Fury: H-Hour!: http://northernfury.us/
And our blog: http://northernfury.us/blog/post2/
Twitter: @NorthernFury94 or Facebook https://www.facebook.com/northernfury/
Post Reply

Return to “Lua Legion”