Check which Walkable Area ID the players on [SOLVED]

Started by Stranga, Sat 04/02/2017 13:25:16

Previous topic - Next topic

Stranga

Hello everyone.

I'm not sure if there is such a way to do this, but is there a way to check which walkable area ID the player is on or is active? I'm trying to create a mechanic that will deactivate certain hotspots when the player is on one of the walkable area IDs. If there is no way of checking, can this still be achieved in some way?

Kumpel

If you just want something to happen on some area, thats what regions are for. If you also need to deactivate some paths (so the player can't walk there), you could create identical regions and walkable areas and code in that specific regions function, that if the player is standing on this region, some walkable area is removed or restored with RemoveWalkableArea(ID)/RestoreWalkableArea(ID).

Stranga

Thank you Kumpel. I will research more into regions and see if I can come up with something.

Crimson Wizard

#3
To answer the question directly, if you still need that, function to get walkable area at certain point is: GetWalkableAreaAt(int x, int y)
I am not sure if there is a way to know if it's enabled or not. But with regions solution that Kumpel suggested, you may use combination of walkable area and region checks to achieve what you want.

EDIT: by the way, it may be possible that GetWalkableAreaAt does not find area if it was disabled. I do not remember how that works tbh.

SMF spam blocked by CleanTalk