As a precursor let me say that I'm a self-taught and very new coder who probably knows as little as somebody with 1 month of coding 101 under their belt.
I wrote this bit of code to try and get an event to flip itself and other nearby events:
It's a parallel event and the first bit of code works fine. It's when I get to Yanfly's "Lunatic Script Calls" in the if statement itself that seem to have an issue. There are 6 events involved starting with event 3. They each have a variation of this code and some of the events can trigger the cascade before the others since the true/false boolean for the if statement is based on proximity to the event itself (grabbing x,y coords etc.). This code is pulled from event 6, and you'll notice it missing in the set self switch calls.
Here's my issue: when I trigger say event 6, it will run the code like this pseudo-code (run code for events <=6(this event) then stop) . That is to say, events 3,4,5 will run. But 7 and 8 won't. It's the same issue for the others, if I grab event 4 I'll get event 3 and 4 triggered but not 5,6,7,8. And with 8 I get them all.
Now for some of you real coders out there this is probably not a hard fix, but I have no idea how to do it. Any and all help would be great.
Now I have to go to bed but I will check this thread and if you'd like a demo I will upload one.
Thanks in advance.
I wrote this bit of code to try and get an event to flip itself and other nearby events:
Code:
if (($gameVariables.value(7) - $gameMap.event(this.eventId()).x <= 2) && ($gameVariables.value(7) - $gameMap.event(this.eventId()).x >= -2) && ($gameVariables.value(8) - $gameMap.event(this.eventId()).y <= 2) && ($gameVariables.value(8) - $gameMap.event(this.eventId()).y >= -2) && ($gameSwitches.value(187) == true)){
this.setSelfSwitchValue(2, this.eventId(), 101, true);
this.setSelfSwitchValue(2, 3, 101, true);
this.setSelfSwitchValue(2, 4, 101, true);
this.setSelfSwitchValue(2, 5, 101, true);
this.setSelfSwitchValue(2, 7, 101, true);
this.setSelfSwitchValue(2, 8, 101, true);
}else{
this.setSelfSwitchValue(2, this.eventId(), 101, false);
}
It's a parallel event and the first bit of code works fine. It's when I get to Yanfly's "Lunatic Script Calls" in the if statement itself that seem to have an issue. There are 6 events involved starting with event 3. They each have a variation of this code and some of the events can trigger the cascade before the others since the true/false boolean for the if statement is based on proximity to the event itself (grabbing x,y coords etc.). This code is pulled from event 6, and you'll notice it missing in the set self switch calls.
Here's my issue: when I trigger say event 6, it will run the code like this pseudo-code (run code for events <=6(this event) then stop) . That is to say, events 3,4,5 will run. But 7 and 8 won't. It's the same issue for the others, if I grab event 4 I'll get event 3 and 4 triggered but not 5,6,7,8. And with 8 I get them all.
Now for some of you real coders out there this is probably not a hard fix, but I have no idea how to do it. Any and all help would be great.
Now I have to go to bed but I will check this thread and if you'd like a demo I will upload one.
Thanks in advance.