How to get a map to change based on the previous location id?

Status
Not open for further replies.

cthulhusquid

Veteran
Veteran
Joined
Aug 19, 2013
Messages
341
Reaction score
294
First Language
English
Primarily Uses
RMVXA
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?
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
Why 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
 

cthulhusquid

Veteran
Veteran
Joined
Aug 19, 2013
Messages
341
Reaction score
294
First Language
English
Primarily Uses
RMVXA
Why 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).
 
Last edited by a moderator:

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
the map of course...


before the transfer, check the value of your MapID variable (variable 1)
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,355
Reaction score
7,668
First Language
German
Primarily Uses
RMMV
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?
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.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
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
 

cthulhusquid

Veteran
Veteran
Joined
Aug 19, 2013
Messages
341
Reaction score
294
First Language
English
Primarily Uses
RMVXA
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.

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.
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.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,355
Reaction score
7,668
First Language
German
Primarily Uses
RMMV
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.
 
Last edited by a moderator:

Zoltor

Veteran
Veteran
Joined
Jan 18, 2014
Messages
1,550
Reaction score
211
First Language
English
Primarily Uses
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.
 

cthulhusquid

Veteran
Veteran
Joined
Aug 19, 2013
Messages
341
Reaction score
294
First Language
English
Primarily Uses
RMVXA
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?
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
Well, you could set the climate variable at every start of each map via a parallel process event...
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,355
Reaction score
7,668
First Language
German
Primarily Uses
RMMV
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?
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.
 

cthulhusquid

Veteran
Veteran
Joined
Aug 19, 2013
Messages
341
Reaction score
294
First Language
English
Primarily Uses
RMVXA
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.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,355
Reaction score
7,668
First Language
German
Primarily Uses
RMMV
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.
 
Status
Not open for further replies.

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

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,849
Messages
1,016,977
Members
137,563
Latest member
cexojow
Top