Page 1 of 1

Make avatar stop/prevent avatar movement

Posted: 14 Oct 2010, 11:57
by julifos
Hi all!

I'm trying to do a "simple" thing: restrict avatar movement under certain conditions. Let's say I have a walkable tile which contains FIRE. Only firemen can enter in-there. The rest of people should stay in place when they click that tile (ie, don't move in!).

I don't find a way to restrict movement. My only thought is issuing moveMyAvatar(currentTile.x, currentTile.y). But seems OpenSpace doesn't like that. Seems to be some kind of collission between the start-tiles defined by OpenSpace (upon user-click) and the ones defined by my moveMyAvatar, which makes OpenSpace ignore the second request (moveMyAvatar).

Do you know if there is some way or workaround to stop the avatar or make him return to the previous tile? For cosmetic purposes I would like that the avatar doesn't move a single pixel from its original position, if that is possible. Else I would be willin' to implement whatever thing which gives the functionality, in despite of the cosmetic issues.

Thanks in advance for any hints!

Posted: 18 Oct 2010, 11:21
by Bax
Sorry, it's not possible to stop an avatar. What you need to do can be achieved using OpenSpace 2 (see the IOpenSpace.preAvatarMoveValidator function in the API documentation)

Posted: 27 Oct 2010, 05:53
by julifos
OK, thanks!

Anyway, I think I found a couple of workarounds which fit my needs.