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
31,430
Reaction score
7,711
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
135
Reaction score
50
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

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.

Forum statistics

Threads
106,035
Messages
1,018,455
Members
137,821
Latest member
Capterson
Top