First this about that concept 'index'. An index is the place that 'something' has in a list of 'things'. An index is always zero based. (the first 'something' has place zero in the list)
A tile in a tilemap contains the following info :
Its state (mirrored , flipped ....)
The index of its graphic contents. (iD)
The index of its position on a horizontal row (iX)
The index of its position on a vertical row (iX)
Besides that, Tilemap knows the position for the center of that tile (X and Y in pixels)
Using the Conditions, Actions and Expression for Tilemap can be confusing.
When using the condition 'Compare tile at' (by example) it is asking to input 'Tile X' and 'Tile Y'.
As a beginner you would expect to fill in positions (In pixels)
But when you look at the description then you see that is expecting indexes (iX and iY)
To walk trough a tilemap we need to set up a nested loop.
First for the horizontal row of tiles.
The first tile on a row has index zero.
The last tile on a row has index round(tilemap.Width / size of 1 tile)
Then a sub condition for the vertical columns.
The first tile on a column has index zero.
The last tile on a row has index round(tilemap.Height/ size of 1 tile)
Looks like this
Root Event > System > For > Name = "iX" ... start = zero ... end = round(tilemap.Width / size of 1 tile)
Sub event > System > For > Name = "iY" ... start = zero ... end = round(tilemap.Height/ size of 1 tile)
That is the nested loop. The index of the loop we access with the expression loopindex("name")
So we continue with another sub event.
Tilemap > Compare tile at > Tile X= Loopindex("iX") ... Tile Y = Loopindex("iY") ... Tile = iD
But often you need the iX and iY for a tile that is nearest to (lets say) Player.X and Player.Y.
In that case we have to translate X & Y (positions) to iX & iY (indexes)
Tilemap can translate those (positions to indexes) with the expressions Tilemap.PositionToTileX & Tilemap.PositionToTileY
So, to compare a tile near the player :
Tilemap > Compare tile at > Tile X = Tilemap.PositionToTileX(player.X) ... Tile Y = Tilemap.PositionToTileY(player.Y)
I think met this info, you have the base to understand the manual about Tilemap, and figure out the rest yourself.