Advertiser Content

DNA_Dan0

Male
Seen 2 Weeks Ago
Posted 3 Weeks Ago
17 posts
1.2 Years
I was thinking of having a feature where as the player enters routes and towns, the region map gets updated to show the new area. Think sort of like routes and towns getting added in like train track pieces as the player arrives at each of them. Perhaps the map is covered by a sort of "fog of war" kind of thing, or my original idea of having the map be something the main character "draws in" as they explore the world. I couldn't find any sort of tutorial online or even anyone talking about this, be it with RPG Maker XP or Pokémon Essentials. I thought that this could theoretically be done by warping the player to a new area that looks like a region map, that way events can reveal new routes once switches have been activated. But this might cause conflicts with the fly system or the pokémon encounter map in the pokédex. It's all a little too complex for me to figure out.

I have no idea where to begin scripting this sort of thing, or if even people would like this to be a feature in a Pokémon game in general. What are everyone's thoughts on this idea? Is it even possible with Essentials?

Edit:
A solution has been found! Visit this thread here for the most up to date code.
Male
Seen 1 Day Ago
Posted 1 Day Ago
153 posts
156 Days
Just an idea I had while reading you but I'm not sure how to do it.

I guess it's not too hard to create an item that shows a picture when used. you could then develop an item which is a sheet of paper with kind of a handmade draw of the map on it. You make multiple pictures of this sheet of paper but with more road drawn each time. and where you define the item you make it so it shows the first, second or... depending of a variable which is implemented each time the character goes further.

This way it would look like the character is drawing his progress himself. when all is discovered you could make an event giving him the entire map with a message like "come on man you draw on a sheet of paper, don't you know there are electronic maps now?!"

Just an idea :D
Male
Seen 1 Day Ago
Posted 1 Day Ago
153 posts
156 Days
I struggled a lot to find how to do this and the only solution I managed to find is to make the item a mail and putting the pictures in Graphics/Pictures/mail and naming it "mail_internalnameofyouritem"

you can then put an automatic event which triggers once, the first time you enter a new map and replaces your item handmap1 by handmap2... note that you can give the same displayed name for all handmaps so there is no difference ingame

DNA_Dan0

Male
Seen 2 Weeks Ago
Posted 3 Weeks Ago
17 posts
1.2 Years
You know, Tsuina, you might have just solved this! The item idea is a good one, perhaps adapting the town map item. The issue with having multiple pictures for the item is that if the player decides to go left instead of right, then there will need to be an entirely separate series of pictures to account for this choice, meaning there will be dozens of iterations of the map. Possible, but I think that would be unnecessarily large.

But! If instead of separate maps, there is one blank map and several small route and town pictures in the file folder. As the player explores around to the different areas, switches are activated for each different route and town. When the player accesses the blank town map, the game will check to see which switches are on and simply display the picture for each route that has a switch activated. A bit of rejigging the town map's code to display the different pictures of routes will be needed too.

I thiiiiiink this might work. I'll try implementing it like this and respond to this thread to let others know if it worked. But if someone comes up with a better idea then I'd be more than happy to hear! As this idea so far will take up like 30 switches to do, depending on your region's size.

DNA_Dan0

Male
Seen 2 Weeks Ago
Posted 3 Weeks Ago
17 posts
1.2 Years
After a bit of testing, I stumbled across a base feature in Essentials that I had completely forgotten about, the hidden islands. It works to use this feature to list all of the routes and cities on a blank map (no routes and towns, just the landscape), revealing each route and town as the player activates their switches. Basically every route and town is a hidden island. So awesome! Problem solved if you're using the base map in essentials!

However. I quickly realized that this won't work for my project, as I'm currently using Marin's Better Region Maps script. It doesn't handle the hidden islands feature in Essentials. I'm too attached to this script to part with it, so I'm back at square one with the idea of progressively revealing the map. Not to mention my map is relatively large, so there is no real way to show it to the player on screen without Marin's Better Region Maps anyways, even if it's activated by an item.

