Make avatar stop/prevent avatar movement

Post here your questions about the OpenSpace 1.x or notify bugs and suggestions.

Moderators: Lapo, Bax

User avatar
julifos
Posts: 33
Joined: 10 Oct 2009, 23:33
Contact:

Make avatar stop/prevent avatar movement

Postby julifos » 14 Oct 2010, 11:57

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!
User avatar
Bax
Site Admin
Posts: 4609
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 18 Oct 2010, 11:21

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)
Paolo Bax
The SmartFoxServer Team
User avatar
julifos
Posts: 33
Joined: 10 Oct 2009, 23:33
Contact:

Postby julifos » 27 Oct 2010, 05:53

OK, thanks!

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

Return to “OpenSpace v1 discussions and help”

Who is online

Users browsing this forum: No registered users and 16 guests