ID:167279
 
Okay, In my current game, when someone dies, their coordinates are saved, a corpse is placed where they died, and they need to wait for a player(lets say, a priest) to come and revive them. While they are dead, however, they are able to move about as a sort of "ghost" or "observer". My question is, however, how would I restrict movement to a certain area around where the player died. For instance, lets say a player dies in the middle of a field, and the standard proc that allows for the player to become an observer is called. How do I allow the player to move around an area around the corpse thats approximately 4 tiles long and 4 wide?
I have a feeling that range is required here, but I currently don't have time to toy around with it.
Thanks in advance.
-Reinhart
You'd just do a check in the Move() proc, most likely. If loc (an argument of the Move() proc) is not in range(4) of the corpse, deny movement. Keep in mind, if the body is dragged out of this range (not sure if that can even happen in your game) they will be unable to move at all. You might set their location back to their corpse. That's basically how I handle it in Maeva.
In response to DerDragon
alrighty, thanks for the help.