Page 1 of 1

Error when scripting ScenEdit_AddUnit

Posted: Thu May 14, 2020 5:24 pm
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?



RE: Error when scripting ScenEdit_AddUnit

Posted: Thu May 14, 2020 10:44 pm
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

RE: Error when scripting ScenEdit_AddUnit

Posted: Fri May 15, 2020 7:33 am
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.