Conditional branch to check event location?

JonD

Warper
Member
Joined
Apr 25, 2017
Messages
1
Reaction score
0
First Language
English
Primarily Uses
RMMV
Hi, I was wondering if it wouldn't be too hard to add a feature to the conditional branch to check and see if a particular event is on a particular tile or region before activating. This could be used to:
-Reset self switches when leaving and entering a map and an event is back in it's original location.
-If you set an event to move one tile away from the player upon pressing it, and "push" it to the correct tile (e.g. a button) an event occurs (e.g. a door could open)
-If an event (set to event-touch) is chasing the player, could be lured into a region that changes the outcome of the event.
-If a parallel running event (guy randomly walking) wanders onto a region (lava) the conditional branch could trigger a switch to the next event page or somewhere else (guy starts on fire and runs around, then dies. little girl in village changes dialogue about her father wandering into some lava and never coming home, etc...)

I'm sure there would be a few more applications to this feature as well. And I'm aware the second option (event >push button >door opening) could be done with an event colliding plugin, but what if you wanted four "buttons" pressed simultaneously? Pushing the events off the "buttons" would essentially turn them back off without ever having to deal with switches, and by making the "buttons" regions you could mix and match whatever four events go on whatever four "buttons" giving the player more freedom to be creative with potential puzzle solving.

Anyways, I was looking for a plugin with this feature for something much simpler than that last example, and was surprised to find almost nothing out there for conditional branches. I think it would be cool and I'd definitely use it if someone made it work.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
30,009
Reaction score
7,019
First Language
German
Primarily Uses
RMMV
no need for a plugin, that is possible by pure eventing.

1) use two control variable commands (and two variables) to get the map x and map y of any event you want it from (one of the game data options)
2) use get location info to get any info on the location of the event
3) use conditional branch to check the numbers in the variables you selected for the commands above.

It is not one command, but that would be difficult to do in one command anyway (which is one of the reasons why it is not in the conditional branch directly)
And in fact, most of your examples are better done by events as it is simpler that way - it will need more event code of course however, it can't be done with single commands
 

LeoHalliwell

Villager
Member
Joined
Jan 12, 2014
Messages
27
Reaction score
2
First Language
English
Primarily Uses
Hey, I know this is a bit older, but I actually found a script you can use in a conditional branch to make this work effectively.
$gameMap.event(16).x === 33 && $gameMap.event(16).y === 4
That is an example from my game. So for this, I have a boulder that you have to push to a certain area of the map. The boulder's event ID is 16. The X and Y you would have to input, is where you want the event to be triggered. So when I push the boulder onto the area, I can play a message, and at the same time flip a switch so that the player can no longer move the boulder.

If you want more info on this: I got all the scripts from this video.
Apparently capitalization is important in scripting.
 

Uranium

Game Dev, Pixel Artist
Veteran
Joined
Jan 13, 2017
Messages
60
Reaction score
9
First Language
English
Primarily Uses
RMMV
Hey, I know this is a bit older, but I actually found a script you can use in a conditional branch to make this work effectively.
$gameMap.event(16).x === 33 && $gameMap.event(16).y === 4
That is an example from my game. So for this, I have a boulder that you have to push to a certain area of the map. The boulder's event ID is 16. The X and Y you would have to input, is where you want the event to be triggered. So when I push the boulder onto the area, I can play a message, and at the same time flip a switch so that the player can no longer move the boulder.

If you want more info on this: I got all the scripts from this video.
Apparently capitalization is important in scripting.

THANK YOU LeoHalliwell! Thanks for your extra advice on this topic this was exactly what I needed.

:D
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Stream will be live shortly with some pixel art! Feel free to drop by!

Can't believe I forgot to put an image of my drawing pad! It looks kinda like this, maybe I'll get a better pic tomorrow...
Backup tip: If you don't want to back up your whole project every day, at least back up everything *except* your Image and Audio folders, which you can do weekly/as needed/etc.
The final version of our game is already available both in English and Spanish! ^___^
Can't believe this day has finally come... T_T
Im so happy that Dead By Daylight is getting a Silent Hill chapter! Cant wait to play as pyramid head

Forum statistics

Threads
97,815
Messages
947,152
Members
129,035
Latest member
Tauron7
Top