Aller au contenu

Photo

Can an NPC detect what form the PC has taken...


  • Veuillez vous connecter pour répondre
20 réponses à ce sujet

#1
NullthraB

NullthraB
  • Members
  • 43 messages
hello,
Can an NPC detect what form/polymorph the pc has taken without using varibles?

I've got a bunch of scripts that allows the player to change his/her form and also to polymorph. It is a rather simple script that uses a conversation to change "set appearance" of the player.

Is there a way to call up and check what "set appearance" the pc currently has choosen? Cause I think that would solve the issue.

I'm not very good with scripting so any help or advice would be great.

Also with polymorphing in the nwn 1 toolset if you poly the pc into the red dragon would he/she be able or have fire breath ability?  I'm a bit fuzzy on polymorphing. Like if you polymorphed turned into a fish would you die out of water?
Say you poly into a red dragon, you'd get the HPoints and base attacks but not the fire breath or ability to fly?

Any suggestions?

thanks,
nb

#2
NullthraB

NullthraB
  • Members
  • 43 messages
hello,
Another issue that I'm having with this change self script is that when the player loads a saved game he/she is reverted back to their original player appearance, the appearance they selected when creating their character. I was able to work around it but it does require the player to reset his/her normal appearance.

So, I'm happy with the way things are now but am still curious if there's a better way of doing this.

Any suggestions?

thanks,
nb

#3
FunkySwerve

FunkySwerve
  • Members
  • 1 308 messages
// returns the appearance type of the specified creature.
// * returns a constant APPEARANCE_TYPE_* for valid creatures
// * returns APPEARANCE_TYPE_INVALID for non creatures/invalid creatures
int GetAppearanceType(object oCreature)

If you still have questions, I can elaborate when I get back from my swim.

Funky

Modifié par FunkySwerve, 10 juillet 2011 - 04:31 .


#4
NullthraB

NullthraB
  • Members
  • 43 messages
hello,
I will have more questions on this for sure so thank you in advance.

Basically without using any set local int variables on the pc who has changed "set" his/her appearance to (blank), what I'd like is a simple "text appears" starting condition that I could place into conversations that would pop up first. These start conditions would be based on the players current set appearance type but in a reversed way. So only one type of set appearance would work and all other appearances would return negative reactions. IS that possible to call on solely based on the players current set appearance? If the int GetAppearanceType(object oCreature) is where you're heading that would be great, however because I don't really know that much about scripting I'm still not sure exactly what that means or how to call on it. For Conversations this one.

Another issue that I'd be interested in and need help with would be set on a hostile NPC or creatures OnHeartbeat script that would check the PC's set appearance and return a non hostile reaction (no attack on sight) if the set appearance met to that NPC's liking. The npc would still be hostile.

Example: PC sets appearance to goblin then enters a den of hostile goblins but the goblins don't react to him at all because of the newly set goblin disguise, unless the player changed right in front of them of course. Also I'd need to figure out a way for the pc to start a conversation with the hostile goblins if I were to use this kind of script. I'm sure I could come up with with a hidden speaker or a triggered event but I think it would feel funny if you couldn't talk to them while in disguise. Not sure on this either.

I could be grasping at straws with this one. Seems too complicated.

Any other suggestions?

thanks,
nb

#5
FunkySwerve

FunkySwerve
  • Members
  • 1 308 messages
Before delving into your questions about conversations, is there a reason you're using SetAppearance instead of Polymorphing? To answer your questions about polymorphing, yes, players can get some abilities from the form they shift into - this is controlled by the polymorph.2da. You can view 2das (and export them to text )with programs like NWN Explorer

Looking at the first few lines of polymorph 2da, it doesn't look like the Shapechange version of the red dragon polymorph gets any breathing or other abilities:
2DA V2.0

       Name                                      AppearanceType    RacialType    PortraitId    Portrait          CreatureWeapon1     CreatureWeapon2     CreatureWeapon3     HideItem            EQUIPPED          STR     CON     DEX     NATURALACBONUS    HPBONUS    SoundSet    SPELL1    SPELL2    SPELL3    MergeW    MergeI    MergeA
