Hi there,
Can I get a demo of avatar sitiing down code ? , I am not able to make the proper graphics for it.
I Have tried to make the avater to move near the chair by "movemyavatar" command - it work.
then I have teleport it to the chair (work also) and change the state to sit "this.openSpace.setMyAvatarState("sit");" .
then I have tried to change the exampleavatar.as as folowing ( can not make it work)
.....
private function drawAvatar():void
{
var sex:String = skin.sex
var race:String = skin.race
var hair:String = skin.hair
var bust:String = skin.bust
var legs:String = skin.legs
if (_state == "sit")
{
if (bodyMC != null && bodyMC.name != "")
removeChild(bodyMC);
if (legsMC != null && legsMC.name != "") {
removeChild(legsMC);
legsMC=null;
}
if (bustMC != null && bustMC.name != "")
{
removeChild(bustMC);
bustMC=null;
}
if (hairMC != null && hairMC.name != "")
{
removeChild(hairMC);
hairMC=null;
}
var clazz:Class = getDefinitionByName("m_sit_ne") as Class
var mc:MovieClip
mc = new clazz() as MovieClip
mc.name = "m_sit_ne"
mc.x = X_OFFSET
mc.y = Y_OFFSET
addChild(mc);
....
when I have "m_sit_ne" sitting image of the avatar in the right direction.
what am i doing wrong ?
can i get a demo of siting or acting avatar ?
thanks for advance.
graphics for avatar sit down
Re: graphics for avatar sit down
Maybe you didn't export the new library containing the sitting avatar graphics?
Paolo Bax
The SmartFoxServer Team
The SmartFoxServer Team
Re: graphics for avatar sit down
Hi,
thanls for your replay , the problem was the if statment , I have needed to created an object ans to pass it to the state and not work with just a string something like
var avatarState:Object = {}
avatarState.id = "sit"
this.openSpace.setMyAvatarState(avatarState);
and the avatar is now sitting when requested.
now my secound question is how to make it got stand again , how do i catch the avatar pressing on of the other tile in the map (walking tiles )?
regards
thanls for your replay , the problem was the if statment , I have needed to created an object ans to pass it to the state and not work with just a string something like
var avatarState:Object = {}
avatarState.id = "sit"
this.openSpace.setMyAvatarState(avatarState);
and the avatar is now sitting when requested.
now my secound question is how to make it got stand again , how do i catch the avatar pressing on of the other tile in the map (walking tiles )?
regards
Re: graphics for avatar sit down
You could add a click trigger on all the walkable tiles of the map.
Otherwise you could try adding a click event on the whole OpenSpace object: when the event is fired you could make the avatar stand.
This of course requires that the user clicks again to move the avatar.
Otherwise you could try adding a click event on the whole OpenSpace object: when the event is fired you could make the avatar stand.
This of course requires that the user clicks again to move the avatar.
Paolo Bax
The SmartFoxServer Team
The SmartFoxServer Team
Return to “OpenSpace v2 discussions and help”
Who is online
Users browsing this forum: No registered users and 17 guests