That said, if I forego Better Region Maps it would be possible to split my map up into 4 regions, and using the standard pbShowMap(region number) will allow me to have the hidden routes reveal progressively with the hidden islands feature. Just the idea of splitting up the region map into 4 separate maps doesn't seem like a great player-friendly way to approach this.

DNA_Dan0

Male
Seen 2 Weeks Ago
Posted 3 Weeks Ago
17 posts
1.2 Years
Thanks again Tsuina! I checked out your "script list for events" thread and I see what you mean. That could possibly work! Displaying an image along side other images is basically what I was talking about with my original question. However, using Marin's Better Region Maps Script adds a second hurdle. If you're not familiar with it, it basically allows you to pan up and down and left and right over an image. Letting you have an unlimited map size. In doing so, I think there might be an issue with placing new images on screen, as the X and Y coordinates wouldn't be fixed positions. I'm not quite skilled enough to adjust the code the same way Ego had done in your thread and adapt that to plug in to Better Region Maps.

So the issue then becomes, how to adapt Marin's script to allow for more than one image to be manipulated at the same time without it being a laggy mess, if even possible. I'll play around with this to see if I can come up with a solution.

And as to my project: I've been working on it for about a year now, but mainly working on story stuff up until a few months ago when I started actually getting to work in essentials. I have a lot planned, so I needed a large region! Hence my dependence on Better Region Maps.
Male
Seen 1 Day Ago
Posted 1 Day Ago
153 posts
156 Days
I see. Not sure how to do that but I guess how the map can move is defined in the better map script you added. Maybe by copying how images are fixed on the screen (because they stay at the same place depending on the movement of your character) and modifying it so there position depends on the same thing as the map moving.
This or by doing a conditional in how maps are fixed "if switch "map activated" is on then move with ..."

but without seeing the better map script I have no plan for from where to start

Ego13

hollow_ego

Male
Larua Region
Seen 7 Hours Ago
Posted 4 Weeks Ago
303 posts
2.2 Years
In doing so, I think there might be an issue with placing new images on screen, as the X and Y coordinates wouldn't be fixed positions. I'm not quite skilled enough to adjust the code the same way Ego had done in your thread and adapt that to plug in to Better Region Maps.

So the issue then becomes, how to adapt Marin's script to allow for more than one image to be manipulated at the same time without it being a laggy mess, if even possible. I'll play around with this to see if I can come up with a solution.
For placing new images you don't need to have fixed value. You can always place it in relation to another graphics. Though I agree that you might not want to have hundreds of sngle images being displayed at the same.

I don't know Marins scipt, so I can't tell you exactly what you would need to change. One question though comes to my mind: What do you want your map to actually look like? Your answer might change how you wan to approach this issue.
Looking for spriters to help with

Pokemon Hollow on pokecommunity.com

DNA_Dan0

Male
Seen 2 Weeks Ago
Posted 3 Weeks Ago
17 posts
1.2 Years
One question though comes to my mind: What do you want your map to actually look like? Your answer might change how you wan to approach this issue.
To answer this: I would like my region map to be just the land area, without any routes, towns, water routes or anything. I want the player to explore the world organically, and as they explore, the map fills in where they have been. Basically I don't want the player to know what's at the end of a route, I want them to explore to find out! And in fact, I might even have the world change as the player goes through, so some routes would need to be removed from the map and replaced by a different one.

This question got got me thinking though, I could have been approaching the question wrong from the beginning. I don't know the logistics of this entirely, as it might have some wacky ramifications in Essentials, but would it be possible to display an image that's larger than the game's window? In this case a 1024x576 map image, by increasing the game's window size when the map is opened? And when the map is closed, simply resize the window back to the original size. This might be a work around, and I wouldn't need to use Marin's script to scroll around the map. And since I wouldn't be using Marin's script, I can use the Hidden Islands feature built in to essentials to display the routes and towns as I wish.

I'm not sure where to begin coding something like this, but perhaps one of you brilliant minds might be able to find the right place! I'll try to tinker in the meantime.

