Switch to next event page when the player presses the action button (like an action button trigger)?

● ARCHIVED · READ-ONLY
Started by Zain98 12 posts View original ↗
  1. I have an event with its trigger set to 'parallel process'. I want to switch to the next event page when the player presses the action button. For this, I need to determine the character's coordinates and whether he is facing the event. So yes, I need this to function just like an 'action button' trigger. How can I do that?
  2. How about having this event be separate from the one you want the player to click ("action button"), and instead make the clickable one set a switch to on, and then use that as the requirement for the second page in the parallel process event?
  3. No that won't do unless I can place two events on top of each other (if possible?).

    My event represents a lantern. The first part processes a glowing effect which is not possible without the trigger set to 'parallel process'. I want to switch to the next event page when 3 requirements are met:

    • the character has pressed the action button,
    • he is facing the event, and
    • he is right next to the event.
  4. Is the 'glowing' part of a spriteset? The graphics, I mean? If so, you do not need to set it to parallel process at all, simply check 'stepping animation ON' at the lower left corner.
  5. It does use a spriteset however the glowing effect is processed by a script. The graphic of the event is a lantern. Removing the parallel process trigger will not show the glowing effect. (btw I am using Victor's Lighting Engine)
  6. I'm not sure you need this for Victor's Lighting Engine, but there is a way to do what you want – and overlap two events. I made four images to show the two events:

    The first page of the button trigger event that will overlap the lantern (your other, parallel process event) is crucial. You'll need to place this one tile above the other event in the editor:

    • We set Through to On so it can pass through the other solid event
    • We set Speed to highest, so it will move almost immediately
    • We create a parallel process move route event that moves it one tile down, and afterwards turn self switch A to On, so it can switch to its second page.

    overlap_trigger.PNG

    This second page does whatever you want to happen when you touch and interact with the lantern:

    overlap_trigger2.PNG

    I also included sample lantern pages in case you needed a pointer on using the switch:

    overlap_trigger3.PNG

    overlap_trigger4.PNG
  7. I will test this and let you know soon. Thanks for the help.
  8. I don't think that'll work. The first event will move down the first time you enter the map. But when you leave the map and return, it will be back in its original position, and since the self switch is now on, it won't move down again.
  9. Shaz said:
    I don't think that'll work. The first event will move down the first time you enter the map. But when you leave the map and return, it will be back in its original position, and since the self switch is now on, it won't move down again.
    Yes that did happen, thanks for pointing it out. Instead, I figured out a way to manually place those glowing effects as mentioned in the instructions. So yes, my problem is solved.

    However, it seems my question remains unanswered. Let it be the use of variables or a script, I asked for a way to deduce whether the player is facing an event, standing right next to it and pressing the action button. Is that even possible? Please let me know because this may help me in the future. Thanks again for all the support.
  10. You can find out what's on the tile the player is facing by doing this:


    Control Variables [0001: facing x] = Script: $game_map.round_x_with_direction($game_player.x, $game_player.direction)


    Control Variables [0002: facing y] = Script: $game_map.round_y_with_direction($game_player.y, $game_player.direction)


    Control Variables [0003: event on facing tile] = Script: $game_map.event_id_xy($game_variables[1], $game_variables[2])


    That will give you 0 if there is no event on the tile in front of the player. If there IS an event on the tile in front of the player, it gives you the event id. So if your EV012 is in front of the player, variable 3 will be 12 (even if you've renamed the event).


    And there's already a conditional branch to detect whether the action button (C button) is being pressed. So you'd do that first (because there's no point in setting all those variables every frame, if the player is not pressing the button), then set the variables above, then check if variable 3 is the number of the event you're interested in.
  11. Much appreciated, Shaz! You may close this thread now.
  12. 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.