Matrix Games Forums

Forums  Register  Login  Photo Gallery  Member List  Search  Calendars  FAQ 

My Profile  Inbox  Address Book  My Subscription  My Forums  Log Out

[WAD]ScenEdit_SetZone Lua code not executing properly if there are more than one instance of it

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
  Printable Version
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Tech Support >> [WAD]ScenEdit_SetZone Lua code not executing properly if there are more than one instance of it Page: [1]
Login
Message << Older Topic   Newer Topic >>
[WAD]ScenEdit_SetZone Lua code not executing properly i... - 9/28/2021 11:07:32 PM   
BDukes

 

Posts: 1629
Joined: 12/27/2017
Status: offline
Hi All

I'm trying to create multiple special actions using the Scenedit_SetZone Lua code. It executes fine for the first zone and action push. With the second (different zone,same side) it doesn't execute properly. This also true in the Lua console. It either doesn't do anything at all or picks up the first zone although the code of the second specifies differently.

Load the test scenario. Try and execute the Remove Square and Circle ADZ. Square works but circle does not. Sometimes Square is delete when circle is pushed.

Couple of other observations:

The focus in the create Nav Zone windows is kind of screwy when you have multiples. When you make a change it will keep hop to the first zone. You then have to renavigate down the zone you were working on. I mention this because its similar.

If you delete the square code and try and execute the circle. It still doesn't execute unless you create a new scenario and create the circle first.

Thanks!

Mike

< Message edited by Dimitris -- 11/4/2021 12:21:44 PM >


_____________________________

Don't call it a comeback...
Post #: 1
RE: ScenEdit_SetZone Lua code not executing properly if... - 9/29/2021 2:27:46 AM   
KnightHawk75

 

Posts: 1403
Joined: 11/15/2018
Status: offline
If just trying to set them inactive there is typo in the Circle-ADZ one where you have
inActive= instead of the correct field of isActive= (which is correct in the square one)
I had no problems after correcting that, Circle and Square get disabled without issue.









< Message edited by KnightHawk75 -- 9/29/2021 2:31:06 AM >

(in reply to BDukes)
Post #: 2
RE: ScenEdit_SetZone Lua code not executing properly if... - 9/29/2021 11:50:03 AM   
BDukes

 

Posts: 1629
Joined: 12/27/2017
Status: offline

quote:

ORIGINAL: KnightHawk75

If just trying to set them inactive there is typo in the Circle-ADZ one where you have
inActive= instead of the correct field of isActive= (which is correct in the square one)
I had no problems after correcting that, Circle and Square get disabled without issue.



Thanks for the code correction! Unfortunately, the issue isn't resolved by it. I did that on the fly and built it because I was seeing it in a very larger scenario and didn't want to give the devs an eyeful to sort through.

I'm using 1147.30 and when I execute the remove the circle special action code the square zone is removed. Same behavior as above. If you're using a newer version and its fixed. That's great. Let me know.

I've updated the test file in the first post.

Thank you!

Mike

_____________________________

Don't call it a comeback...

(in reply to KnightHawk75)
Post #: 3
RE: ScenEdit_SetZone Lua code not executing properly if... - 9/29/2021 4:34:32 PM   
KnightHawk75

 

Posts: 1403
Joined: 11/15/2018
Status: offline
Mike,
The test file you re-attached does not appear to be updated (it still contains 'inactive').
If it helps I've attached my update of your original with the corrected code, that I can't seem to repo your problem with in v1147.30 on my system. I noticed last night I failed to mention i added "description=" identifier before the name (second nature so probably why I forgot to mention it), as well which was missing, so that it knows which one you want to operate on.

edit:
BTW - The reason it appears to work (and doesn't error) when you don't specify description correctly is the description ends up null and the way the compares works two nulls end up being compared to each other during the process resulting in a match with the first entry in the list of zones (hence the square in your is always operated on).


Attachment (1)

< Message edited by KnightHawk75 -- 9/29/2021 5:47:03 PM >

(in reply to BDukes)
Post #: 4
RE: ScenEdit_SetZone Lua code not executing properly if... - 9/29/2021 4:55:15 PM   
BDukes

 

Posts: 1629
Joined: 12/27/2017
Status: offline
Thank KH your file works.

My file still doesn't though. I've attached my current file to this email.

Here's a link to a movie showing what happens on my computer.

https://www.dropbox.com/s/f7oc161yg66mp2y/2021-09-29%2012-47-17.mp4?dl=0

The only thing I can add is maybe editing isn't really making a change to what is saved to the file?

BTW if this does turn out to be me being a dolt. Sorry in advance.

Mike

Attachment (1)

< Message edited by BDukes -- 9/29/2021 4:57:27 PM >


_____________________________

Don't call it a comeback...

(in reply to KnightHawk75)
Post #: 5
RE: ScenEdit_SetZone Lua code not executing properly if... - 9/29/2021 5:45:49 PM   
KnightHawk75

 

Posts: 1403
Joined: 11/15/2018
Status: offline
Mike,
In the mp4 (helpful) I don't see the Description= added in yours.

Code should be as provided in mine.
ScenEdit_SetZone('Blue', 0, {Description='Circle-ADZ', isActive=false})

ScenEdit_SetZone('Blue' ,0, {Description='Square-ADZ',isActive=false})


It's an easy mistake to make.

< Message edited by KnightHawk75 -- 9/29/2021 5:50:06 PM >

(in reply to BDukes)
Post #: 6
RE: ScenEdit_SetZone Lua code not executing properly if... - 9/29/2021 6:14:34 PM   
BDukes

 

Posts: 1629
Joined: 12/27/2017
Status: offline

quote:

ORIGINAL: KnightHawk75

Mike,
In the mp4 (helpful) I don't see the Description= added in yours.

Code should be as provided in mine.
ScenEdit_SetZone('Blue', 0, {Description='Circle-ADZ', isActive=false})

ScenEdit_SetZone('Blue' ,0, {Description='Square-ADZ',isActive=false})


It's an easy mistake to make.


I'm a dolt and you're in line for sainthood.

Thank you very much KN.

Mike


_____________________________

Don't call it a comeback...

(in reply to KnightHawk75)
Post #: 7
Page:   [1]
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Tech Support >> [WAD]ScenEdit_SetZone Lua code not executing properly if there are more than one instance of it Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts


Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI

0.172