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.

Autotiles

Where can I learn everything there is to know about how autotiles act? Things like the x and y, and maybe what tiles are linked. Where does water update itself at, and what's the coding behind it? Any information will be useful.
 
Raziel said:
Well, you could look into the help file, most of them are located there.
Mainly the one's that you can figure out on your own, such as RPG::Actor, RPG::Item, etc.

But things like the Tilemap class, Font class, Bitmap class, Sprite class, etc. are hidden. Same with modules like the Graphics and Audio module.
 
Looking in RMXP's help file, I typed in Tileset and Autotile into the search system. Just doing that, you can get the module RPG tileset class. Also, by looking at the Tilemap topic in the RMXP's help file, you'll find a little more data on tiles... including how to link the tileset to 7 autotiles.

Just in case... here's module RPG's Tileset Class
Code:
module RPG
  class Tileset
    def initialize
      @id = 0
      @name = ""
      @tileset_name = ""
      @autotile_names = [""]*7
      @panorama_name = ""
      @panorama_hue = 0
      @fog_name = ""
      @fog_hue = 0
      @fog_opacity = 64
      @fog_blend_type = 0
      @fog_zoom = 200
      @fog_sx = 0
      @fog_sy = 0
      @battleback_name = ""
      @passages = Table.new(384)
      @priorities = Table.new(384)
      @priorities[0] = 5
      @terrain_tags = Table.new(384)
    end
    attr_accessor :id
    attr_accessor :name
    attr_accessor :tileset_name
    attr_accessor :autotile_names
    attr_accessor :panorama_name
    attr_accessor :panorama_hue
    attr_accessor :fog_name
    attr_accessor :fog_hue
    attr_accessor :fog_opacity
    attr_accessor :fog_blend_type
    attr_accessor :fog_zoom
    attr_accessor :fog_sx
    attr_accessor :fog_sy
    attr_accessor :battleback_name
    attr_accessor :passages
    attr_accessor :priorities
    attr_accessor :terrain_tags
  end
end

and here is...

Tilemap
The class governing tilemaps. Tilemaps are a specialized concept used in 2D game map displays, created internally from multiple sprites.

Superclass

Object

Class Method

Tilemap.new([viewport])
Creates a Tilemap object. Specifies a Viewport (Viewport) when necessary.


Methods

dispose

Frees the tilemap. If the tilemap has already been freed, does nothing.

disposed?

Returns TRUE if the tilemap has been freed.

viewport
Gets the Viewport (Viewport) specified when the tilemap was created.

update
Updates the autotile animation, etc. As a rule, this method is called once per frame.


Properties

tileset
Refers to the bitmap (Bitmap) used as a tileset.

autotiles[index]
Refers to the bitmap (Bitmap) used as an autotile with an index number from 0 to 6.

map_data
Refers to map data (Table). Defines a 3-dimensional array measuring [ horizontal size * vertical size * 3 ].

flash_data
Refers to the flash data (Table) used when showing range of possible movement in simulation games, etc. Defines a 2-dimensional array measuring [ horizontal size * vertical size ]. This array must be the same size as the map data. Each element uses 4 bits to represent a tile's flash color in RGB; for example, 0xf84 flashes in RGB(15,8,4).

priorities
Reference to the priority table (Table). Defines a 1-dimensional array containing elements corresponding to tile IDs.

visible

The tilemap's visibility. If TRUE, the tilemap is visible.

ox
The X-coordinate of the tilemap's starting point. Change this value to scroll the tilemap.

oy
The Y-coordinate of the tilemap's starting point. Change this value to scroll the tilemap.


Notes
The Z-coordinate of each sprite used to create a tilemap is fixed at a specific value.

Tiles with a priority of 0 always have a Z-coordinate of 0.
Priority 1 tiles placed at the top edge of the screen have a Z-coordinate of 64.
Every time the priority increases by 1 or the next tile down is selected, the Z-coordinate increases by 32.
The Z-coordinate changes accordingly as the tilemap scrolls vertically.
Keep these rules in mind when setting the Z-coordinates of any map characters.
 
Well, I downloaded this filesee program that allows you to view files in a clear format. It seems that these hidden classes aren't in the scripts.rxdata file. The .rxdata file wasn't able to be fully read right, but I did manage to see the names off all the classes scattered in their order. Class Sprite, Tilemap, etc. were no where to be found.

I've looked in other files like the Game.rxproj, Game.exe, but my main suspicions is that it lies in the RGSS102.dll. Sadly, I can only interpret what it says in the least bit.

Wait....I think I found it!

It's VERY messy, though. I'm seeing things like "module RPG;class Sprite < ::Sprite;"

I'm interpreting the ";" marks as an enter space. OOOOO, this is SO exciting.

What I did is I converted it to Hex mode, then saved it as a .txt file. Now, there's large, script size chunks of coding. I'm gonna spend some more time with this. I'll clean up some of it and post it later.
 

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