SetMyAvatarSkin Problem changing rooms

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

Moderators: Lapo, Bax

fabianres@live.com.mx
Posts: 40
Joined: 14 Apr 2010, 17:40

SetMyAvatarSkin Problem changing rooms

Postby fabianres@live.com.mx » 11 Dec 2010, 22:50

Okay so I made a customization system for my game.

I can now configure the avatar skin appropriately with

os.setMyAvatarSkin(customSkin);

So for two days I never understood why other users could not see my skin changes only to realize that the Openspace trial version had a restriction and would prevent others from seeing these changes (Duh!)

Now I had a second problem which I believe stems from that same restriction. I just want to make sure it is the case.

Once I have set my skin, I proceed to leave this room and once I arrive in the next one, the skin set previously "doesn´t stick with me", and the initial skin is once again present.

Does this also have to do with the Openspace trial restriction?

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

Postby Bax » 13 Dec 2010, 07:35

Each time you load a map you have to recreate the avatar passing the initial skin.
Paolo Bax
The SmartFoxServer Team
fabianres@live.com.mx
Posts: 40
Joined: 14 Apr 2010, 17:40

Yes I am aware this...

Postby fabianres@live.com.mx » 13 Dec 2010, 14:08

I am aware that everytime you go to a new room the avatar is created using the initial skin...

// Set my skin, if not already set
var initialSkin:Object = null

var myUser:User = smartFox.getActiveRoom().getUser(smartFox.myUserId)
var skinVar:String = myUser.getVariable("_os_skin")


if (skinVar == null)

{
initialSkin = {}
initialSkin.sex = "f"
initialSkin.hair = "hair1"

}




...but it sets the intitial skin IF it hasn´t been already set which I thought I had done in the previous room.

I presume that the customSkin object from the previous room has to be stored somewhere. I believe it had to be stored in _os_skin somehow and passed to skinVar so when arriving in a new room, the initial skin wouldn´t be set and the customized skin would remain.

If this is the case, I don´t really know how I would script for the customSkin object to be stored in what I believe are user variables, much less how to use the _os_skin

Please Help! Clues??

I´m breaking my head with this.
fabianres@live.com.mx
Posts: 40
Joined: 14 Apr 2010, 17:40

Postby fabianres@live.com.mx » 13 Dec 2010, 22:37

Okay I figured it out

Its pretty simple, I feel very silly now.

You just have to send the newSkin object directly to

os.createMyAvatar()

Thanks anyway

Return to “OpenSpace v1 discussions and help”

Who is online

Users browsing this forum: No registered users and 1 guest