0      POLYMORPH_TYPE_WEREWOLF                   171               23            316           po_werewolf       nw_it_crewpsp002    nw_it_crewpsp002    nw_it_crewps005     nw_it_creitem018    ****              18      ****    18      5                 ****       ****        ****      ****      ****      ****      ****      ****  
1      POLYMORPH_TYPE_WERERAT                    170               23            315           po_wererat        ****                ****                nw_it_crewps002     nw_it_creitem018    ****              16      ****    22      5                 ****       ****        ****      ****      ****      ****      ****      ****  
2      POLYMORPH_TYPE_WERECAT                    99                23            314           po_werecat        nw_it_crewpsp010    nw_it_crewpsp010    nw_it_crewps015     nw_it_creitem018    ****              20      ****    20      5                 ****       ****        ****      ****      ****      ****      ****      ****  
3      POLYMORPH_TYPE_POLYSELF_GIANT_SPIDER      159               25            301           po_spidgiant      ****                ****                nw_it_crewps018     nw_it_polyhid001    ****              19      ****    17      5                 ****       ****        ****      ****      ****      ****      ****      ****  
4      POLYMORPH_TYPE_POLYSELF_TROLL             167               18            306           po_troll          nw_it_crewpsp005    nw_it_crewpsp005    nw_it_crewps005     nw_it_polyhid002    ****              23      ****    14      5                 ****       ****        ****      ****      ****      ****      ****      ****  
5      POLYMORPH_TYPE_POLYSELF_UMBER_HULK        168               7             309           po_umberhulk      nw_it_crewpsp006    nw_it_crewpsp006    nw_it_crewps017     nw_it_polyhid003    ****              23      ****    15      7                 ****       ****        ****      ****      ****      ****      ****      ****  
6      POLYMORPH_TYPE_POLYSELF_PIXIE             55                17            559           po_fairy          nw_it_crewpsp026    nw_it_crewpsp026    ****                nw_it_polyhid004    ****              10      ****    24      5                 ****       ****        ****      ****      ****      ****      ****      ****  
7      POLYMORPH_TYPE_POLYSELF_ZOMBIE            198               24            354           po_zo_rot01       nw_it_crewpb005     ****                ****                nw_it_polyhid005    ****              14      ****    14      ****              ****       ****        ****      ****      ****      ****      ****      ****  
8      POLYMORPH_TYPE_SHAPECHANGE_RED_DRAGON     49                11            198           po_drgred         nw_it_crewpsp015    nw_it_crewpsp015    nw_it_crewps017     nw_it_creitemdrm    ****              36      ****    30      10                ****       ****        ****      ****      ****      ****      ****      ****  



By contrast, the shifter form does get spell 239, or Dragon_Breath_Fire (looking in the spells.2da).

72     POLYMORPH_TYPE_DRAGON_RED                 1670              11            198           po_drgred         nw_it_crewpsp027    nw_it_crewpsp027    nw_it_crewps017     x2_it_emptyskin     ****              48      ****    36      0                 ****       29          239       ****      ****      ****      ****      ****  


If you used polymorphs instead of appearances, you would scan for polymorph effects and check type, instead of looking at appearances.

Funky

#6
FunkySwerve

FunkySwerve
  • Members
  • 1 308 messages
Sorry, these forums are atrocius for posting 2das in (and code in general, really). Have a look in NWN Explorer for a clearer idea of what I'm talking about. Can't even see the columns in that mess.

Funky

#7
La Rose Noire

La Rose Noire
  • Members
  • 25 messages
Appearance is an integer. Store it on the PC when polymorphing him si you can use it in NPC OnPerception script.

#8
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages

La Rose Noire wrote...

