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,024
Reaction score
7,026
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,024
Reaction score
7,026
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,024
Reaction score
7,026
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

Any also thought it's too cringy to put the word "and you" in your credit as a special thanks?
Cause that's what I thought...
Everyone in the US right now: Please stay safe.
Symphony Celestia: Prophecy of the Falling Stars RPG Maker music pack WIP. Symphony Celestia is a new series that focuses on symphonic and orchestrated music to tell a story. Each story will include compositions that make up that story from beginning to end. Themes include: Battles, adventures, character themes, etc. Below is a video preview to the first story.

Jumping and gravitation 0.1 build - RPG Maker MV
It's ironic, but one of the many hilarious things done with Shia's Just Do It speech was to make a hype song, and....I know what it is.....but I still get inspired by it! I'm like..."Yes I can!!"

Forum statistics

Threads
97,975
Messages
948,246
Members
129,227
Latest member
HamadAhli
Top