Setting the skins on NPCs
Setting the skins on NPCs
Is there any way to set the Skin of an NPC on the client side without having to use extensions?
bax wrote:How do you create the NPC?
I'm actually using the method explained here...
vie
wtopic.php?t=4475
Which is working so far (got the NPC to display), I'm actually abandoning my original idea and attempting to use the server-side function sendGenericMessage to recreate the skin message that users receives.
Does this seem like an applicable approach?
Edit: This is what I have in the server-side code so far...
Code: Select all
String msg = "<msg t='sys'><body action='uER' r='2'><vars><var n='_os_skin' t='s'><![CDATA[{"eye_wear":"http://127.0.0.1:4000/layer/asset_file?asset_number=2&category=eye_wear&extension=.png&t=1268678830","shoe":"http://127.0.0.1:4000/layer/asset_file?asset_number=2&category=shoe&extension=.png&t=1268679037"}]]></var></vars></body></msg>";
trace("Sending generic message");
LinkedList<Channel> list = new LinkedList<Channel>();
list.add(u.getChannel());
api.sendGenericMessage(msg, null, list);
Though, it doesn't seem to have the desire effect I want, which is for the NPC skin to change to the files I pass it in.
Does the client (turn on the SmartFoxClient debug) receives the message? Maybe you should compare it to one of the "skin change" messages received by the clients using the client-side way to set a skin.
(as a side note, I just want to suggest you to keep the skin definition less verbose, maybe using IDs for skin parts, not filenames)
(as a side note, I just want to suggest you to keep the skin definition less verbose, maybe using IDs for skin parts, not filenames)
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 44 guests