Knowing the current avatarposition on server-side

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

Moderators: Lapo, Bax

Post Reply
ffourcad
Posts: 130
Joined: 25 Feb 2010, 10:26

Knowing the current avatarposition on server-side

Post by ffourcad »

Hello, I'd like to know the current tile position of an avatar during his movement on server-side.
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Post by Bax »

This is not possible. The server only knows the start coordinates and the end coordinates of the avatar movement.
Paolo Bax
The SmartFoxServer Team
ffourcad
Posts: 130
Joined: 25 Feb 2010, 10:26

Post by ffourcad »

How can we change the movement of an avatar during its course ?
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Post by Bax »

On the client side:
- click on a new tile;
- call the moveMyAvatar method passing the new destination coordinates.

On the server side:
- call the moveAvatar method passing the new destination coordinates.
Paolo Bax
The SmartFoxServer Team
ffourcad
Posts: 130
Joined: 25 Feb 2010, 10:26

Post by ffourcad »

on server-side, when we use moveAvatar, it seems that the avatar finishes its current movement, before doing the new one. Which that if you move the avatar on a straight line, then ask him to move to a tile in the middle of this line, it first goes to the end of the line, then goes back to the tile in the middle.
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Post by Bax »

Yes, you are right. If possible we will improve this by allowing you to pass a parameter causing the current path to be dropped and the new one started.
Thank you for pointing out.
Paolo Bax
The SmartFoxServer Team
TiagoR
Posts: 83
Joined: 15 Mar 2010, 11:42
Location: Portugal

Post by TiagoR »

On client side you can always do

Code: Select all

openSpace.stopMyAvatar()
and then

Code: Select all

openSpace.moveMyAvatar( coords )
TR
ffourcad
Posts: 130
Joined: 25 Feb 2010, 10:26

Post by ffourcad »

Thank you, but i'm trying to stop other avatars than mine (NPCs in that case)
Nepaleno
Posts: 22
Joined: 06 May 2010, 06:28

Post by Nepaleno »

Is it possible to know serverside if NPC is moving or standing at the moment?

The thing is I wanna send him to some position on map and perform some action when he's there. So serverside I gotta know if he's already there.
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Post by Bax »

No, it is not possible to know if the avatar is moving or not, because animation is entirely managed by the client.
Paolo Bax
The SmartFoxServer Team
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Post by Bax »

We further investigated the possibility of stopping the current avatar movement when the server-side moveAvatar method is called, instead of queuing the new path.
Unfortunately this is not possible, because the extension should know the current position of the avatar, in order to synchronize the starting position on all the clients.
Paolo Bax
The SmartFoxServer Team
Post Reply