Calling on regions in conditional branch

Hahasea

Veteran
Veteran
Joined
Jul 4, 2019
Messages
151
Reaction score
17
First Language
English
Primarily Uses
RMMV
So I'm setting up some common events that are triggered by a menu item, and depend on which region the player is standing in when triggered. For some reason the conditional branch is not working correctly - it keeps triggering the first common event, even when the player sprite is located in different regions.

I have it set up like follows, can anyone think of a reason this might not be working? I'm tearing my hair out.
Screen Shot 2020-04-01 at 12.11.48 am.png
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
30,014
Reaction score
7,025
First Language
German
Primarily Uses
RMMV
a condition in a script needs to return true or false. that happens only if you compare values, and you have no comparison in your script lines (needs to be something like scriptcode === number).

Is there a specific reason why you're using script code here, especially since you're looking as if that is new for you? You could do the same with pure event code, although that will require several commands: two control variables to get the player position, then one get location info to get the region ID on that position and then compare the region ID variable to the numbers.
 

Hahasea

Veteran
Veteran
Joined
Jul 4, 2019
Messages
151
Reaction score
17
First Language
English
Primarily Uses
RMMV
a condition in a script needs to return true or false. that happens only if you compare values, and you have no comparison in your script lines (needs to be something like scriptcode === number).

Is there a specific reason why you're using script code here, especially since you're looking as if that is new for you? You could do the same with pure event code, although that will require several commands: two control variables to get the player position, then one get location info to get the region ID on that position and then compare the region ID variable to the numbers.
Ah thanks, ok that makes sense.

Could you explain this bit in more detail: '..then one get location info to get the region ID on that position..'

The reason I used script is that I couldn't see a way to call on the region ID though eventing. How exactly do you get the region ID through the player position variables?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
30,014
Reaction score
7,025
First Language
German
Primarily Uses
RMMV
get location info is an event command on page 3 of the event commands, under map.
it needs one variable as the target, where it will store the info type (in your case region ID)
then it needs two variables with XY coordinates from where to get the info, that is where you place the variables that contain the current player position (you need to get that with two control variable commands before the get location info)
 

Hahasea

Veteran
Veteran
Joined
Jul 4, 2019
Messages
151
Reaction score
17
First Language
English
Primarily Uses
RMMV
get location info is an event command on page 3 of the event commands, under map.
it needs one variable as the target, where it will store the info type (in your case region ID)
then it needs two variables with XY coordinates from where to get the info, that is where you place the variables that contain the current player position (you need to get that with two control variable commands before the get location info)
Ah sorry, that's not the bit I meant, I know how to set up the variables to contain player x,y, I'm just not sure how to get the region ID from there?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
30,014
Reaction score
7,025
First Language
German
Primarily Uses
RMMV
I'm just not sure how to get the region ID from there?
That is what I described in the first two sentences.
"Get Location Info" is the name of the event command you have to use for that, it's on the third page of event commands, right side, the last command under the "map" grouping
 

Attachments

Hahasea

Veteran
Veteran
Joined
Jul 4, 2019
Messages
151
Reaction score
17
First Language
English
Primarily Uses
RMMV
That is what I described in the first two sentences.
"Get Location Info" is the name of the event command you have to use for that, it's on the third page of event commands, right side, the last command under the "map" grouping
Ah, thanks!
 

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

Latest Threads

Latest Profile Posts

There's another Humble Bundle available now for RPG developer assets, this time focused somewhat more towards pixel art style games.
Ive got a long lost half uncle. Thats real cool.
I forget what is bumping rule in this forum. Is anyone know? Thank you.
BCj
Ew, why does my blogpost on the rpgmaker.net site look like a garbled mess? Are html codes disabled or something?
I feel that I should cut down on my order queue so I can get some more time for my projects, its been quite a longggg while since I worked on them LOL

Forum statistics

Threads
97,900
Messages
947,725
Members
129,136
Latest member
ivanpuvko
Top