Basically, here's what I want to do. I have an item that when used, transports the player to a campsite so they can rest. However, there are multiple climates in the game. Currently, all the camp item does is transport the player to a campsite in the forest, but that is pretty unrealistic when the player is in another climate area (desert, snow, etc). I would like the item to transfer the player to a campsite that matches the map region where the player was just at (snow to snow, desert to desert, etc). How would I go about this?
How to get a map to change based on the previous location id?
RPG Maker VXAce SupportWhy not just make 4 of those? then on the common event (I'm assuming ur using one for the item), just check the current map ID so that you can teleport to the correct camp
Four of what, the item or the event? How would I make it check the current ID, if the zones range across multiple maps? Currently, it's like this (it's not finished, so that's why things aren't in the right order all the way).
the map of course...
before the transfer, check the value of your MapID variable (variable 1)
before the transfer, check the value of your MapID variable (variable 1)
As said before, you need to set that before the transfer command.
You can use the "get location info" command to fill a variable with the info you want - this can be map ID, Region ID, or several other things.
Then you use a sequence of conditional branches to check where the player is, and give different transfer commands based on that info.
How to make the exact sequence depends on where the info "desert, snow,..." is set in your game - if an entire map is always the same climate, you can even make an autorun on each map giving the campsite Map ID into a variable.
yeah, the set would depend on how exactly the climates per map are set-up... if your maps of the same climate are in a sequence (like all winter maps are from Maps 1-10 for example) it will be easier
The maps are in sequence.
I'm still really confused. Could you try and explain it step by step please? I've only done things with map IDs once, so please forgive my ignorance of the subject.
Unfortunately that is rather difficult unless you tell us how your game knows the climate the player is in when the player uses the item.
The game engine itself has no climate value, it only knows maps and tiles or tilesets. Just "painting" a map with tiles that look like snow is not enough to tell the game engine that those tiles are supposed to have a climate "snow", you have to tell the game that this area is "snow" by some other methods.
So the first question is: Have you already choosen how to tell the game where the snow or desert areas are?
If yes, then explain us how you do this - if not, then show us a screenshot of a map so we can see how you made that map.
Is an entire map a climate or what(if so this could be super easy to do with map ID, and condition branches)? We need more info on how your game is set up.
Currently, the maps "climates" are just the tiles. Would a parallel process variable work for telling what "climate" it is, instead of using multiple map ID stuff?
Well, you could set the climate variable at every start of each map via a parallel process event...
In that case, I suggest using the terrain tags. That will limit you to eight different "climates", but is easier than painting all maps with region IDs (which would allow for up to 64 climate tags.
Go to the database, tilesets and click on "Terrain Tag". Make yourself a list like "1 is desert, 2 is snow, 3 is forest" or so, and set the terrain tag for each tile in the tileset to the correct number.
Then, on the common event called by the item, use control variables:game data to get the player position into variables, then use "get Location Info" to get the curren't positions Terrain Tag into another variable.
Then you can choose a different transfer command depending on the terrain tag, either by conditional branches or (if the campsites are in ID-order and the terrain tags are in the same order) by using variable mathematics to calculate the target for a variable transfer.
That works! Thank you so much for an understandable explanation.
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.
Original thread: https://forums.rpgmakerweb.com/threads/how-to-get-a-map-to-change-based-on-the-previous-location-id.24121/