Region ID Number from Variable

AquaticChaos

Veteran
Veteran
Joined
May 14, 2017
Messages
32
Reaction score
2
First Language
English
Primarily Uses
RMMV
What I'm trying to do is, based on a certain variable, it will transition the player to the Region of the same number.
For example, if I'm in a room that sets the variable to 6, and I open the map, then it'll put my player at Region ID 6 on the map. Think of it like Legend of Zelda: Link to the Past.

(Of course, only one set Region Number per room is reasonable)
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,675
First Language
German
Primarily Uses
RMMV
can be done, but not directly - you can only get the ID number from a map position, not the other way around.

So you'll need to make a loop through the entire map, checking for every position which region ID is there, and break the loop when you found the correct ID. The last coordinate before you break the loop are then the correct target.
 

AquaticChaos

Veteran
Veteran
Joined
May 14, 2017
Messages
32
Reaction score
2
First Language
English
Primarily Uses
RMMV
So basically what you're saying is to make a loop that checks for whether the Region ID matches with the map location? How would it go about like? Sorry, I'm not too familiar with RPG Maker, so it kinda confused me. But I appreciate the help!
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,675
First Language
German
Primarily Uses
RMMV
basically, you make an event that has two loops (one for X and one for Y), with two variables for X and Y being counted up.
The outer loop counts up the X variable, then the inner loop counts up Y, both from zero up to the maximum map size (and that mapsize needs to be checked with aconditional branch and break loop on max).
In the inner loop you'll have a get location info command to get the region ID of the curent position into a third variable, and a conditional branch checking if that is the desired number - if yes break loop command.
In the outer loop you'll need another conditional branch to check the same and break the second loop again in case it is found.

After both loops you'll need to check the ID a third time, but this time with an else branch.
If the ID is correct transfer to the coordinates or whatever you want to do, if the ID is wrong here the ID does not exist on that map and you need to handle that kind of error.

If you're too inexperienced with eventing to follow that description, I suggest you go work through some eventing tutorials - you'll find a few of them if you follow the link to the starting point in my signature. You'll need to know your way around event commands and specifically variables if you ever want to make a game with quests that are more complex than "go there".
 

AquaticChaos

Veteran
Veteran
Joined
May 14, 2017
Messages
32
Reaction score
2
First Language
English
Primarily Uses
RMMV
Isn't there a simpler way, such as depending on the map you're in (Which is what I was going with) you'd be shown on a different part of the map. For example, one map ROOM takes you to the town's location when opening the map ITEM. I'll look into it and see if I come up with an answer.
 

SamJones

Autorun
Veteran
Joined
Jul 12, 2015
Messages
113
Reaction score
47
First Language
English
Primarily Uses
RMMV
Why are you even trying to send to a region? Have the room set the variables to the actual map coordinates you want to send the player to.
 

AquaticChaos

Veteran
Veteran
Joined
May 14, 2017
Messages
32
Reaction score
2
First Language
English
Primarily Uses
RMMV
Nevermind, figured it out without using Regions. You can close the topic now.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,863
Messages
1,017,053
Members
137,571
Latest member
grr
Top