Checking a Conditional Branch when an Event is on a region

KazukiT

Veteran
Veteran
Joined
Dec 7, 2014
Messages
127
Reaction score
96
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,314
Reaction score
315
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
1,049
Reaction score
328
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,314
Reaction score
315
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
127
Reaction score
96
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
1,049
Reaction score
328
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

Eh... just the three of us killing mosquitoes and collecting them. Current kill count: 14.
Been watching videos about IRS phone scammers. Some really scummy people in the world.
Is the "2 status updates per 24h" still in effect?
My first attempt at Pixel Art :blink::) (I have no idea what I'm doing but I'm doing it)
Plugin instructions: *exists*
Plugin: What did he say? *error*

Forum statistics

Threads
93,724
Messages
914,941
Members
123,330
Latest member
Rikuto
Top