Edit:
So after a bit of tinkering, I think I finally found my solution! I just don't have the know-how to implement it. In line with the idea to resize the game window, it does in fact work to resize the window to the map's dimensions by changing the DEFAULTSCREENWIDTH and DEFAULTSCREENHEIGHT in the Settings to 1024 and 576 respectively. The full map is displayed properly with pbShowMap and everything works great with displaying hidden routes on this large game window. However, the game runs terrible at this screen size, so I need to find a way to change the default screen width and height back to the standard 512x384 when the map is closed.

I thought of using a game variable to do this, but setting DEFAULTSCREENWIDTH = $game_variable[30] comes up with an error, as expected. Not to mention the game wouldn't even load properly because the screen size would be set to an undefined variable at launch (I think that's what would happen). I don't know of a way to redefine DEFAULTSCREENWIDTH during the Pscreen_RegionMap script, as that would be the only time I would need to change the screen width and height was when that script was called. If someone can come up with a way to redefine the DEFAULTSCREENWIDTH and DEFAULTSCREENWIDTH variables during the Pscreen_RegionMap script, you'd have solved this whole thread!
Male
Seen 1 Day Ago
Posted 1 Day Ago
153 posts
156 Days
you gonna love me

in Item effects:
ItemHandlers::UseFromBag.add(:ZOOM,proc{|item|
pbSetResizeFactor(2,false)
   next  2 
})
ItemHandlers::UseInField.add(:ZOOM,proc{|item|
pbSetResizeFactor(2,false)
   next  2 
})
and in pbs

688,ZOOM,zoom,zooms,8,0,"a zoom",2,0,6,
give yourself the zoom through event:
Kernel.pbReceiveItem(:ZOOM)
it will store an item called zoom in your key item pocket and when you use it will close the menu then make the screen larger.
I leave you figure out how to reduce the screen again after a while but I think what Ego wrote about loops do could be a nice start

Edit:

actually solved it:

replace the useInField from above by this

ItemHandlers::UseInField.add(:ZOOM,proc{|item|
pbSetResizeFactor(2,false)
  loop do
    Input.update
    $game_screen.update
    if Input.trigger?(Input::C) # image will be closed and properly disposed when the player presses c / enter

     pbSetResizeFactor(1,false)

      break
    end
  end
  pbWait(20)# wait a bit to prevent double input
   next  2 
})
Now when you press c or enter the screen goes back to normal.
if you want to add a map display on this you'll need the line

Graphics.update
under the two other updates

DNA_Dan0

Male
Seen 2 Weeks Ago
Posted 3 Weeks Ago
17 posts
1.2 Years
That's awesome Tsuina! But not quite what I meant, I'll be more clear here. We might figure out how to adapt your code though!

So your code does work successfully! For what you were trying to get it to do. But Rather than simply scaling the window to be larger, what I need is for the game to stay at the same zoom level, but make the window larger in order to see more of the game. If you change the DEFAULTSCREENWIDTH and DEFAULTSCREENHEIGHT in the Settings to something larger, you'll see what I mean. Where the screen is larger and lets you see more tiles on the overworld map, etc. By doing this, it is possible to display a very large map on screen with pbShowMap without it getting cut off.

I just spent a bit of time trying to tweak your code to be able to change the DEFAULTSCREENWIDTH and DEFAULTSCREENHEIGHT constants. I've learned a little bit more of Ruby coding from this, but still nowhere near capable of producing something that works. I've narrowed down the issue to being Ruby and how it deals with constants like the two mentioned. I can't seem to adapt your code to redefine DEFAULTSCREENWIDTH and DEFAULTSCREENHEIGHT, and then redefine them both back to the original values when the map is closed.

Related side note: There is a const_set(const, value) method in Ruby to change the value of a constant, but it doesn't seem to work no matter how I've tried to rig the code. I eventually came into an error that said "DEFAULTSCREENWIDTH is not a symbol" even though it's a clearly defined constant. I stopped there as it's a little bit above my knowledge in Ruby to address this sort of thing.

