Get Map Dimensions

● ARCHIVED · READ-ONLY
Started by jervous 8 posts View original ↗
  1. Hi,

    Is there a way to get a map's dimensions? For example, if I wanted a common event to check the current map's height (not the player's position, the maximum height) and put it into a variable.

    I don't know much about script calls but I was thinking it might be possible with that? I know in the game's definitions there's
    @map.height
    So, completely hypothetically, something like this (I know this doesn't work) :
    $game_variables[14] = @map.height
  2. In actual use, I believe that would actually be

    $game_map.map.height

    since afaik, @map is an instance variable of the Game_Map class. but rn IDK if the @map variable is accessible outside of the Game_Map class

    and realistically, all u need to do is to try it and see if it works
  3. Is that available in Control Variables > Game Data > Other?

    I really don't have much experience with VX, and I'm not even sure if it's in VX Ace. I don't have my laptop with me so can't check.
  4. Oh shoot, that's what I get for posting this so late. I actually meant for this to be in VX Ace Support. However: @Engr. Adiktuzmiko 's method worked like a charm. That's exactly what I was looking for. The number was stored in the variable without issue. Thank you so much.
  5. Check Shaz comment though, I also think it might actually exist in the Game Data part of control variables. And its actually an Ace line, I was simply hoping that the Game_Map definition remained the same since theres not much difference between them actually.
  6. Oh, no, that was where my confusion started. I had checked and there was nothing about it in Control Variables > Game Data. Nothing about the map's dimensions, only the map ID and specific events' X and Y coordinates (& direction, screen x and y...)
  7. Yeah, I wasn't sure. But glad you checked to confirm.

    If you're using Ace, you can just use $game_map.width and $game_map.height
  8. [move]RPGMaker VX Ace[/move]