Error when scripting ScenEdit_AddUnit

All discussions & material related to Command's Lua interface

Moderators: RoryAndersonCDT, michaelm75au, angster, MOD_Command

Post Reply
jkgarner
Posts: 175
Joined: Thu Apr 30, 2020 12:42 pm

Error when scripting ScenEdit_AddUnit

Post by jkgarner »

I have a script to quickly create some ships...
when I run it, it returns the error:

ScenEdit_AddUnit 0 : ,Unable to create new unit


I reduced the code to the following line, which produces the same error:



ScenEdit_AddUnit({side='USA',type='Ship', name='USS BOXER (LHD-4)', dbid=428, lat= 7.00, lon= 118.48})



I was able to create the unit through the GUI.
I do not want to create all my units one at a time in the GUI... it takes too long.
I really want the script to run properly.
What have I missed?


KnightHawk75
Posts: 1850
Joined: Thu Nov 15, 2018 7:24 pm

RE: Error when scripting ScenEdit_AddUnit

Post by KnightHawk75 »

ScenEdit_AddUnit({side='USA',type='Ship', name='USS BOXER (LHD-4)', dbid=428, lat= 7.00, lon= 118.48})

Tip, don't try and create a ship over land?
Try 118.52 for longitude for example.


Image
Attachments
cmo_overland.jpg
cmo_overland.jpg (46.99 KiB) Viewed 226 times
jkgarner
Posts: 175
Joined: Thu Apr 30, 2020 12:42 pm

RE: Error when scripting ScenEdit_AddUnit

Post by jkgarner »

BOINK!
That was a bonehead error.

As soon as I ensured that the ships were created in the water, it worked like a charm.
Thanks.
Post Reply

Return to “Lua Legion”