I feel like we're really close to cracking this wide open!

mgriffin

Seen 3 Hours Ago
Posted 6 Hours Ago
707 posts
5.5 Years
I eventually came into an error that said "DEFAULTSCREENWIDTH is not a symbol" even though it's a clearly defined constant. I stopped there as it's a little bit above my knowledge in Ruby to address this sort of thing.
I can't comment on the rest of your post (haven't read any code), but DEFAULTSCREENWIDTH isn't a symbol, :DEFAULTSCREENWIDTH (i.e. with a colon in front) is.

DNA_Dan0

Male
Seen 2 Weeks Ago
Posted 3 Weeks Ago
17 posts
1.2 Years
I can't comment on the rest of your post (haven't read any code), but DEFAULTSCREENWIDTH isn't a symbol, :DEFAULTSCREENWIDTH (i.e. with a colon in front) is.
Ah! Thanks for the correction! I'm still new to Ruby so I obviously still have much to learn. With this small oversight I was able to do a bit more troubleshooting.

And through some more troubleshooting, I've come to yet another impasse with my original question! So it turns out DEFAULTSCREENWIDTH and DEFAULTSCREENHEIGHT are Fixnum values. Completely unchangeable values in Ruby once the game starts running. I didn't know that, so my idea to increase them when a map is open is actually impossible in Ruby. Which would explain why there are no functions in Essentials to change their values on the fly.

I'm once again back at square one, although I've definitely have learned a lot thanks to everyone's help. The only solution I see to having a large, progressively revealing region map is modifying Marin's Better Region Maps script to handle a Hidden Island feature that base Essentials does. Or perhaps I'll split my map up into pieces to utilize the Essentials' Hidden Islands.

Ego13

hollow_ego

Male
Larua Region
Seen 7 Hours Ago
Posted 4 Weeks Ago
303 posts
2.2 Years
First off I wanna say: WOW! and AMAZING!
I really like how you actually do research on what you are trying to do and post what you have learned here! And you never came off as demanding. It would be great if people were acting more like you around here.

Anyways, I was playing around with DEFAULTSCREENWIDTH a bit, but also couldn't find a solution to it. BUt I also still can't quite imagine what your map looks like. Could you provide a dummy example?

I still believe that your best option is to write code for your case specifically,using viewports and maybe somebitmap manipulation. But to know the best way to handle all this, we need to know what this whole thing is supposed to look like. Like the actual thing.
Looking for spriters to help with

Pokemon Hollow on pokecommunity.com

Swdfm

Swdfm

