Hi!
Is there a way to make a conditional branch that checks wether or not THIS event is in a given region?
The event is moving by a move route within itself as a paralell process. When it enters a region I would like it to behave different by controlling a self switch.
I'm guessing there has to be a way to store the position of the event in a variable and check the region ID that such position has. I have the feeling that i'm missing a little script call to do so.
I would really appreciate your help!
Conditional branch using Event's Region_ID
● ARCHIVED · READ-ONLY
-
-
I know you can set variable according to "This Event", X or Y position on a map, & then use variables derived from those positions to determine region ID at the coordinate derived from the variables via get location information in MV.
I believe you can do the same in VX Ace, though it's been a while since I'v used VX Ace, & I didn't try that particular mechanic in it, so I could be wrong. -
you can do it without any script command, just use a series of control variable and get location info commands before the conditional branches to get the info you need into a variable and then check the variables value.
-
I know you can set variable according to "This Event", X or Y position on a map, & then use variables derived from those positions to determine region ID at the coordinate derived from the variables via get location information in MV.
I believe you can do the same in VX Ace, though it's been a while since I'v used VX Ace, & I didn't try that particular mechanic in it, so I could be wrong.
Yes, that was what I had in mind. But couldn't find the way to store any Region_ID in a variable. I guess there should be some script call since inside game_map there is this at line 539:
#--------------------------------------------------------------------------
# * Get Region ID
#--------------------------------------------------------------------------
def region_id(x, y)
valid?(x, y) ? @map.data[x, y, 3] >> 8 : 0
end
But I´m really a noob at scripts. So I really don´t know how to use this information. lol.
Thank you for your answer. -
you can do it without any script command, just use a series of control variable and get location info commands before the conditional branches to get the info you need into a variable and then check the variables value.
Yes! Thank's you so much to the two of you!
I didn't realize there was a get location info.. Sorry for the noob question. -
Just use script call either of this.
Code:get_character(0).region_id == 1 get_character(0).region_id != 1 -
Try with this in conditional branch script:
$game_map.events[id].region_id == x
where:
ID = event ID
x = region number.