Avatar configuration

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

Moderators: Lapo, Bax

User avatar
Bax
Site Admin
Posts: 4609
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Avatar configuration

Postby Bax » 30 Jun 2008, 09:24

The OpenSpace.xml configuration file contains a section dedicated to Avatars named AvatarTypes. In this section you can describe all the avatar types (usually 1) that OpenSpace should be aware of. A description of each parameter is provided here.

type
This string identifies the avatar and must be passed to the OpenSpace.createMyAvatar method.

className
Linkage class name of the avatar movieclip in the Flash library of the reference passed to the OpenSpace.initialize method.

animTime
The time (in milliseconds) it takes to the avatar to move from one tile to the next one along diagonal directions (a correction is applied for the vertical and horizontal directions); in other words this is the speed of the avatar.

stature
The height of the avatar, used to check if the avatar can walk under over-passes like in this example:
Image

cp0, cp1, cp2, cp3 (control points)
These four control points "describe" the avatar projection on the ground, like in the following picture:
Image
OpenSpace makes use of the control points to check the avatar position with respect to the tile, to decide whether the avatar has reached the next tile during movement or not. They are also used when the "pixel perfect collision" is used, to calculate avatars and surrounding objects overlapping (not recommended, to avoid performance issues).
Setting the control points is optional: in case you do not set them, the avatar (0,0) coordinate (which should be located between the avatar's feet; the + in the picture above) is used by the OpenSpace engine. This is usually enough to have an excellent avatar behavior.
Please notice that if you use the control points, they can't exceed the tile size.
Paolo Bax
The SmartFoxServer Team
LEAn
Posts: 16
Joined: 21 Aug 2008, 11:01

AnimTime run-time change

Postby LEAn » 03 Sep 2008, 06:41

Is it possible to change animTime at run-time separately for each avatar?
We want to give some boost pills that would speedup avatars for some time, so need to know is it possible.
User avatar
Bax
Site Admin
Posts: 4609
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 03 Sep 2008, 06:59

No, this is not possible. We will take this request into account after the first release. Thank you.
Paolo Bax
The SmartFoxServer Team
pt_dev
Posts: 37
Joined: 15 Sep 2008, 16:15

Postby pt_dev » 30 Oct 2008, 21:58

Is it possible to make an avatar taller at run-time?

For example, when we create an avatar, we need to have a movie clip as a shape and we just call it. However, if we want have make a default avatar taller, would it be possible? or do we have to have a separate avatar shape in movie clip? We want to give a user the control to modify their avatar shape little bit such as making it taller or fatter.


Thanks,

pt_dev
User avatar
Bax
Site Admin
Posts: 4609
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 31 Oct 2008, 07:33

It is just a matter of skin: you have the control over the skin of the avatar, so you can change the way you like. Just make sure that after changing the size of the avatar, its feet are still on the (0,0) coordinate of your AvatarMovieClip class.
Paolo Bax
The SmartFoxServer Team
pt_dev
Posts: 37
Joined: 15 Sep 2008, 16:15

Postby pt_dev » 31 Oct 2008, 16:32

Thanks for the explanations. I understand the concept; however, I am not sure how to implement it. Could you give me a hint or help? such as I want to pass some variables from swf files (user input) to create the avatar looks - height, hair, sex, and so on. Which part of the example code do I have to modify?


In the AvatarMovieClip class, it contains defaultSkins to create the avatar initially but I want to get values for defaultSkin properties from main swf in this case, it would be "openspace_tester.fla".


And, what are the differences between defaultSkin variables in AvatarMovieClip class and initialSkin object in openspace_tester.fla.


FYI, I have the full version of openspace.


Thank alot.

- pt_dev
User avatar
Bax
Site Admin
Posts: 4609
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 03 Nov 2008, 08:19

Check the examples provided with the commercial version of OpenSpace: there's a button to change the skin of an avatar; you can follow the same approach.
Paolo Bax
The SmartFoxServer Team
pt_dev
Posts: 37
Joined: 15 Sep 2008, 16:15

Postby pt_dev » 03 Nov 2008, 18:54

Yes, I can actually use that method. However, my another question is that even thought I pass Skin values to create an avatar when an avatar is initialized, the system takes only "defaultSkin" object. After an avatar has been created, if I move the avatar, it gets the Skin values. Can you explain that?

FYI, I want to create a dynamic avatar system (such as change shape depends on user inputs).


Thanks,

- pt_dev
User avatar
Bax
Site Admin
Posts: 4609
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 03 Nov 2008, 19:19

Sorry, I don't get your problem. Of course you have to create your own custom AvatarMovieClip class, able to handle the skin values you pass to it.
Paolo Bax
The SmartFoxServer Team
pt_dev
Posts: 37
Joined: 15 Sep 2008, 16:15

Postby pt_dev » 04 Nov 2008, 22:11

Thanks for the reply. I figured it out myself :)


- pt_dev

Return to “OpenSpace v1 discussions and help”

Who is online

Users browsing this forum: No registered users and 21 guests