Switch flips if event variable is in array, but not if the player leaves the map and returns.

Status
Not open for further replies.

ImaginaryVillain

"Hero" of Light, now with cool hat!
Veteran
Joined
Jun 22, 2019
Messages
309
Reaction score
944
First Language
Absurdism
Primarily Uses
RMMV
This.... has a lot of moving parts so in the interest of not having a million screenshots, I'll try and restrict it to the "important" stuff. However if you need additional info I'll provide it.

There are two plugins at play here.... Yanfly's Self Switches and Variables, and Galv's Event Spawner.

The scenario is I've spawned a torch event on a blank map, it defines an array in it's self variable 2 (Variable 26), then switches to a page that's reporting it's ID ($gameVariable(2)) and the Map ID($gameVariable(3)). When player makes a pathway, it runs screenshot 3... Then goes to a blank page set to action button. It's pretty much just reporting it's event ID, then running the common event "Path Locations Check" in screenshot 2. The plan is simply to push it onto the array in the torch's self variable 2 for later use. So far so good, this variable reports the array sets up perfectly and is still reported as the same when I return to the map.

Now we get to the problem, another event (screenshot 4) is created and checks for the space in front of it. If the eventID of that location isn't 0, then it report it's own eventID and runs the common event "Path Destroy Check" (Screenshot 1). This event flips a switch if the eventID is in the self variable array. If it flips the switch then both events are despawned, and the eventID is removed from the array. Up until this point, it all works....

But then if I leave the map and return, it no longer recognizes anything in the array that was placed there previously. The array still reports as having the IDs in there though. And any new IDs added to the array still trigger as normal.

Been puzzling over it for a few days, but since I'm pretty new to scripting, there's probably something silly I'm missing. Anybody have any ideas?

Edit: I moved the event holding the self variable to a non-spawned event, just to eliminate Galv's Event Spawner from the equation. The problem persists though.
 

Attachments

Last edited:

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,350
Reaction score
332
First Language
German
Primarily Uses
RMMV
Iam not sure but the Eventpage on Picture3 is on Autorun, that is used for Cutscenes so the Player cant move,
iam not sure but i believe other parallel Events wait until the autorun is finished(Not 100% sure, i dont have time to test it at the moment).
Try Parallel instead of Autorun.
 

ImaginaryVillain

"Hero" of Light, now with cool hat!
Veteran
Joined
Jun 22, 2019
Messages
309
Reaction score
944
First Language
Absurdism
Primarily Uses
RMMV
Huh, I didn't even notice that thanks. I switched it, probably accounts for some other weird behavior the event was having. Sadly it didn't end up solving this problem though.

I tried another way of doing things, and it would work but then entering the map again would make it destroy all events. Then I started noticing a lot of other unexplained glitches like suddenly the player ignored tile passability, or entering rooms at odd locations. I think the game itself may have just become corrupted.... I've got backups, so before I pester people too much about this. I'm going to make certain that's not the problem. Also it could just be Yanfly's Self Variables.... it interacts weirdly with well, everything. ;_;

Edit: The instability was by playing with the interaction of commands executed after Transfer commands. As I was unable to get consist results with the system remembering arrays in Self Variables (sometimes it did, sometimes it didn't, sometimes it only remembered stuff added to it later), I created a work around using Galv's Puzzle functions and ditched the arrays entirely. Problem solved!
 
Last edited:

Kes

Global Moderators
Global Mod
Joined
Aug 3, 2012
Messages
21,772
Reaction score
10,987
First Language
English
Primarily Uses
RMVXA

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Okay, that's the best I can do. Looks a little strange but..err.. it's my style, yeah, very original style..
being an extreme introvert with massive anxiety... I forget this is really, REALLY frustrating for people who are the exact opposite. still, wait this out and stay home...
I hope you all are keeping safe. <3 If you need a shoulder or an ear, I have two of both and am more than willing to listen & support you! Times are weird.
My dad, super frustrated by seclusion, asking me how I live like this. I shrug. "It helps to not like what is outside."
Apparently it's not just people who are hit by corona virus. My phone has set itself to English language on its own. Not that I'm complaining... :D

Forum statistics

Threads
95,443
Messages
929,187
Members
125,685
Latest member
imnotanepicgamer
Top