Interacting with traps (On Touch vs Action Button)

Pine Towers

Knight Hospitaller
Veteran
Joined
Nov 11, 2015
Messages
467
Reaction score
226
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!
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,355
Reaction score
7,669
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.
 

Pine Towers

Knight Hospitaller
Veteran
Joined
Nov 11, 2015
Messages
467
Reaction score
226
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).
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,355
Reaction score
7,669
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.
 

Pine Towers

Knight Hospitaller
Veteran
Joined
Nov 11, 2015
Messages
467
Reaction score
226
First Language
Portuguese
Primarily Uses
RMMV
@Andar That is just what I wanted! Thank you very much!
 

Pine Towers

Knight Hospitaller
Veteran
Joined
Nov 11, 2015
Messages
467
Reaction score
226
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!
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,853
Messages
1,016,986
Members
137,561
Latest member
visploo100
Top