Page 1 of 1

ProsecutionArea via LUA

Posted: Sun Apr 26, 2020 5:53 am
by Parel803
I try to make a mission via Lua for a special event.
There's a good change I'm doing something wrong here. But for me it looks like the refpoints put in the mission under tab "Prosecution Area" are the same ones as under "Patrol Area".
With Regards


Image

RE: ProsecutionArea via LUA

Posted: Mon Apr 27, 2020 4:05 am
by KnightHawk75
Interesting find that I definitely could repo.

Work around: Do two separate statements first one that does patrol and all your other stuff then another that just does prosecutionzones.

mission = ScenEdit_SetMission('NATO','Cap1',{patrolzone={'some1','some2','some3','some4'}})
mission = ScenEdit_SetMission('NATO','Cap1',{prosecutionzone={'some5','some6','some7','some8'}})

So I fired up a debugger to have a look as to why it doesn't work when both are included in one statement. From what I can tell the bug is that prosecutionzone gets processed first and set, but then later when the list is wiped to re-process patrolzone the clearing of the list first wipes out the prosecutionzone entries. Both routines are sharing the same list variable which when assigned to something else it's by reference, so later when patrolzone is processed it clears the var first - which by extension then clears the prosecution-zone settings by extension and I assume unintentionally.
This is something Michael \ devs will need to look at, probably just to change the routine to use two different 'list' vars instead of sharing one.



RE: ProsecutionArea via LUA

Posted: Mon Apr 27, 2020 5:22 am
by michaelm75au
Logged 0013869

RE: ProsecutionArea via LUA

Posted: Mon Apr 27, 2020 6:07 am
by Parel803
Thx for helping out.
with regards