Change Clothing of an NPC

Announcements and discussion regarding any projects related to Cyan Worlds' Plasma Engine including (but not limited to) CyanWorlds.com Engine, Drizzle, OfflineKI, PyPRP, and libHSPlasma.

Change Clothing of an NPC

Postby Christopher » Sat Dec 17, 2011 5:56 am

I tried to spawn a global avatar (Male) as NPC. Then I wanted to change it's clothing, but it seems that the NPC has no Clothing group and so the NPC is all time a standard male avatar. I wanted to ask if it is possible to give NPCs a Clothing group, so they can be customized. It would open many new possibilities in age creation.

Christopher
User avatar
Christopher
 
Posts: 276
Joined: Mon Jul 19, 2010 3:25 am

Re: Change Clothing of an NPC

Postby D'Lanor » Sat Dec 17, 2011 11:06 am

Been there, tried it and failed. :(

I don't think it has anything to do with the clothing group though. The Male and Female avatars still retain their clothing groups when you spawn them as NPCs. With PlasmaShop I even found their clothing stored in the age state. It should be possible to change it there but I have no idea how. As you have already found out the regular methods for avatar dressing don't work on NPCs. And when I modified the clothing in the age state with PlasmaShop it made the age crash.
"It is in self-limitation that a master first shows himself." - Goethe
User avatar
D'Lanor
 
Posts: 1980
Joined: Sat Sep 29, 2007 4:24 am

Re: Change Clothing of an NPC

Postby Christopher » Sat Dec 17, 2011 12:33 pm

I made used NPC.avatar.getAvatarClothingGroup() (NPC is the sceneobject of the NPC) to get the clothing group from the avatar. The result was -1. If you use this command for an player you'll get 0 for male, 1 for female and 2 for an custom avatar. So I thought that it has no clothing group set. Maybe I should also say, that I tried this on a MOULa testing shard, not in TPOTS.

Christopher
User avatar
Christopher
 
Posts: 276
Joined: Mon Jul 19, 2010 3:25 am

Re: Change Clothing of an NPC

Postby D'Lanor » Sat Dec 17, 2011 4:29 pm

Returning the number -1 is often Plasma's way of saying "sorry, I could not find what you were looking for". None of the methods in the ptAvatar class I tried work on NPCs and that includes all the clothing stuff. If you do the check NPC.isAvatar() you'll see that it returns false. This confirms that NPCs are not true avatars and therefore the ptAvatar class does not always apply to them.

Edit: btw, if I do try to put clothing on a plain Male or Female NPC it raises an "unidentifiable C++ exception".
"It is in self-limitation that a master first shows himself." - Goethe
User avatar
D'Lanor
 
Posts: 1980
Joined: Sat Sep 29, 2007 4:24 am

Re: Change Clothing of an NPC

Postby Christopher » Sun Dec 18, 2011 3:33 am

Because of this problem, I wrote this into this forum. I hoped maybe someone can find the problem in the client and fix it...

Christopher

PS: And thank you for trying this out D'Lanor ;)
User avatar
Christopher
 
Posts: 276
Joined: Mon Jul 19, 2010 3:25 am


Return to Plasma Development

Who is online

Users browsing this forum: No registered users and 7 guests

cron