Interacting with traps (On Touch vs Action Button)

Discussion in 'RPG Maker MV' started by Pine Towers, Mar 11, 2017.

  1. Pine Towers

    Pine Towers Knight Hospitaller Veteran

    Messages:
    466
    Likes Received:
    220
    Location:
    Brasil, Rio de Janeiro
    First Language:
    Portuguese
    Primarily Uses:
    RMMV
    Hi there, guys!

    I'm with a problem here: I want my players able to deal with traps instead of just avoiding (or activating) them.

    The adventurer's party is running down the corridor to the treasure room after dealing with the undead that infested this old crypt. Paying attention to the details, the Thief noticed one that one of the tiles on the floor have a different pattern from all the others. Afraid it might be a trap, he uses a pole to press such tile, revealing a 10 feet hole underneath it. Whoa, that would have been one heck of a fall.

    The problem here is that interacting with an event is either Action Button or Player Touch (or Event Touch, or Parallel, or Autorun...) and I can't find a way to trigger this without making a second (invisible) event to be the player-interaction trap. This sucks because I would need sometimes 4 such events (each for each adjacent square) and deal with global switchs instead of self switches (so the player would not deactivate the same trap thrice - each for each side - and fall in it because he entered the square from another angle).

    Any help on how to deal with this? Thanks!
     
    #1
  2. Andar

    Andar Veteran Veteran

    Messages:
    28,333
    Likes Received:
    6,445
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    You have to use self-switches and regular triggers, but not in the way you assume it would be.

    Here's how I would do this:
    First step is to make a variable to store the party/thief perception value. This has to be updated whenever the thief gets better.

    Second, make all your traps have three event pages - the first one for the undetected trap dealing damage to the party, the second one for a detected trap and the third one for a disarmed trap.

    Second page should have the condition "perception variable higher than n", with n the value you want the thief to have to be able to detect the trap - that will switch the trap to the second page if the thief has a high enough perception value.

    On the content of the second page, you do whatever messages and commands you want the player to follow to disarm the trap - for example just a series of show text with automatic disarm on player touch, a show choice or select item command on touch to allow the player choices in how to disarm the trap and so on. If successfull (no matter from which side), set a self-switch to activate the disarmed page that does nothign and vanishes the trap.
     
    #2
  3. Pine Towers

    Pine Towers Knight Hospitaller Veteran

    Messages:
    466
    Likes Received:
    220
    Location:
    Brasil, Rio de Janeiro
    First Language:
    Portuguese
    Primarily Uses:
    RMMV
    Thank you, @Andar for your quick response. But I didn't made myself clear enough (my fault!). I want the player to deal with the trap - he must notice the loose tile, so to not work on the thief perception variable (although that is a good idea, but maybe to ease the difference like even changing the color of the tile to help the player notice thats something's wrong).

    In the example I gave, it would be the player's idea to pay attention to the tiles and, noticing a difference, he goes adjacent to interact with it - not the (game) actor perceiving it (due to some variable).
     
    #3
  4. Andar

    Andar Veteran Veteran

    Messages:
    28,333
    Likes Received:
    6,445
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    then make a skill "trap disarming" that calls a common event as an effect.
    In the common event, use control variable to get the player position, then conditional branches checking the player facing to calculate the neighbor position in that direction.
    With that neighbor position, use get location info to either get an event ID or a region ID of that tile (depends on how your traps work).

    If that result is a trap, initiate the disarming from the common event.

    And if you make the skill expensive enough the player won't use it on every tile they see - for example in the common event, give the pole a chance of breaking and remove one from inventory in that case, and have the common event message "no pole to test" instead of testing if there is none in the inventory.
     
    #4
    Doombringer and Pine Towers like this.
  5. Pine Towers

    Pine Towers Knight Hospitaller Veteran

    Messages:
    466
    Likes Received:
    220
    Location:
    Brasil, Rio de Janeiro
    First Language:
    Portuguese
    Primarily Uses:
    RMMV
    @Andar That is just what I wanted! Thank you very much!
     
    #5
  6. Galv

    Galv Veteran Veteran

    Messages:
    1,172
    Likes Received:
    1,105
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    N/A
    #6
    Pine Towers and Doombringer like this.
  7. Pine Towers

    Pine Towers Knight Hospitaller Veteran

    Messages:
    466
    Likes Received:
    220
    Location:
    Brasil, Rio de Janeiro
    First Language:
    Portuguese
    Primarily Uses:
    RMMV
    @Galv , thank you for your plugin! Looks like exactly what I need, with the ease of use I wanted!
     
    #7

Share This Page