I have made an ordered switch puzzle from a tutorial, Everything seems to work properly except, Switch 1 and Switch 2 activate simultaneously even though the conditions are different. I wondered if someone can see something I'm missing. Below are the two pages of Switch 1 and 3 pages of Switch 2. Thank you.
Switch puzzle event problem.
RPG Maker VXAce Supportmaybe the sprite of the button is wrong and not the logic?
red button is "enabled" on spawn, green button is "enabled" only after the trigger.
red button is "enabled" on spawn, green button is "enabled" only after the trigger.
.I will definitely check that. Thank you
@dnel57 your red switch should have an active sprite at its second page, from the looks of it. In any case, in order to avoid such mistakes, I recommend using a different page only when you actually need a different sprite and using conditional branches instead.
In your case, it would mean using the following logic for the first page of your red switch (pseudo-code).
As things stand, there is no need to set your variable to 0 where you are setting it, since running the event in that page means its value is already 0.
Due to this, I ask you: do you, by any chance, have more than 2 switches?
In your case, it would mean using the following logic for the first page of your red switch (pseudo-code).
Code:
if (variable 20 == 1) then
play sound
variable 20 = 2
else
play sound
wait 60
set move route
turn right
wait 40
turn down
end
As things stand, there is no need to set your variable to 0 where you are setting it, since running the event in that page means its value is already 0.
Due to this, I ask you: do you, by any chance, have more than 2 switches?
Yes, 4.
In that case, since the conditions used in your other switches can also be affected by the two you listed here, it would be best to post all your switches here as well. If not, we might end up giving you advice that fixes the issue with the first two switches (as the one I proposed), but breaks the other two.
Solved the problem. I had an unwanted line in the comments and a wrong priority selected. Thank you all for your help.
This thread is closed due to being reported as solved. If you need it reopened, let us know. Thank you!
Original thread: https://forums.rpgmakerweb.com/threads/switch-puzzle-event-problem.169054/