In my level editor you can place a tile on the grid and a value is written to an array in the corresponding cell. In this particular case, the value being written is
"Tile" & "," & Tile.AnimationFrame
To load the tiles I use the event:
+[Array] For Each XYZ Element
+[Compare Two Values] tokenat(Array.CurValue,1,",") = "Tile"
-Set Tile animation frame to int(tokenat(TileArray.Curvalue,2,","))
This loops through the array and checks if the current value's first substring equals "Tile". If so, it will create a tile in the appropriate spot and set the tile's animation frame to the second substring after being converted to an integer.
For some reason it doesn't work. If the current value is just "Tile" then the tiles are loaded just fine, but when I write multiple values to a single cell and try to select a certain one with tokenat(), I get nothing.
Any idea why?