Event with different triggers on different pages

Ok, I'm trying to get my head around event pages and I'm beginning to understand something, what I really can't do is using different triggers for the same event. I'm trying to get the player to push a box running into it (trigger: player touch, the box moves away from him as he steps forward) and pulling it by activating it (trigger: action button, the box moves toward the player as he steps backwards) but obviously only the page with the highest number works and I can't get the other trigger to activate, ever.
Can someone please help?
There are several tutorials around for that, but basically you're correct, only the page with the highest number (that has all conditions fulfilled) is active.


However, you can use conditional branches and parallel processes to check for different options - it's just a bit more complex to event.


I suggest you follow the link to the starting point in my signature - it does not contain tutorials specific to your problem, but it does contain tutorials that give a better overview on how to handle what parts.
I did read your tutorials and thank you for answering, what I can still can't get my head around is how to check if the player is pushing the action button or bumping into the event: with conditional branches I can check for variables but not for these triggers, yes I can check for a button press but is this the only way to do it?
 
Someone wrote a tutorial explaining how to implement a push/pull method on an event using a single event page.  Please take a look through the VX Ace Tutorials forum - the implementation in MV should be exactly the same.
The problem with your script was basically the same:
the event was a parallel process running "Plugin Command: SmartPath 0 -1", self switch a = on and a second page on event touch and self switch a = on the ran a game over screen.
Same problem, I can't find a way to tell this event "follow the player AND if you touch it it's game over". It's one or the other.
Use two events.  The first event is the one you want to follow the player.  Give it the Event Touch and Gameover commands.


The second event is a parallel process event that calls the plugin command to make the first event follow the player (the command can be called from one event and apply to another event), followed by an Erase Event command.


Parallel process events repeat by default.  You only need to execute the plugin command once, not in a loop.


If you only want this to happen once, and not restart when you come back to the map, you could get away with it with a single event like you've done, by turning on a self switch after the plugin command, and conditioning the second page by that self switch.  But if you want the event to keep chasing you every time you go to that map, you need to use the two-event method.
Ok, I'm trying to get my head around event pages and I'm beginning to understand something, what I really can't do is using different triggers for the same event. I'm trying to get the player to push a box running into it (trigger: player touch, the box moves away from him as he steps forward) and pulling it by activating it (trigger: action button, the box moves toward the player as he steps backwards) but obviously only the page with the highest number works and I can't get the other trigger to activate, ever.
Can someone please help?



I agree that this is a difficult case, but I'll give my ideas:


First, keep in mind that if you want both possibilities (pushing and pulling) to be available at the same time, you can only have one page in the event.  As you pointed out, only the highest number page with conditions met is active.


Secondly, keep in mind that when the event is activating, it treats every trigger as equivalent.  Therefore, you'll want to make the event activate on Player Touch, which means that standing by the event and pressing Enter will have the same effect as pushing.  But wait, we now need a way to split that "same effect" into multiple effects.  Here are a few ways we could try:


1.  A simple solution would be to let the player face the object, then when they press Enter/click on the object, a menu opens with the options Push, Pull, and Cancel.  The player can choose what they want, and the event does the appropriate Force Move Route commands to make the player and object move where they should.  This would be easy to make in RPG Maker MV.  I suggest this easiest option if you plan to only have a few places in your game with the push/pull mechanic.


