Page 1 of 1

Setting Loadout

Posted: Fri Oct 09, 2020 11:25 pm
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

RE: Setting Loadout

Posted: Sat Oct 10, 2020 12:04 am
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.

RE: Setting Loadout

Posted: Sat Oct 10, 2020 12:04 pm
by Gunner98
Thank you once again. Worked like a charm and helps that I'm awake this morning as well...

Cheers