Age 22
Male
Seen 1 Week Ago
Posted 4 Weeks Ago
36 posts
1.2 Years
Okay, so, in order to change the screen size mid game, you will have to change quite a lot of core code.
When Essentials (or your game) runs, it starts off as a certain size window, and then goes to the 512x384, doesn't it?
Well, that is where one of the core codes (like Main, or the RGSS window, i don't know which one exactly) changes the screen to that size.
It would be quite a dangerous game changing it in the middle of running the program, but possible.

However, I have a radical idea that could help you solve your initial issue:
So, I have not seen the code for Marin's map, but I presume it requires a background graphic.
As you unlock an area, what it should do is add an area graphic on top of the map RELATIVE TO THE BACKGROUND'S x and y values.
Then (and this is where it gets technical), you produce another picture based on this picture, by literally calling a program that saves a bitmap to somewhere in the graphics folder. The disadvantages? Players could see it, but if that does not matter, then what you would do is indeed save this picture somewhere, and then bring it up BEHIND the background, and dispose of the background and additional locations sprites before the player could move the map. This will make the player move only one image, and therefore drastically reduce any lag, as the lag always comes from when you try to move the image rather than the generation of the image (unless it is MASSIVE!)

Hope that was clear, and that is an approach I would take. Unfortunately, I do not know the exact code for that just now.

Hope I helped

Swdfm

DNA_Dan0

Male
Seen 2 Weeks Ago
Posted 3 Weeks Ago
17 posts
1.2 Years
First off I wanna say: WOW! and AMAZING!
I really like how you actually do research on what you are trying to do and post what you have learned here! And you never came off as demanding. It would be great if people were acting more like you around here.

Anyways, I was playing around with DEFAULTSCREENWIDTH a bit, but also couldn't find a solution to it. BUt I also still can't quite imagine what your map looks like. Could you provide a dummy example?

I still believe that your best option is to write code for your case specifically,using viewports and maybe somebitmap manipulation. But to know the best way to handle all this, we need to know what this whole thing is supposed to look like. Like the actual thing.
Thank you for the compliments! I appreciate that. I'm trying to find out how to do this just as much as anyone else is who happens to read this thread, so it only makes sense that I try to figure it all out too! Plus I'm still learning, so I find trying things out practically is the best way to learn.

As to my map, sure thing! Here's an imgur link of both the overlay of the routes and of the map's terrain. Both are 1024x576. Once I get this whole thing figured out, I plan on chopping up the route overlay into each individual route to place them on the map's terrain as the player explores. Hence the original idea. If you need more info or anything I'd be happy to explain.

DNA_Dan0

Male
Seen 2 Weeks Ago
Posted 3 Weeks Ago
17 posts
1.2 Years
Okay, so, in order to change the screen size mid game, you will have to change quite a lot of core code.
When Essentials (or your game) runs, it starts off as a certain size window, and then goes to the 512x384, doesn't it?
Well, that is where one of the core codes (like Main, or the RGSS window, i don't know which one exactly) changes the screen to that size.
It would be quite a dangerous game changing it in the middle of running the program, but possible.
I was poking around in the Sprite_Resizer mainly, as there is code in there that deals with the size of the window as well as directly calls upon DEFAULTSCREENWIDTH and such. I couldn't really get anywhere with that though. But I agree, that it seems dangerous to change the game size mid game. The biggest reason I started looking at modifying the DEFAULTSCREENWIDTH and DEFAULTSCREENHEIGHT values was because when changed to 1024x576, my map works as intended with a simple pbShowMap and Hidden Islands feature. However, you then go on to say:

However, I have a radical idea that could help you solve your initial issue:
So, I have not seen the code for Marin's map, but I presume it requires a background graphic.
As you unlock an area, what it should do is add an area graphic on top of the map RELATIVE TO THE BACKGROUND'S x and y values.
Then (and this is where it gets technical), you produce another picture based on this picture, by literally calling a program that saves a bitmap to somewhere in the graphics folder. The disadvantages? Players could see it, but if that does not matter, then what you would do is indeed save this picture somewhere, and then bring it up BEHIND the background, and dispose of the background and additional locations sprites before the player could move the map. This will make the player move only one image, and therefore drastically reduce any lag, as the lag always comes from when you try to move the image rather than the generation of the image (unless it is MASSIVE!)
Now this is a very interesting idea! Essentially doing the brute force method of having a bunch of map files of all possible routes, but progressively replacing them as you go by essentially taking a screenshot of the new updated map then removing everything and replacing the image with the new screenshot before the player has a chance to pan around the map. Or at least that's what I think you were getting at (You were very clear and helpful, by the way!). This might be an interesting approach, as there wouldn't be a need to have 100+ individual map pictures in the game's folders because the "screenshot" of the map simply replaces the old one. Plus since it's only one static image, there wouldn't be any lag. I don't think there would be much lag, I wouldn't describe my map as massive, just double-sized, essentially. So I don't foresee this being an issue when capturing the new map image each time.

Issues with this idea however is if routes change shape. The old static map image would need to be altered and then the new route overlayed back on top in the same spot. I can't quite see a work around for this right now using this method. If the method you've suggested can be implemented practically inside of Marin's script. I'll try to work with this idea for a bit to see how I can make it work. It's come time for me to learn proper graphics manipulation in Ruby anyways!

AenaonDusky

DeliveryBoy

Male
Seen 3 Days Ago
Posted 4 Weeks Ago
73 posts
1.9 Years
That's a nice idea!
So basically, it comes down to these options:



1) Draw each possible distinct combination of routes, and call each respective picture based on variables/switches

2) Implement the vanilla hidden island system into Marin's script (why not contact Marin?)

