LUA Console Help

All discussions & material related to Command's Lua interface

Moderators: RoryAndersonCDT, michaelm75au, angster, MOD_Command

Post Reply
obrien979
Posts: 33
Joined: Fri May 18, 2018 2:10 pm
Location: Germany

LUA Console Help

Post 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

V/R,
Brandon "OB" OBrien
User avatar
NimrodX
Posts: 82
Joined: Sat May 12, 2018 8:34 pm
Contact:

RE: LUA Console Help

Post 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
obrien979
Posts: 33
Joined: Fri May 18, 2018 2:10 pm
Location: Germany

RE: LUA Console Help

Post by obrien979 »

Figured it out! Just a fat finger error
V/R,
Brandon "OB" OBrien
User avatar
NimrodX
Posts: 82
Joined: Sat May 12, 2018 8:34 pm
Contact:

RE: LUA Console Help

Post 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?
Post Reply

Return to “Lua Legion”