Script call for region ID?

Oddball

Veteran
Veteran
Joined
Sep 4, 2014
Messages
1,683
Reaction score
451
First Language
English
Primarily Uses
N/A
Not sure if this is the right place to put this, but was wondering if there was a script call to make an event change it's behavior based on what reigion it's in. Not looking for a script, just want to do this purley through eventing

Like for example, you use reigon 1 for open ground, 2 for a tree, and 3 for around a building. A squirrel would run up the tree when in reigon 2, and then bury a nut in region 1
 

Thefirelion

Veteran
Veteran
Joined
Mar 25, 2017
Messages
49
Reaction score
11
First Language
Spanish
Primarily Uses
RMVXA
Create a parallel event that controls this situation with respect to the "squirrel" with the following condional call scipt command:
If you want something to happen when the event enters that region:

$game_map.events[event_id].region_id == n
event_id = event number
n == region number

Example:
if $game_map.events[1].region_id == 1
do stuff
end
 

Another Fen

Veteran
Veteran
Joined
Jan 23, 2013
Messages
536
Reaction score
249
First Language
German
Primarily Uses
Hey there,

You can usually check the region using the "Get Location Info..." event command (page 3) after setting variables to your events coordinates.
Of course, if you prefer script commands you could try

$game_map.region_id(x, y)
for a specific location or
$game_map.events[id].region_id
get_character(id).region_id
(event script commands only; -1 for the player, 0 for "this event", others for the event with that ID)
$game_player.region_id
for the region under a specific character.

Edit: Uh... too slow. :)
 
Last edited:

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

Latest Threads

Latest Posts

Latest Profile Posts

I'm an adult married woman

Being a hobbyist dev and also loving my job is like nothing to lose during both busy days and holidays ~ ♥
I tried to free some space in my phone and this is what I find: https://framapic.org/Dio090k00QQ6/8tiNZ3AV5IYw.png
...Almost 60% of all images in my gallery is just that- books and notes and guides...
I've bought a set of Harry Potter to entertain myself. However, my crazy geography homework accounts for more than half of my homework.
Girls with swords are cool on their own. Then I give them guns. *Profit*

Forum statistics

Threads
93,449
Messages
912,502
Members
122,976
Latest member
ssalum
Top