3) Find a way to use some kinda bitmap bamboozlery to produce a "fow" effect, either through shaders (haha, this is old ruby we're talking about) or by manipulating a particular area of the picture (quite the undertaking).

4) Like badges on the trainer card, you start with a "blank" region map and add icons, with their position being relative to a certain point in the map (e.g. the center, a fixed position once you've figured out your map's exact size) in case you're having coordinate problems. This should be possible. Bear in mind that the icon doesn't need to be a single "white line" route, it can also be a "crossroads", or a bigger icon with any combination. You get what I'm saying?

OR

you do the opposite; your standard map has every route drawn on it (including the "dynamic" routes that change later) and you now draw icon/ other pics that COVER these areas, which you remove after the player discovers the part. What I'm saying here is, instead of ADDING routes, you give the illusion of addition by having "empty" areas drawn on top of these, and removing them based on progression. The main difference here is possible workload for your artist/you, instead of making separate pictures for each route, you draw each combination of layers that cover the actual map, (which might also be easier /less annoying to do)

5) Use events and a tileset instead of a picture, as you've already said. Elaborating on this: This can actually be as big as you want (Well, figuratively speaking). Fade out screen, disable menu access, disable running, and any other tricky input, Change the player's outfit into a map marker, transfer player into a faux region map drawn with a tileset, change visible routes via events activated on variables or switches (variables might be better cause of different "stages" ((in your case, combos of routes, altered routes etc)) of being activated). When a route/town has been discovered during gameplay, you activate a switch, and when during the map "screen", the "marker" goes on top of it, you make the event (which activates via action button or player touch) ask whether to simply transfer the player there, you don't even need the flying mechanic already in Essentials that way. Screen fade out, enable menu and running, change outfit into default or previously stored if multiple outfits exist. Done! As for the encounters and the pokedex, that's a bit trickier, but the same could be done with these theoretically. Or at the very least, store which parts of the map have been explored in larger groups using option number 3) above (e.g. general areas where these mons can be found) so you won't have to draw an insane amount of combos, and provide more of a "low-res" caricature of the real n' true map, because...uh... well, let's just say you got an old model (sweats)

What's even funnier is that you can turn this into a soaring mechanic like in ORAS. lol!
"Your hair so much reminds me,
of pasta long-forgotten"

DNA_Dan0

Male
Seen 2 Weeks Ago
Posted 3 Weeks Ago
17 posts
1.2 Years
EVERYONE!!! I found a solution! But there's a little more work to be done to fully implement the feature.

First off, I'd like to say thank you all so much for the help! It's been quite the adventure with all of this and all of your suggestions have been fantastic. BUT I FINALLY DID IT! I was toying around with Swdfm's idea to positions the individual route sprites behind the map in order to position them for a sort of picture. I wasn't able to figure out the whole printing thing to save the map, however, I was able to fix a graphical bug that I was having before I posted this thread. All it took was changing the place where the route sprites were being drawn upon, I honestly have no idea how I overlooked this rather simple thing! This solution uses Marin's Better Region Maps script and it's technically custom as I take advantage of another Essential's feature for my own personal preferance, so not quite plug-and-play. I'll explain more about this below.

Basically I was drawing sprites to the window, which made the routes "float" above the map as it panned underneath it. But as I was trying to figure out how to put the sprites behind the map with the z value and, I accidentally pasted the sprites ON the map and they stuck! No floating or anything weird aside from a small offset of 4 pixels in height (but that could be due to my graphics). Once I realized this, I quickly got to work looking at how to adapt the Hidden Island feature into Marin's wonderful script.

So here's my solution! For those who have Marin's Better Region Maps script, I pasted this above "if @show_player" at around line 74.

