Author Topic: How do I code avatar changes?  (Read 2339 times)

I want to make an event to change a player's avatar (And then set a schedule to keep it that way!), but I don't know how to make player's looks change. I have some ideas though.

So you want an event that sets a players datablock indefinitely, even after respawn etc.?

So you want an event that sets a players datablock indefinitely, even after respawn etc.?
No, he wants to force a players look (like their torso color/decal, face, etc) through an event. I remember some CityRPs do this but I don't know how.

%player.setNodeColor(colour,node) iirc, as well as using setNode(shape,node) to give them the specific body/arm/leg/hand/hat but I forget the face/shirt, I'd try setDecal and setFace. Your best bet though is to dump a player object to see what the specifics are.

%player.setNodeColor(colour,node) iirc, as well as using setNode(shape,node) to give them the specific body/arm/leg/hand/hat but I forget the face/shirt, I'd try setDecal and setFace. Your best bet though is to dump a player object to see what the specifics are.
No. I'd suggest setting the color and other variables on the client(dump a client to see them all) and calling gamingConnection::applyBodyParts(); and gameConnection::applyBodyColors();
Then package the server commands that the clients calls to update their avatar and prevent it from going through.
« Last Edit: January 21, 2015, 05:06:30 PM by jes00 »

as well as using setNode(shape,node) to give them the specific body/arm/leg/hand/hat but I forget the face/shirt, I'd try setDecal and setFace.

You're looking for Player::hideNode( string node ) and Player::unHideNode( string node ) for toggling nodes, then Player::setFaceName( string faceName ) where faceName is the name of the image without the path or file type and finally Player::setDecalName( string decalName ) where decalName follows the same rules as faceName.

However, jes00 has it right. You should use the client variables and GameConncetion::applyBodyParts() and GameConnection::applyBodyColors() to update the look of clients unless you only want a temporary change to them.

Ok I just got back after about two days and slept, AND I had completely forgotten about this topic!

No. I'd suggest setting the color and other variables on the client(dump a client to see them all) and calling gamingConnection::applyBodyParts(); and gameConnection::applyBodyColors();
Then package the server commands that the clients calls to update their avatar and prevent it from going through.
Ok so can you give me an example of that?
No, he wants to force a players look (like their torso color/decal, face, etc) through an event. I remember some CityRPs do this but I don't know how.
This guy is right.

Now all I need is how to change decals/faces, and also like, pack.