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.

More autotiles per tileset

I need to add a few autotiles to a tileset, but can't take any out as I'm using them. This script request is to add an extra row of autotiles to the tilesets.

Basically, all it does it sees if you are using a tile from row 1, and replaces that tile with the appropriate autotile, set in the script.

Something like this should be in the script:

(Just an example, wont work or anything :p )

for row1 in Tilesets:001
when tile1: replace_with_autotile RPG::Cache.autotile['sandyautotile']
when tile2: replace_with_autotile RPG::Cache.autotile['snowyautotile']
end

Hmm... is that easy enough to understand or do I need to explain better? Let me know if I do.

This is just something that would be useful for my game.

Cheers, ~Wyatt
 
The problem is the formula for calculating tiles and autotiles.

All tiles have a tile_id. Any tile with an id below 384 is an autotile, and every tile above that is a normal tile. It's just automatic because of how everything works.


However, what you could do is place one of the first autotiles in your map editor, then define a new Table that can "redifine" the tile_id as to not modify the tile_id, just add to the outcome when a autotile id is configured.

Your other options is to just manually use a Tilemap class (what do you know, I just finished one) and redraw certain aspects, but this is even harder then the other method mentioned.

I believe I have a solution for this. I think we could get away with reserving the 6th autotile with a blank passability autotile (to avoid confusion). Then people would have to create a Table on what the true autotile id should be.

I think this is very possible. I just might have to take your request so people can finally have more than 6 autotiles.
 
SephirothSpawn is right : changing a normal tile to an autotile will be hard to code (but not impossible, far from it), because the editor takes care of assigning the correct id to the tiles. You'd have to understand how tiles work when >384, and analysing each neighbour tile to render the right part of the autotile -> slow.

However, I don't know how you're going to differentiate the blank autotile. You could have a table, but filling it will be a tedious work. A suggestion (I'm the specialist of weird ways to set scripts, after all ^_^) : you could "Paint" the autotile with a tile on the second layer or do the opposite : have a stripped autotile, so you can see which tile you transform into an autotile. Downside : you'll only have one layer for further mapping.

Or maybe only "mark" the autotile with one tile, so you can use the rest if you need it ?
 
I fyou're interested, I use another way to acomplish this, without using scripts. Altough is a really tedious work sometimes.

What I do is double click the autotile, then I press the print key. Then I copy it using paintbrush, and paste it on the tileset that I want.

Tedious, surely. But it works.

Thanks!
 
/\ Unfortunately, then I can't use animated autotiles.

@SephirothSpawn: Your script rocks and all, and works, but I'm doing complicated shapes and such over large areas with the autotiles, it would be a bit tedious to have to see where each autotile would cover and work out the numbers etc.
 
Well, its virtually the only way to do things. Another option would be to create text document like so:

Map_001_layer1.txt
Code:
0000000000000000
0000707009990000
0000707000800000
0000777000800000
0000707000800000
0000707009990000
0000000000000000

I could make an addition to the system that will check for Text files name "Map_(map_id)_layer_(layer)" and have them autoload themselves.

Thats the only other way I can think of doing this.
 

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