#-----------------------------------------------------------------
#-----------------------------------------------------------------    
    for route in REGIONMAPEXTRAS
      if $PokemonGlobal.visitedMaps[route[1]]
        @window[route[4]] = Sprite.new(@mapvp)
        @window[route[4]].bmp("Graphics/Pictures/routes/#{route[4]}")
        @window[route[4]].x = route[2]*TileWidth
        @window[route[4]].y = route[3]*TileHeight - 4   #Not sure why, but there was an offset of 4
      end
    end
#-----------------------------------------------------------------
#-----------------------------------------------------------------
Yep, that's it! 8 lines of code, solves this whole question. I'm sure it's possible to shrink this down or make it more efficient, so I welcome anyone who's got the know-how to. I take advantage of how REGIONMAPEXTRAS (the Hidden Island feature in Essentials) store's it's array and basically copy it, but this could easily be done with a custom Constant. I think I'll create a new Constant myself because I'm not using the true/false statement at the end of REGIONMAPEXTRAS as well as I'm not using any Game Switches at all to handle this. Instead of switches, I'm using another feature in Essentials that tracks which maps have been visited! The $PokemonGlobal.visitedMaps, with the route[1] that it's checking for is a reference to the map id (NOT a switch, that the normal REGIONMAPEXTRAS has in that place of the array). That way, once a player steps on a map, I don't need any one-time event to trigger a switch. Essentials does this all for you. I've also created a folder in my graphics folder called "routes" where I'll store all the individual towns and routes pictures.

Now what to do next? Streamlining the code would be what I want to try doing next, and I think I'll need help with this. As well as a little more testing to figure out if lag is an issue when looking at the map (I tested up to 10 routes, so far it looked good, but who knows). Another thing that needs to be done to fully implement this feature would be hiding the text that appears when hovering the cursor on the map until the route has been visited. Right now, all of the routes and town names are visible even when the picture isn't. I'll try modifying the draw text part of Marin's script to only draw when a route has been visited. I was just too excited to figure it out yet, but I think taking advantage of the $PokemonGlobal.visitedMaps would do the trick again. I'll update this post (and my first one) once this is implemented as I thiiiiiink this would be everything that needs to happen in order for this to work.

Thanks again everyone! I just saw AenaonDusky post but I guess I was a little too quick with my troubleshooting today to need your suggestions. Although flying around a map like ORAS would be sweet if that could be done!

DNA_Dan0

Male
Seen 2 Weeks Ago
Posted 3 Weeks Ago
17 posts
1.2 Years
Rather than editing my last post, I thought I better do a full new post explaining everything I've done to add progressively revealing region maps to the game (using Marin's Better Region Maps script), now that I found a solution to the text display! The only thing left to do is check whether lag is an issue. In all my testing, I hadn't come across any lag issues, but it could entirely be possible that some lag will occur if you are using a massive map with many many routes and towns. My codeing skills are limited as well, so I welcome anyone who might be able to make this better! Or if you have any questions or bugs to report, please let me know! I'll be happy to answer anything or squash some pesky bugs.

Some notes before we get started: This code is a modification of Marin's amazing Better Region Map script. It is a necessary script if you want to use any map larger than 480x320. If you are using the base essentials essentials map, I recommend taking advantage of the Hidden Islands feature to reveal your routes one at a time. To do so, you would need to dedicate switches to each and every route and town that are triggered by in game events. It'll work, but I think it would be a little messy and uses way too many switches. Besides, Marin's script works even on small maps too and you no longer have to deal with wall maps being different than the town map, so I definitely recommend it if you want to take advantage of this code!

In settings, you will need to first add a new Constant. In Settings, I placed this under the REGIONMAPEXTRAS (the hidden island feature):

