Pressure plate type switch

Furiso

Warper
Member
Joined
Jan 23, 2014
Messages
4
Reaction score
0
First Language
English
Primarily Uses
[SIZE=medium]Hi[/SIZE]

[SIZE=medium]I’m new to RPG maker and looking for an efficient way to make a pressure type switch. [/SIZE]

[SIZE=medium]Basically my scenario is the player character being chased by angry monsters (pathing set to follow player) but when he steps behind a rock and is hidden I want the monsters to move away from the player at a slower speed.[/SIZE]

[SIZE=medium]I’ve thought about doing it with the area around the rock set to ‘player touch’ events turning the switch off and the rock tile with a switch turning it on but that’s 9 event tiles and I was hoping to manage it with just one tile.[/SIZE]

[SIZE=medium]Thanks[/SIZE]

[SIZE=medium]Furiso[/SIZE]
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,675
First Language
German
Primarily Uses
RMMV
yes, you can - just set the event priority to "below player" and trigger to "player touch", and the event will trigger only when the player moves on it.


I suggest you do some tutorials and look at the sample games before continuing with your game, because that is very basic stuff in eventing - you can follow the link in my signature to get a start.


Edit: Or you can make the rock an event "same priority as player", but then the player might need to move toward the rock to trigger it, and you need conditional branches to detect the direction where the player stands.


It's difficult to say what would be the better solution without knowing more about the map.
 
Last edited by a moderator:

Furiso

Warper
Member
Joined
Jan 23, 2014
Messages
4
Reaction score
0
First Language
English
Primarily Uses
yes, you can - just set the event priority to "below player" and trigger to "player touch", and the event will trigger only when the player moves on it.
I was using the trigger as a switch going on when the player steps on the rock and is hidden behind it.

Would this method turn the switch off when they move off it? Because that is what I was looking for.

It's the off part I was having difficulty with.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,675
First Language
German
Primarily Uses
RMMV
no, you need a command to turn off any switch, and all triggers need an action, not simply leaving a position.


Usually what you want is done with a parallel process checking the coordinates, and switching anything oon or off depending on the player's position.


The exact coding depends on your map - how many "save places" yu have, how many enemy events are there and so on - if you don't know how to make that parallel process, we need a bit more info to help you.
 

Furiso

Warper
Member
Joined
Jan 23, 2014
Messages
4
Reaction score
0
First Language
English
Primarily Uses
[SIZE=medium]Thanks I'll check out the tutorials a bit more but to further explain the situation:[/SIZE]

[SIZE=medium] [/SIZE]

[SIZE=medium]To simplify the scenario is the same as having a 100x100 mainly empty tile map with the player character at square 01,20 the rock at 01,30 and the monster at 01,01.[/SIZE]

[SIZE=medium] [/SIZE]

[SIZE=medium]As the player moves the monster will follow him. If he reaches the rock at 01,30 a switch changes the monster behaviour to move away from the player. When the player moves away from the rock 01,30 the switch changes and the monster reverts back to following.[/SIZE]

[SIZE=medium] [/SIZE]

[SIZE=medium]I’m making a stealth situation for my game where the character is hunted through a jungle and has to hide at times. The monster is an event that moves and initiates combat when it touches the player.[/SIZE]

[SIZE=medium]It really is just the off switch part from moving off the rock tile I'm having trouble with. If theres no easy 1event fix I could just resort to placing 8 other events around the rock. [/SIZE]
 
Last edited by a moderator:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,675
First Language
German
Primarily Uses
RMMV
you'll need a parallel process common event on that map, that uses two or four variables to check the player coordinates.


1) use control variable-game data to load the player's X and Y coordinates into two variables


2) in some cases, you might need to load the coordinates of the save place into the other two variables, but I think here you can use fixed data


3) use two nested conditional branches to check if player coordinates X and Y are identical to the coordinates of the save place


if yes, control switch on


if no control switch off


4) end the parallel process with a wait(5)


Depending on lag and mapsize you might have to reduce or increase the number of waits
 

Furiso

Warper
Member
Joined
Jan 23, 2014
Messages
4
Reaction score
0
First Language
English
Primarily Uses
Excellent

Thanks for everyones help :)
 

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

Latest Threads

Latest Profile Posts

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD

Forum statistics

Threads
105,868
Messages
1,017,072
Members
137,578
Latest member
JamesLightning
Top