Setting the skins on NPCs

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

Moderators: Lapo, Bax

warhell
Posts: 199
Joined: 18 Aug 2007, 16:49
Location: Silicon Valley, CA
Contact:

Setting the skins on NPCs

Postby warhell » 29 Mar 2010, 19:11

Is there any way to set the Skin of an NPC on the client side without having to use extensions?
User avatar
Bax
Site Admin
Posts: 4612
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 29 Mar 2010, 20:18

How do you create the NPC?
Paolo Bax
The SmartFoxServer Team
warhell
Posts: 199
Joined: 18 Aug 2007, 16:49
Location: Silicon Valley, CA
Contact:

Postby warhell » 29 Mar 2010, 21:20

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.
User avatar
Bax
Site Admin
Posts: 4612
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 31 Mar 2010, 07:53

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)
Paolo Bax
The SmartFoxServer Team

Return to “OpenSpace v2 discussions and help”

Who is online

Users browsing this forum: No registered users and 36 guests