#===============================================================================
# * A set of arrays for hidden routes and towns that will be shown when the
#      player enters the map.  Each Array must contain the following:
#      - Region number.
#      - Map ID.
#      - X coordinate of the graphic on the map (pixel)
#      - Y coordinate of the graphic on the map (pixel)
#      - Name of the graphic, found in the Graphics/Pictures/Routes folder.
#      - Name of Route/Town in townmap.txt
#===============================================================================
HIDDENROUTES = [
   [0,81,80,160,"townNewbreezeTown","Newbreeze Town"],
   [0,32,64,160,"route4","Route 4"],
   [0,48,160,192,"townOldparkTown","Oldpark Town"]
]
I've included some personal examples of two towns and a route that connects them. Be sure to add a new folder in your Graphics folder called "Routes"!

Next in Marin's BetterRegionMap script, below the "@window["player"] = Sprite.new(@mapvp)" (line 72) paste this:

#-----------------------------------
#-----------------------------------    
    for route in HIDDENROUTES
      if $PokemonGlobal.visitedMaps[route[1]] && $PokemonGlobal.region = route[0]
        @window[route[4]] = Sprite.new(@mapvp)
        @window[route[4]].bmp("Graphics/Pictures/Routes/#{route[4]}")
        @window[route[4]].x = route[2]
        @window[route[4]].y = route[3] - 4   #Not sure why, but there is an offset of 4
      end
    end
#-----------------------------------
#-----------------------------------
You will also need to modify the "if @show_player" statement a little bit by adding this below "@window["player"].y = TileHeight * player[2] + (TileHeight / 2.0)"

@window["player"].z = 1 #so the player icon shows above routes
And lastly, at around line 360 you will need to replace the entire "def update_text" routine with this modified version:

#-----------------------------------
#-----------------------------------
  def update_text
    location = @data[2].find do |e|
      e[0] == $PokemonGlobal.regionMapSel[0] &&
      e[1] == $PokemonGlobal.regionMapSel[1]
    end
    
    text = ""
    poi = ""
    
    for route in HIDDENROUTES
      if $PokemonGlobal.visitedMaps[route[1]] && $PokemonGlobal.region = route[0]
        text = location[2] if location && (location[2] == route[5])
        poi = location[3] if location && location[3] && (location[2] == route[5])
      end
    end
      
    @sprites["txt"].draw([
        [pbGetMessage(MessageTypes::RegionNames,@region), 16, 0, 0,
            Color.new(255,255,255), Color.new(0,0,0)],
        [text, 16, 354, 0, Color.new(255,255,255), Color.new(0,0,0)],
        [poi, 496, 354, 1, Color.new(255,255,255), Color.new(0,0,0)]
    ], true)
  end
#-----------------------------------
#-----------------------------------
And that's that! Your routes will now display progressively as the player adventures forth into your wide wide region! If you stylize your map, I think this feature would look amazing a sort of "hand drawn" kind of map.

Some tips:
If you wish for a town or route, or whatever custom feature you want on the map, to be visible from the very beginning, in the HIDDENROUTES array, make the map id 1 (the intro map) instead of whatever map id the place actually is. This will make the place appear on the map right from the very beginning of the game. You can also do this for a series of towns and routes you want to appear all at once, simply make the map id of each entry in the HIDDENROUTES array to be the same, then they will all appear on the map together once the player enters that one map id.

This code won't allow you to replace any routes on the map with a new one (say some landslide happens and the route now goes South instead of East). However! A good workaround I found for this was to have the route picture file not have a transparent background, but instead have the background included (the map's terrain). By placing the new layout of the route lower in the HIDDENROUTES array, it will cover over the previous route when loaded in. You can literally move mountains with this code!

Let me know what you all think! And I'm still relatively new to PokéCommunity, so should I post this solution in another thread now that it's solved? Like in the Scripts, Tutorials and tools section? I'm not sure on the etiquette of that on here.

Thanks again to everyone, I couldn't have done this without your great suggestions!
Male
Seen 1 Day Ago
Posted 1 Day Ago
153 posts
156 Days
Wow so happy for you man!

Your investment really brought many people on this thread and it was really nice to see.
I can't try the all thing now but I added it to my script and will let you know when I take the time to draw my own map.

You can definitely create a script section where you copy your above message and add some pictures to show the result.

Again congrats
Advertiser Content