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:
cp0, cp1, cp2, cp3 (control points)
These four control points "describe" the avatar projection on the ground, like in the following picture:
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.
Avatar configuration
Avatar configuration
Paolo Bax
The SmartFoxServer Team
The SmartFoxServer Team
AnimTime run-time change
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.
We want to give some boost pills that would speedup avatars for some time, so need to know is it possible.
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
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
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
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
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
FYI, I want to create a dynamic avatar system (such as change shape depends on user inputs).
Thanks,
- pt_dev
Return to “OpenSpace v1 discussions and help”
Who is online
Users browsing this forum: No registered users and 21 guests