ProsecutionArea via LUA

All discussions & material related to Command's Lua interface

Moderators: RoryAndersonCDT, michaelm75au, angster, MOD_Command

Post Reply
Parel803
Posts: 962
Joined: Thu Oct 10, 2019 3:39 pm
Location: Netherlands

ProsecutionArea via LUA

Post 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
Attachments
Prosecutio..efPoints.jpg
Prosecutio..efPoints.jpg (420.58 KiB) Viewed 212 times
KnightHawk75
Posts: 1850
Joined: Thu Nov 15, 2018 7:24 pm

RE: ProsecutionArea via LUA

Post 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.


User avatar
michaelm75au
Posts: 12464
Joined: Sat May 05, 2001 8:00 am
Location: Melbourne, Australia

RE: ProsecutionArea via LUA

Post by michaelm75au »

Logged 0013869
Michael
Parel803
Posts: 962
Joined: Thu Oct 10, 2019 3:39 pm
Location: Netherlands

RE: ProsecutionArea via LUA

Post by Parel803 »

Thx for helping out.
with regards
Post Reply

Return to “Lua Legion”