GreyWolfVino

Veteran
Veteran
Joined
Apr 12, 2018
Messages
31
Reaction score
3
First Language
English
Primarily Uses
RMMZ
Hey fellow game makers, so I come across this issue. I recently expanded all my small maps into a bigger more detailed map but I still want every individual map/region to have a map name when the player enters that region/area. How would I go about doing so? Thank you so much in advance.
 

Shaz

Keeper of the Nuts
Global Mod
Joined
Mar 2, 2012
Messages
46,036
Reaction score
16,847
First Language
English
Primarily Uses
RMMV
You want the map name to pop up, and be different, as the player moves from one location on a map to another?

If the transition space between the areas is small, you could add events to trigger the name to display, but if more than a few tiles you're probably better off going with a plugin that will let you use regions to identify the areas.

Then you will need to change $dataMap.displayName to whatever you want to pop up, followed by a call to open the map name window.

Or get a custom plugin written to do all that for you, though you'll still need to define the area boundaries and names.
 

GreyWolfVino

Veteran
Veteran
Joined
Apr 12, 2018
Messages
31
Reaction score
3
First Language
English
Primarily Uses
RMMZ
You want the map name to pop up, and be different, as the player moves from one location on a map to another?

If the transition space between the areas is small, you could add events to trigger the name to display, but if more than a few tiles you're probably better off going with a plugin that will let you use regions to identify the areas.

Then you will need to change $dataMap.displayName to whatever you want to pop up, followed by a call to open the map name window.

Or get a custom plugin written to do all that for you, though you'll still need to define the area boundaries and names.
Thank you so much, Shaz! You literally solved my problem! I cannot thank you enough!!
 

GreyWolfVino

Veteran
Veteran
Joined
Apr 12, 2018
Messages
31
Reaction score
3
First Language
English
Primarily Uses
RMMZ
Actually I haven't gotten it to work. I pretty awful at writing lines of script
 

superkoopa

Veteran
Veteran
Joined
May 21, 2020
Messages
56
Reaction score
274
First Language
English
Primarily Uses
RMVX
@GreyWolfVino I guess you could place an event (with the trigger set to player touch) and then show text. If you want it a bit fancy you could always use pictures.
 

Shaz

Keeper of the Nuts
Global Mod
Joined
Mar 2, 2012
Messages
46,036
Reaction score
16,847
First Language
English
Primarily Uses
RMMV
The neatest way to do it without a plugin is to allocate a region id to each "area" and draw an outline around that area with that region. Actually, you just need to draw it where the player can cross from one region to another.

So if you have a map that divides down the middle, and the left side is region 1 and the right side is region 2, use region 1 to draw along the edge of region 1, and use region 2 to draw along the edge of region 2. So where the two meet, you'll have the two regions drawn side by side.

Now create a parallel process event and tuck it away in the corner of your map. Add these commands (use whatever variables you have available, but make sure you name them):
Code:
Wait 5 frames
Control Variables: Player Region = Script: $gamePlayer.regionId()
If Variable [Player Region] # 0
  If Variable [Player Region] # Variable [Saved Region]
    If Variable [Player Region] = 1
      Script: $dataMap.displayName = "Region 1"
      Jump to Label: UpdateRegion
    End
    If Variable [Player Region] = 2
      Script: $dataMap.displayName = "Region 2"
      Jump to Label: UpdateRegion
    End
  End
End
Jump to Label: SkipRegionUpdate
Label: UpdateRegion
Script: SceneManager._scene._mapNameWindow.open();
Control Variables: Saved Region = Player Region
Label: SkipRegionUpdate

You will have one of these blocks:
Code:
    If Variable [Player Region] = 1
      Script: $dataMap.displayName = "Region 1"
      Jump to Label: UpdateRegion
    End
for each region.

Finally if you start on this map, create a new parallel process event that sets the [Saved Region] variable to whatever region number the player will start in. If you transfer to this map from other maps, have the transfer event set the [Saved Region] to whatever region it's transferring you to.

Here's how this works ...

every 5 frames, the event will check if the player is on a region. If they are, it checks if it's the same region they were on previously (this is so you only get the message once, when you enter the region). If it's not the same, it will do a series of tests to see what region the player is in, and set the "map" name accordingly. Once it's found a valid region and set the map name, it skips the rest of the tests, shows the message, then saves the region so it can keep track of where you currently are.

You can still use regions for other things, and if the player goes onto one of those tiles, this event will drop through all the tests without finding a valid region, then will skip the steps to show the name and save the region.


The only issue with the above is when you transfer to the map from another map, it will show the map name, not the region name. I'm not sure how to change that without actually creating a plugin.
 
Last edited:

GreyWolfVino

Veteran
Veteran
Joined
Apr 12, 2018
Messages
31
Reaction score
3
First Language
English
Primarily Uses
RMMZ
No this is perfect. This should run fine because what I was trying to do is assign regions to a map, such as Region 1, 2, etc.. and it would announce the region once the player lands on the tile, kinda like certain routes in Pokémon how they are continuously to certain extent and when the player does transfer to a new map, I can reuse Region 1, 2, etc as different regions in that specific map and what you are explained to me appears to do just that. I will test it later and let you know how it went but thanks so much. I really appreciate it
 

Shaz

Keeper of the Nuts
Global Mod
Joined
Mar 2, 2012
Messages
46,036
Reaction score
16,847
First Language
English
Primarily Uses
RMMV
If you reuse the same region number on the same map, you will get the same name popping up for each one. Is this what you want?
 

GreyWolfVino

Veteran
Veteran
Joined
Apr 12, 2018
Messages
31
Reaction score
3
First Language
English
Primarily Uses
RMMZ
The same region number will be used on a different map, different from the first map. Example: Big Map 1 is Maps 1-4 combined, but I want to give the appearance as they are four individual maps by making them regions. Big Map 2 is Maps 5-8 but I use the same region numbers so easier to track. Is that what you meant right?
 

Shaz

Keeper of the Nuts
Global Mod
Joined
Mar 2, 2012
Messages
46,036
Reaction score
16,847
First Language
English
Primarily Uses
RMMV
Ah, yes, that will work. I thought you meant using the same region id for different areas on the same map, which wouldn't work. But what you do on one map has no bearing on what you do on another - you can absolutely use the same region ids and have them show different names.
 

GreyWolfVino

Veteran
Veteran
Joined
Apr 12, 2018
Messages
31
Reaction score
3
First Language
English
Primarily Uses
RMMZ
Hey Shaz,
So I tried the code that you sent me and maybe I am missing something but every time the player crosses over to the next region, it re-displays the map name, not the region name. I also haven't created the Saved Region parallel event yet. Do you think it has something to do with that or the fact I am using Olivia Map Name Display Plugin
 

Latest Threads

Latest Profile Posts

Now a videogame developer has been arrested in Japan for insider trading. Darn blue hedgehog! XD
The forum stalled for a second and I thought I got banned for using 1 swear word. :kaoswt2:
Today years old when I realized I can track Last Skill ID used as a variable... natively in engine....

*sighs in reconstructing skill system*

Forum statistics

Threads
131,749
Messages
1,222,904
Members
173,498
Latest member
hyotae
Top