Page 1 of 1

SetMyAvatarSkin Problem changing rooms

Posted: 11 Dec 2010, 22:50
by fabianres@live.com.mx
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

Posted: 13 Dec 2010, 07:35
by Bax
Each time you load a map you have to recreate the avatar passing the initial skin.

Yes I am aware this...

Posted: 13 Dec 2010, 14:08
by fabianres@live.com.mx
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.

Posted: 13 Dec 2010, 22:37
by fabianres@live.com.mx
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