Page 1 of 1

SetAppearance

PostPosted: Thu Dec 01, 2005 9:16 am
Author: Gurky_Bogglewig
Can this function be stored in an item and used on NPCs and PCs in a module? Also, will it persist after rest / a server reset ?

I assume so, unless the changeling scripts use a different function.

PostPosted: Thu Dec 01, 2005 9:23 am
Author: p0m
I think it is possible to bind the Special Use: Self to setcreaterappearance().

There is a const I believe for appearance type, so it possibly may survive a reset.

Just for reference Gurky:
http://www.nwnlexicon.com/compiled/func ... etype.html
http://www.nwnlexicon.com/compiled/cons ... _type.html
http://www.nwnlexicon.com/compiled/func ... etype.html

PostPosted: Wed Apr 12, 2006 1:27 pm
Author: IceThorn
I've been trying to save the PC's original appearance so as not to leave them permanently dorked. It's for a spell, and it works fine - unless they cast the spell a 2nd time while the 1st is still in effect making the 2nd appearance the "original." So trying different variables for storage. I'll let you know how it goes (once I get my test mod working again).

PostPosted: Wed Apr 12, 2006 2:25 pm
Author: Heed
Get the function to check for an original appearance variable before changing it.

i.e.

if (GetLocalString(OBJECT_SELF, "SHS_ORIG_APPEAR") == "")
{
SetLocalString(OBJECT_SELF, "SHS_ORIG_APPEAR", IntToString(GetAppearanceType(OBJECT_SELF)));
}

Don't want to use ints since appearance type can be 0.

Unless I'm misunderstanding what you're after.

@Gurky: Yes, it should persist -- the appearance type is written out to the players .bic file anytime it's saved (manually or on exit). Weird crashes or bad lag might mess with it, but you could say that of any function.

PostPosted: Wed Apr 12, 2006 3:06 pm
Author: IceThorn
Heed wrote:Get the function to check for an original appearance variable before changing it.

i.e.

if (GetLocalString(OBJECT_SELF, "SHS_ORIG_APPEAR") == "")
{
SetLocalString(OBJECT_SELF, "SHS_ORIG_APPEAR", IntToString(GetAppearanceType(OBJECT_SELF)));
}

Don't want to use ints since appearance type can be 0.

Unless I'm misunderstanding what you're after.


Yea, that's better. I was using ints. Thanks.

PostPosted: Mon Apr 17, 2006 1:18 pm
Author: IceThorn
I used Heed’s code above for the appearance (strings instead of ints), and it works great. But it doesn’t revert to the original, no matter what, until the duration has elapsed. So dispel, resting, etc. doesn’t revert the appearance. I’m guessing that a line could be added to all the dispels for that, but isn’t the resting hard coded? Not sure if it’s worth the trouble.

PostPosted: Mon Apr 17, 2006 1:38 pm
Author: Heed
IceThorn wrote:I used Heed’s code above for the appearance (strings instead of ints), and it works great. But it doesn’t revert to the original, no matter what, until the duration has elapsed. So dispel, resting, etc. doesn’t revert the appearance. I’m guessing that a line could be added to all the dispels for that, but isn’t the resting hard coded? Not sure if it’s worth the trouble.


Are you applying the effect as a supernatural one? Make sure you use a magical type effect if you want it to behave like spell effects do.

EDIT: Ah, nevermind. You're using SetCreatureAppearanceType() which isn't an effect.