Appearance is an integer. Store it on the PC when polymorphing him si you can use it in NPC OnPerception script.



NullthraB wrote...

hello,
Can an NPC detect what form/polymorph the pc has taken without using varibles?




#9
Baragg

Baragg
  • Members
  • 271 messages
Just to throw in my two cents worth usually when a PC is polyed they receive a skin with that change you could check the skin tag to determine what form they have polyed into. So in the case of appearance change check their appearnce type, and poly check the tag of their skin.

Modifié par Baragg, 10 juillet 2011 - 11:07 .


#10
NullthraB

NullthraB
  • Members
  • 43 messages
hey folks,
thanks for the input however i think i'm more confused now because I'm not good at scripting stuff.
L.Souls Sc.Gen does not have a text appears function for checking what Appearance the player currently has placed. And i could not create it by my self.
Also all of my change self scripts were created by LS SGen.

Set polymorph type is very limited using nwn 1.69 basic. However setting the appearance type had many more options. So what I did was a little of both.

I've got an PC who can, over a period of time learn to change his/her appearance via poly and set appearance. Using nwn 1 toolset 1.69 I've selected the Type and Poly for the player using a conversation which uses simple script to change the Appearance or Poly type of the player.

My question is.....
Can you script/create a script for me that I can use via a conversation that will be able to tell (Text Appears) when and based on the players current set Appearance that will fire when he/she enters a conversation with said NPC.

Example: Player is a goblin
player uses item to change into a human
when he meets a human...that humans conversation file fires saying this another human and I should speak to him like a brother. different responses based on the goblins other appearance would arise if the goblin was not looking like a human.

I think that is the simplest way to do it.
But...



so the goblin appears as a human and the human treats him as a fellow human (text appears OPC is set to human appearance).

If opc (goblin) looks like a wolf or pixie the humans conversation will reflect a reaction based on a simple text appears script.

I'd like to just stay focused on the text appears starting condition for now.

Note: all set appearance scripts are simple and were created using LS S Gen. SO I need a very simple Text appears script that lets the conversation file know which appearance the pc currectly has set.

thank you,
nb

#11
NullthraB

NullthraB
  • Members
  • 43 messages

Modifié par NullthraB, 11 juillet 2011 - 07:13 .


#12
NullthraB

NullthraB
  • Members
  • 43 messages
pls help script this for me

L Souls script gen does not have or use this type of text appears condition therefore I can't create it on my own

