Checking a Conditional Branch when an Event is on a region

KazukiT

Veteran
Veteran
Joined
Dec 7, 2014
Messages
286
Reaction score
342
First Language
English
Primarily Uses
RMMV
I apologize if this is in the wrong thread but, does anyone know how do you create a conditional branch for when an event walks on a certain region tag it checks a conditional branch to see if they are on that region.

For example Event 1 walks onto Region 3 how would I check if that event is on that region?
 

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,492
Reaction score
408
First Language
German
Primarily Uses
RMMV
Do you need that as Java Script Code?
If not, with Events it could look like this:
Code:
◆Control Variables:#0012 MyEventMapX = Map X of This Event (or direct Event ID)
◆Control Variables:#0013 MyEventMapY = Map Y of This Event (or direct Event ID)

◆Get Location Info:My Variable Location Info for me, Region ID, ({MyEventMapX},{MyEventMapY})

◆If:Location Info for me = 1 (If the Event is on Region 1)
- Do your stuff
end
 

ShadowDragon

Veteran
Veteran
Joined
Oct 8, 2018
Messages
2,948
Reaction score
1,053
First Language
Dutch
Primarily Uses
RMMV
like the above, you for an scriptcall using

$gameMap.event(x).regionId() === y

X as being the ID number, and Y being the region ID
both ways works though.
 
  • Like
Reactions: Bex

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,492
Reaction score
408
First Language
German
Primarily Uses
RMMV
It looks like that this is a very short and useful Script Line. Thank you for sharing.

This could have Safed me some time i spent puzzling around =).
 

KazukiT

Veteran
Veteran
Joined
Dec 7, 2014
Messages
286
Reaction score
342
First Language
English
Primarily Uses
RMMV
Thanks guys for helping me out. I was able to implement the code suggested by Shadow Dragon into my game.
 

ShadowDragon

Veteran
Veteran
Joined
Oct 8, 2018
Messages
2,948
Reaction score
1,053
First Language
Dutch
Primarily Uses
RMMV
I used it for my player $gamePlayer.regionId === x
so for events its almost the same, but slightly different.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,047
Messages
1,018,540
Members
137,834
Latest member
EverNoir
Top