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.

[Resolved] quik question

Status
Not open for further replies.

Anonymous

Guest

No, there isn't. It's loaded from the map rxdata file. From Game_Map:

Code:
    @map = load_data(sprintf("Data/Map%03d.rxdata", @map_id))
 
Note that this file contains an array, where the indexes are the map IDs and the elements are RPG::MapInfo objects. In this object, the only thing you will really use (i guess) is <RPG::MapInfo>.id and <RPG::MapInfo>.name (both are properties, and they´re self-explanatory, aren´t they? ^^). So, in the ccoa´s case, @map will contain an Array, so keep this in mind.
 
Note that this file contains an array, where the indexes are the map IDs and the elements are RPG::MapInfo objects. In this object, the only thing you will really use (i guess) is <RPG::MapInfo>.id and <RPG::MapInfo>.name (both are properties, and they´re self-explanatory, aren´t they? ^^).
No, what you mean ist MapInfos.rxdata
The actuall map-file, which is loaded in ccoas example is a table, a 3d-Array containing the tiles on the three layers.
 
MapInfos.rxdata contains a hash with the keys as map ids, and RPG::mapinfo as the values.

What ccoa should you is exactly how to get all the map data you set in the database (RPG::Map). It returns a RPG::Map object. The table that MM is talking about is actually what ccoa should you, plus .data. That gives you the 3D array of tile data.

Code:
load_data('Data/MapInfos.rxdata').each do |map_id, mapinfo|
  rpgmap_data = load_data(sprintf("Data/Map%03d.rxdata", map_id))
  # You now have access to mapinfo and rpgmap_data
end

That will pass through every map in your game, in no real order. If you wanted it to pass starting with map 1 and going to your last map...
Code:
map_infos = load_data('Data/MapInfos.rxdata')
for map_id in map_infos.keys.sort
  map_info = map_infos[map_id]
  rpgmap_data = load_data(sprintf("Data/Map%03d.rxdata", map_id))
  # You now have access to mapinfo and rpgmap_data
end

Maybe I am wrong, but I think some people need to refresh their resources. :yes: jk.
 
Erm, sorry i forgot that lol xD I need to script something to get to my old "shape" -_-

I posted something without reading properly the entire thread. But MapInfos contains a list of all the maps that your game has, so it would be useful. Use SS´s example, it should work (despite its scary code for beginners lol)
 
Status
Not open for further replies.

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