2.  Make a push or a pull only happen only when a certain button is either (A) held down or (😎 pressed once.

  • (A) To make a process only happen when a key is held down, you can place a Conditional Branch in the event's page, and in the Conditional Branch tab 4 you'll see "Button ___ is pressed down."  You can select which button you want!
  • (A possibility two) If this does not work directly in the event, you may try creating an extra event set to Parallel Process in the corner of your map or as a common event, and have that parallel process constantly check for a button press.
  • (😎 You can also use Yanfly's Button Common Events plugin to make a common event run when certain buttons are pressed.  In this way, you can have a button for pushing and a button for pulling.

So, you could have moving into the object push it, and standing by it and pressing a button pull it.  If you are trying to do this with eventing as above, I highly suggest looking into Yanfly's Button Common Events plugin, as I think this is the way to go.


3.  Alternatively, this type of puzzle could be scripted in Javascript to be added to your game.  If you want to try that, I suggest checking out SumRndmDde's tutorials.  A scripted solution may be best if you plan on using this type of pushing/pulling frequently in your game.


I hope that helps!
Use two events.  The first event is the one you want to follow the player.  Give it the Event Touch and Gameover commands.


The second event is a parallel process event that calls the plugin command to make the first event follow the player (the command can be called from one event and apply to another event), followed by an Erase Event command.


Parallel process events repeat by default.  You only need to execute the plugin command once, not in a loop.


If you only want this to happen once, and not restart when you come back to the map, you could get away with it with a single event like you've done, by turning on a self switch after the plugin command, and conditioning the second page by that self switch.  But if you want the event to keep chasing you every time you go to that map, you need to use the two-event method.



Tested, it doesn't works. It runs once then it erases itself, if I save and load the event is gone and won't run again.
Yep, I confirm. Erased event don't return on loading.
I agree that this is a difficult case, but I'll give my ideas:


First, keep in mind that if you want both possibilities (pushing and pulling) to be available at the same time, you can only have one page in the event.  As you pointed out, only the highest number page with conditions met is active.


Secondly, keep in mind that when the event is activating, it treats every trigger as equivalent.  Therefore, you'll want to make the event activate on Player Touch, which means that standing by the event and pressing Enter will have the same effect as pushing.  But wait, we now need a way to split that "same effect" into multiple effects.  Here are a few ways we could try:


1.  A simple solution would be to let the player face the object, then when they press Enter/click on the object, a menu opens with the options Push, Pull, and Cancel.  The player can choose what they want, and the event does the appropriate Force Move Route commands to make the player and object move where they should.  This would be easy to make in RPG Maker MV.  I suggest this easiest option if you plan to only have a few places in your game with the push/pull mechanic.


2.  Make a push or a pull only happen only when a certain button is either (A) held down or (😎 pressed once.

  • (A) To make a process only happen when a key is held down, you can place a Conditional Branch in the event's page, and in the Conditional Branch tab 4 you'll see "Button ___ is pressed down."  You can select which button you want!
  • (A possibility two) If this does not work directly in the event, you may try creating an extra event set to Parallel Process in the corner of your map or as a common event, and have that parallel process constantly check for a button press.
  • (😎 You can also use Yanfly's Button Common Events plugin to make a common event run when certain buttons are pressed.  In this way, you can have a button for pushing and a button for pulling.

So, you could have moving into the object push it, and standing by it and pressing a button pull it.  If you are trying to do this with eventing as above, I highly suggest looking into Yanfly's Button Common Events plugin, as I think this is the way to go.


3.  Alternatively, this type of puzzle could be scripted in Javascript to be added to your game.  If you want to try that, I suggest checking out SumRndmDde's tutorials.  A scripted solution may be best if you plan on using this type of pushing/pulling frequently in your game.


I hope that helps!



Thank you but that would be VERY clunky. All I wanted to do was run into the object to push it, activate to pull it. 
va2k0r, please avoid double posting, as it is against the forum rules. You can review our forum rules here. Thank you.


Can you provide a link to the tutorial you followed, and provide screenshots of your event?  If you have several tabs/pages, show images of each one.  Make sure to include the whole event window, not just the commands.
I'm still working on the smart path thing. The only way I can get it to work is a parallel event telling all events, one by one, to follow the player. That way re-entering the map and loading a game don't break it. Or I could do an autorun event on load and map-enter, there are scripts for that.
Please show us screenshots of your events and tell us what you want to happen instead of how you want it to happen.


In most posts above you tell us only how you want to do something (I want to use xyz) instead of what (I want a minigame/map/sequence where the player does abc).


I suspect that you're going at the entire aspect from the wrong direction, but we can't really tell the correct way until we know what you want to achieve.

Original thread: https://forums.rpgmakerweb.com/threads/event-with-different-triggers-on-different-pages.57632/