Hello, I’m just starting out in Godot and I’m trying to make a very simple map for a (mostly) text-based game. I’ve got the tiles that I need to lay down defined properly, and everything in the code works except for the set_cell. The code doesn’t generate any errors. When I run the game, the tilemap appears unchanged, even if I place tiles on it before or keep it empty. Here is the code attached to the tilemap:
Yes, it works normally, and tiles drawn by hand appear when the game is run.
It depends on the particular actions in the game, but it always prints the expected and correct value for each action/state.
As for the container, I think I just put it there to make it easier to move around like the other elements on screen. On second thought, there’s not much of a point to it.
Okay, I’ve tried with smaller and larger coordinates, including some outside the screen (I checked around the area with the project camera override) and couldn’t see any tile.
Not the manually drawn tile, that one remains normal even when running. The issue is that the tile that the script is supposed to draw never seems to appear.
It’s called upon a room transition, when the newly entered room must be loaded onto the map. Here is the code when it is called:
func process_action(action):
if currentRoom == null:
currentRoom = ‘room1’
Map.currentRoom = currentRoom
Map.\_draw_map_tiles()
return render_room(rooms\[currentRoom\])
if rooms[currentRoom]['exits'].has(action) == false:
return 'You cannot go that way.' + "\n"
if rooms[currentRoom]['exits'][action].has('destination') == true:
currentRoom = rooms[currentRoom]['exits'][action]['destination']
Map.currentRoom = currentRoom
Map._draw_map_tiles()
# return the text of the new room
return render_room(rooms[currentRoom])
The rest of the code within _draw_map_tiles() functions correctly, which is confusing to me.
Okay. I tried from the earliest point, _on_text_submitted, and it failed there. It also fails from process_action.
At this point I’d like to say thanks for bearing with me this whole time, it’s a frustrating issue.