how do Avatar act with anything that not avatar?

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

Moderators: Lapo, Bax

Post Reply
ddk2
Posts: 23
Joined: 16 Feb 2009, 06:56

how do Avatar act with anything that not avatar?

Post by ddk2 »

i put some building that is a tails. and i want my avatar act with it,
how can i do it? :?:
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Post by Bax »

"building that is a tails"... can you better explain?
Anyway, the Ranch example shows how to implement interaction with a building (when the avatar is in front of the doors, they become clickable so you can enter the house).
Paolo Bax
The SmartFoxServer Team
ddk2
Posts: 23
Joined: 16 Feb 2009, 06:56

Post by ddk2 »

ok, i find how to ctrl my building. just use getMapObject, to get building content and do my custom func.
then, i have another question, how can i set avator moving speed? :?:
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Post by Bax »

then, i have another question, how can i set avator moving speed?
The avatar speed can be set in the OpenSpace xml configuration file. Please check this document ("Avatars" section, "animTime" parameter).
Paolo Bax
The SmartFoxServer Team
ddk2
Posts: 23
Joined: 16 Feb 2009, 06:56

Post by ddk2 »

thank you, bax
LEAn
Posts: 16
Joined: 21 Aug 2008, 11:01

Post by LEAn »

Is there any ability to get all such map objects and to get tile on which object resides?
Or, may be, just get all tiles and then inspect skin of each one?
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Post by Bax »

Why do you need to get the tile to which a skin belongs?
Paolo Bax
The SmartFoxServer Team
LEAn
Posts: 16
Joined: 21 Aug 2008, 11:01

Post by LEAn »

I need to make such thing, as when user clicks on object with which it can interact, than avatar will move to the nearest tile and than object will be activated. So I need to get all such objects and be able to direct user's avatar to assigned tile. Getting tile on whcih object located is not the high priority. I can associate tile in another way. But I want to get list of map objects.
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Post by Bax »

The problem I see is that the you have no way to know on which tile you have to send the avatar when a certain object is clicked, unless you parse the map on your side.
I would suggest that you save additional data for the map, like object name -> destination coordinates. When the map is rendered add your click listeners to the map objects and when the event is fired retrieve the associated coordinates and call the moveMyAvatar method.
Paolo Bax
The SmartFoxServer Team
LEAn
Posts: 16
Joined: 21 Aug 2008, 11:01

Post by LEAn »

I can specify tiles to go in params, I think.
But is it any chance to get all objects? Or I need to manage list of this objects separatly?
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Post by Bax »

You have to manage your list separately.
Paolo Bax
The SmartFoxServer Team
Post Reply