Thank you....
How can I make an event that need at least 3 other events to be active?
RPG Maker MZ SupportI think you are going to need to provide a bit more information about what exactly you are trying to do.
an event that should happen only if 3 pre events had been occured...
In each of the 3 events, once it's done, turn on a switch and have a conditional branch that checks whether all three switches are on. If so, turn on a 4th switch. Use that switch as the condition for the event that happens after.
a conditional branch should be in each event or just in the last one?
In each of the three that need to be on in order to activate the fourth.
Or choose one variable, add 1 to it in each of the other events, then the fourth one has a conditional branch that checks whether the variable is = 3
The issue with that approach is that there's no single value for the variable you could use to determine that a given event has completed or not. It would work if you were using self switches.
The method I would use for that is assigning binary values to the events: one 1, one 2, one 4, and then you can tell which one is complete or not by the value of the variable: if it's 3, you know you've done events 1 and 2. But I felt that might be a bit technical for OP's comfort, so I went with the safer switch suggestion. ^_^
Yes, one should use self switches to disable the individual events. I think that's preferable to using up 3 of your global things and making the conditional more convoluted in the ultimate event.
But I absolutely agree with you that that was implicit and relying on an understanding of how to use events that the OP hasn't demonstrated 🙂
So to that I add the suggestion: @rori, I suggest you look up some event tutorials on YouTube and follow along with them to practice how to use events, event pages, variables and switches.
These are very basic tools to do things in your game.
I was curious about the self switch route so I just wanted to try it out. It's not the only way to do it, of course.
...Probably easier to just use game switches, but if you are interested:
You'll need to keep track of the map ID, event IDs, and the self switch that each event is using.
In this case, I am using Map 3, Events 2-4 using Self Switch A, and Event 5 needing the other events to change its Self Switch A to ON.
Since I didn't want to deal with parallel checking, I just checked by placing this IF statement after each event switches its selfswitch (in case you were wanting to have the player interact with the three events in any order):
...Probably easier to just use game switches, but if you are interested:
You'll need to keep track of the map ID, event IDs, and the self switch that each event is using.
In this case, I am using Map 3, Events 2-4 using Self Switch A, and Event 5 needing the other events to change its Self Switch A to ON.
Since I didn't want to deal with parallel checking, I just checked by placing this IF statement after each event switches its selfswitch (in case you were wanting to have the player interact with the three events in any order):
JavaScript:
let ss = $gameSelfSwitches._data;
if (ss['3,2,A'] && ss['3,3,A'] && ss['3,4,A'])
ss['3,5,A'] = true;
Original thread: https://forums.rpgmakerweb.com/threads/how-can-i-make-an-event-that-need-at-least-3-other-events-to-be-active.164841/