I would like to create an RPG multi-screen game where each screen contains a dynamically generated tile map. I want to initialise all the tile maps at the start of the game.
I am trying to use the RPG game sample as a starting point. This contains a grid of 3x3 pre-defined tile maps, and as an experiment, I am trying to modify one of these tile maps by calling tilemap.set_tile("/1-1#tiles", "layer", x, 1, 0)
in the game init()
, where 1-1 refers to the tile map at the centre of the game grid. But I get an error:
ERROR:SCRIPT: main/game.script:14: Instance /1-1#tiles not found
stack traceback:
[C]:-1: in function set_tile
main/game.script:14: in function <main/game.script:3>
I cannot find the correct way to reference the tilemap. I obtained the URL from the right hand side info panel, but it does not work. However I notice that the game object 1-1 is part of a test_layout.collection
, not the main.collection
that game.script
is in.
What is the correct way to reference this tilemap? Can anyone help please?