Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Changing MapID For Variable Purposes

Here's my question: is there an easy way to change the actual ID number of a map without having to make a new map and transfer everything from the old map to the new? x_x
The reason I'm wanting to do this is because... well lets take an example from my eventing system. There's maps 23, 21, and 22, in that order. I'll call them 23 - Map A, 21 - Map B, and 22 - Map C. There's events that I want to take place on Map A but not B and C, then Map A and B but not C, and so forth. I hope I didn't get too confusing... well anyway, considering that Map A is ID 23, I would have to say in eventing... Variable mapvariable is equal to Map ID. And in that case, I would set a conditional branch in which the variable would be less than or equal to to ID 23. But you see, here is my issue, my map IDs are mixed up, therefore, I can't do the event on one map, without effecting the other 2 maps.... guhh I'm getting way over my head here x__x;
Ok so, if that crappy example was too confusing, that was only to show WHY exactly I want to switch my map IDs. So, can the IDs be switched at all?
 
There is a solution however, unless I misunderstood. If you make an array that you can obtain and set somewhere, you can basically use:
Code:
array = [21,22] # or whatever other IDs
Then if you set the Map ID to a variable with the ID 5, you can check using a conditional branch with this script:
Code:
array.include?($game_variables[5])
I might have misunderstood your post, but to use this method you would have to create an array for each event-set. If you understand. For instance, if you want events on map 21 and 22 only, use the code above. Then for other map-ranges you have to create a different array. Perhaps double arrays such as:
Code:
array = [[21,22], [23], [24,26,29,31]]
array[0] # first set
array[1] # second set
array[2] # third set
array[0].include?(id) # check if included
Hope this was of any use.

NOTE: 'array' is a guideline. You cannot use a local variable with a conditional branch as it will be lost before that time.
 
There is a way to reorder the maps.  (but if you're project is getting large, you probably won't like it.)

You can open 2 sessions of RMXP. Then Copy/Paste maps from your project to a new project in the order you want them.

If you have done a lot of customizing (scripts, tilesets, database, etc...), I would do it this way:

1) Copy MyProject folder to MyProject2.
2) Open both projects in seperate sessions of RMXP
3) Delete all of the maps from MyProject2
4) Copy/Paste the maps, in order, from MyProject to MyProject2

As you progress with RMXP, I think you'll find that the more planning you do up front, the easier building the game will be.
(A lesson many of us had to learn the hard way as well.) :scruff:


This is one POSSIBLE solution to your problem.
If you would like to elaborate, and explain what you are trying to do with the events in question, we can probably recommend the best course of action.

Be Well
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top