Page 1 of 1

Lua ScenEdit_AddUnit issue

Posted: Sat Jun 10, 2017 7:04 pm
by Hestia
I tried to add a downed pilot to a scenario through Lua script, but no matter what I do I end up with the downed pilot and an unknown contact "MOBILE #11" (class unknown, side unknown) on the same location as the downed pilot.
This is the action I use:

Code: Select all

ScenEdit_AddUnit({type = 'Land', name = "Pilot #1", dbid = 2046, side = 'NATO', latitude = '22.16', longitude= '-79.70', autodetectable = 'true', holdfire = 'true', proficiency = 4})
I tried different triggers (time, random time, unit enters area...) but no luck.
What am I doing wrong?

RE: Lua ScenEdit_AddUnit issue

Posted: Sat Jun 10, 2017 7:09 pm
by CCIP-subsim
I think Mikmyk ran into an issue like this before, so he may be able to expand - it may be a problem with the "autodetectable" part. Try and take it out (or set it 'false') and see if that fixes it. If you actually need the unit to be autodetected, then just add another line below and change it to "true" via ScenEdit_SetUnit()

RE: Lua ScenEdit_AddUnit issue

Posted: Sat Jun 10, 2017 7:24 pm
by Hestia
It worked! Thank you, CCIPsubsim, you saved my day.