Hi,
As you can see below, I want my player unit to move up on my tilemap. It does it successfully. However, now I would like to figure out a way to identify which type of tile the one-up is before the player goes there.
For example, let's say the tile up from the player is a tree, and I want the player to chop the tree each time it tries to move up and the tree is in that tile up.
I believe I have it set correctly except for being able to check before the player moves to the tile:
tilemap.tileat(tilemap.positiontotilex(OverlandMapPlayer.x),tilemap.positiontotiley(OverlandMapPlayer.y))
I assume I would need to add a condition that checks for the tile up from the player and then a sub-event or otherwise that will move the player if it is an open tile OR if it is a tree tile. I can then use my tree-chopping function/mechanic.
Can you help me identify what I need to check? I assume I need to do tileID - 1 or tileID - Column, etc..., or is there something built in?
The other idea I have is to move the player UP, then check what tile it is ON, run a checker function to see if it's a tree tile and then knockback the player to the original tile, while also completing a chop at the tree. Then rinse and repeat assuming AP > cost and tree hp > 0.
Thanks!