I need some help with this one. :(

// For a starting condition text appears within a
// Conversation that checks the players
// set appearance and returns ture. If player is this
// appearance than start this conversation line.

void main
{
int oPC GetAppearanceType_GOBLIN_B
}


This is a start, I'll need to do this.
thank you,
:innocent:

Modifié par NullthraB, 11 juillet 2011 - 07:12 .


#13
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages
int StartingConditional()
{
    int nAppearance = GetAppearanceType(GetPCSpeaker());
    int iResult =
      (
           nAppearance == APPEARANCE_TYPE_GOBLIN_A
         ||nAppearance == APPEARANCE_TYPE_GOBLIN_B
         ||nAppearance == APPEARANCE_TYPE_GOBLIN_CHIEF_A
         ||nAppearance == APPEARANCE_TYPE_GOBLIN_CHIEF_B
         ||nAppearance == APPEARANCE_TYPE_GOBLIN_SHAMAN_A
         ||nAppearance == APPEARANCE_TYPE_GOBLIN_SHAMAN_B
       );
    return iResult;
}

#14
NullthraB

NullthraB
  • Members
  • 43 messages
Thanks Lightfoot8,
The script compiled without any errors and I'll be testing it out over the week.

Thanks again,
nb

#15
NullthraB

NullthraB
  • Members
  • 43 messages
Hi,
To: Litfoot8,
The script doesn't do what I'm looking for.

To: Funky
Polymorph was missing some Appearance Types I wanted to use.

I'm looking for 2 text appears starting condition scripts for conversations, that uses the PC's currect set Appearance and or Ploymorph TYPE_(.....) as a text node Appears starting variable.

//Looks for Appearance 


//Looks for Polymorph


Is this possible...help?

TY,
nb

#16
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages
I just tested the script. to make sure That it does what I thought it does. It worked correctly for me.

It returned true if the PC had any of the goblin appearance types. It will work for polymoph also. It does not matter how the appearance was set.

#17
NullthraB

NullthraB
  • Members
  • 43 messages
One other note: and question
the player can set his appearance many times as he can also take on many new forms. If the set appearance changes many times will only the most current set appearance be the starting condition?
Or will an older set appearance prevent the starting condition from seeing the newest set appearance?

I also need a simple script that checks for a single set appearance type. All are starting conditions for conversations.

thanks everyone,
really need some help with this one.

#18
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages

NullthraB wrote...

One other note: and question
the player can set his appearance many times as he can also take on many new forms. If the set appearance changes many times will only the most current set appearance be the starting condition?
Or will an older set appearance prevent the starting condition from seeing the newest set appearance?

The PC object only has one entree in its structure for the appearance type.  So it does not matter how many times you set the appearance, the GetAppearanceType function will retrive the appearance that the PC is currently using.



I also need a simple script that checks for a single set appearance type. All are starting conditions for conversations.


 int StartingConditional()
{
    int nAppearance = GetAppearanceType(GetPCSpeaker());
    return nAppearance == APPEARANCE_TYPE_GOBLIN_A;
}




for your request to see if a PC is polymorphed you can use this from the statring condition.

#include "nw_i0_generic"
int StartingConditional()
{
    object oPC=GetPCSpeaker();
    return GetHasEffect(EFFECT_TYPE_POLYMORPH,oPC);
}

#19
NullthraB

NullthraB
  • Members
  • 43 messages
hello,
okay I'm getting very close to getting the scripts I need thanks to the help from Lightfoo8

This one works the way I need to check for a single appearance. Thank you.

Now could you please add two more Appearance Types to this script so it returns true if the player has any three of these appearances types currently set.
//Add two more App Types
int StartingConditional()
{
int nAppearance = GetAppearanceType(GetPCSpeaker());
return nAppearance == APPEARANCE_TYPE_GOBLIN_A;
}




I need this one to check for a specific polymorph type. Say giant spider for the single starting condition. Then I need another script to check for a group (three) polymorph types.

#include "nw_i0_generic"
int StartingConditional()
{
object oPC=GetPCSpeaker();
return GetHasEffect(EFFECT_TYPE_POLYMORPH,oPC);
}

After that I'll have what I need.

Thank you again for all the work.
NB

#20
GhostOfGod

GhostOfGod
  • Members
  • 863 messages
For the first part:

int StartingConditional()
{
    int nAppearance = GetAppearanceType(GetPCSpeaker());
    if (nAppearance == APPEARANCE_TYPE_GOBLIN_A ||
        nAppearance == APPEARANCE_TYPE_GOBLIN_B ||
        nAppearance == APPEARANCE_TYPE_GOBLIN_CHIEF_A) return TRUE;
    else return FALSE;
}

You can put whatever appearances you want to check for in the above.

As far as your second question gos, I'm not sure if you are understanding that when anyone is polymorphed thier "appearance" gets changed as well, so all you have to do is check for appearance like you did above (Unless of course you want it to check to make sure that the player got its current appearance only because they polymorphed):

int StartingConditional()
{
    int nAppearance = GetAppearanceType(GetPCSpeaker());
    if (nAppearance == APPEARANCE_TYPE_SPIDER_GIANT) return TRUE;
    else return FALSE;
}

Hope it helps.

#21
NullthraB

NullthraB
  • Members
  • 43 messages
hello,
okay, I was confused on polymorph appearances being used in the same way as set appearance.
Thank you.
The Scripts are working fine now.
Thanks everyone,
nb