STUPID TILEMAP...

Posts

Pages: 1
I figured this would be the easiest thing to do on my list of features for my RS! project, yet here I am...

I'm trying to create a Window_Base child class that draws the tile the player is currently standing on into the window. Everything is correct except the drawing rect for tile_ids greater than 768... yes, autotiles. Uggh. I accept now that I have no idea on how to go about this. My only reference to determine how VX handles autotiles is the Mode7 VX script, which uses japanese commenting and bit rearranging. >_<


#--------------------------------------------------------------------------
# * Get tile set rect for the designated tile
# tile_id : Tile ID
#--------------------------------------------------------------------------
def tileset_rect(tile_id)
rect = Rect.new(0, 0, 32, 32)
case (tile_id / 256)
when 0..8
rect.x = (tile_id / 128 % 2 * 8 + tile_id % 8) * 32
rect.y = tile_id % 256 / 8 % 16 * 32
else
#...draws blank...
end
return rect
end

This is the only part that is relevant. I've wasted enough time trying to do this "simple" task, and I'm going to be fairly occupied with other things tomorrow, so I'd like to knock this one out of the park ASAP.

*Performs an incantation in order to summon "Great Red Spirit"*
author=AeroGP link=topic=3861.msg77239#msg77239 date=1243484573
*Performs an incantation in order to summon "Great Red Spirit"*
A lost soul has entered your dungeon. Ohhh. No, it's wandered back out again.
Autotiles are bitches. They're made up of 16x16 tiles so you can't actually get a proper tileset with just a rect, you'll have to have four rects or just a bitmap and build the autotile onto that.

Beyond that I have no idea. I'm not sure where to even look for the code where RMVX actually draws the map and the documentation doesn't have anything that I can find.
I did some deep searching and came across this.
RGSS2 Tilemap

I just took some functionality from it and turned it into a module I could use. Everything should be fine now. =)
Pages: 1