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

Post bug reports and ask for game support here.

Moderator: MOD_Command

Post Reply
BDukes
Posts: 1797
Joined: Wed Dec 27, 2017 12:59 pm

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

Post by BDukes »

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
Don't call it a comeback...
KnightHawk75
Posts: 1556
Joined: Thu Nov 15, 2018 7:24 pm

RE: ScenEdit_SetZone Lua code not executing properly if there are more than one instance of it

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







BDukes
Posts: 1797
Joined: Wed Dec 27, 2017 12:59 pm

RE: ScenEdit_SetZone Lua code not executing properly if there are more than one instance of it

Post by BDukes »

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...
KnightHawk75
Posts: 1556
Joined: Thu Nov 15, 2018 7:24 pm

RE: ScenEdit_SetZone Lua code not executing properly if there are more than one instance of it

Post by KnightHawk75 »

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).
Attachments
KH_Remove..allylua.zip
(6.42 KiB) Downloaded 1 time
BDukes
Posts: 1797
Joined: Wed Dec 27, 2017 12:59 pm

RE: ScenEdit_SetZone Lua code not executing properly if there are more than one instance of it

Post by BDukes »

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/f7oc161yg66mp ... 7.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
Attachments
Removemul..allylua.zip
(6.43 KiB) Not downloaded yet
Don't call it a comeback...
KnightHawk75
Posts: 1556
Joined: Thu Nov 15, 2018 7:24 pm

RE: ScenEdit_SetZone Lua code not executing properly if there are more than one instance of it

Post by KnightHawk75 »

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

Code should be as provided in mine.

Code: Select all

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

Code: Select all

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

It's an easy mistake to make.
BDukes
Posts: 1797
Joined: Wed Dec 27, 2017 12:59 pm

RE: ScenEdit_SetZone Lua code not executing properly if there are more than one instance of it

Post by BDukes »

ORIGINAL: KnightHawk75

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

Code should be as provided in mine.

Code: Select all

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

Code: Select all

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

Return to “Tech Support”