Page 1 of 1

LUA Console Help

Posted: Fri May 18, 2018 2:16 pm
by obrien979
I am trying to learn how to use LUA console and the first command I tried (ScenEdit_FillMagsForLoadout('{unit='King Khalid Air Base', loadoutid=16947, quantity=12}')) is not working. I am getting an error message that reads >> ScenEdit_FillMagsForLoadout('{unit='King Khalid Air Base', loadoutid=16947, quantity=12}')
ERROR: [string "Console"]:1: ')' expected near 'King'


I am trying to load a select weapons loadout for an aircraft that I have in the hanger and the said above Airport. I was looking for an easier way to calculate how much ammo should be stored in the magazines and found this code.

Can anyone please help me in this, Thank You


RE: LUA Console Help

Posted: Fri May 18, 2018 3:09 pm
by NimrodX
You have some quotes you don't need so it thinks for example '{unit=' is one string. remove the outer quotes.

Check the Lua forum and stickes for examples

All Forums >> [New Releases from Matrix Games] >> Command: Modern Air / Naval Operations >> Mods and Scenarios >> Lua Legion

RE: LUA Console Help

Posted: Fri May 18, 2018 3:13 pm
by obrien979
Figured it out! Just a fat finger error

RE: LUA Console Help

Posted: Fri May 18, 2018 3:24 pm
by NimrodX
Hmm... these extra quotes are also in the documentation:

Code: Select all

ScenEdit_FillMagsForLoadout('{unit='RAF Lakenheath', loadoutid=45162, quantity=12}')

Looks like a documentation bug?