This site is currently in read-only mode during migration to a new platform.
You cannot post questions, answers or comments, as they would be lost during the migration otherwise.
0 votes

In my game, you can place different rotations/varieties of an object (houses rotated at different angles, different flower/tree types, etc) which is done by changing the autotile coord of the atlas. I am saving all of this in a dictionary and then during loading I use for loops to place the tiles and then use updatebitmaskregion(). However, this doesn't keep the atlas autotile coords. Here's the dictionary for reference:

var data = {
    "Houses" : buildings.get_used_cells_by_id(0),
    "Roads" : buildings.get_used_cells_by_id(1),
    "Crosses" : buildings.get_used_cells_by_id(2),
    "Sidewalks" : buildings.get_used_cells_by_id(3),
    "Trees" : buildings.get_used_cells_by_id(4),
    "Directions" : buildings.get_cell_autotile_coord(buildings.get_used_cells().x, buildings.get_used_cells().y),
}

Also the attempted for loop for "Directions":

for tile in playerData.Directions:
            buildings.set_cell(tile.x, tile.y, tile, false, false, false, playerData.Directions)
            buildings.update_bitmask_region()

(Buildings is the tilemap)
Directions is what is supposed to save the coords. The code for it definitely isn't correct though. I've tried a few different things but this is what I keep coming back to. All this to say, how should I be approaching this? Again the goal is to save the autotile coord of all used tiles and then correctly place them.

I'm pretty stumped at this point so any help is appreciated.

Godot version 3.3
in Engine by (51 points)

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.