Difference between revisions of "GetPhenoType"

From NWN Lexicon
Jump to: navigation, search
 
Line 8: Line 8:
  
 
<nwscript>
 
<nwscript>
[[int | int ]] GetPhenoType(
+
int GetPhenoType(
    [[object | object ]] oCreature
+
    object oCreature
);
+
);
 
</nwscript>
 
</nwscript>
  
Line 40: Line 40:
  
 
<nwscript>
 
<nwscript>
// If the PC's phenotype is big, we comment on it, in a conversation
+
// If the PC's phenotype is big, we comment on it, in a conversation
+
 
void main()
+
void main()
{
+
{
    // PC speaker
+
    // PC speaker
    object oPC = GetPCSpeaker();
+
    object oPC = GetPCSpeaker();
+
 
    if(GetPhenoType(oPC) == PHENOTYPE_BIG)
+
    if(GetPhenoType(oPC) == PHENOTYPE_BIG)
    {
+
    {
        // Comment on it dramatically and respectfully, as a Halfling might
+
        // Comment on it dramatically and respectfully, as a Halfling might
        SpeakString("oooh, we got a well-fed kind of a person here, ain't we!");
+
        SpeakString("oooh, we got a well-fed kind of a person here, ain't we!");
    }
+
    }
}
+
}
 
</nwscript>
 
</nwscript>
  

Latest revision as of 01:31, 26 August 2012



GetPhenoType(object)

Returns the creature's currently set PhenoType (body type).

int GetPhenoType(
    object oCreature
);

Parameters

oCreature

The creature to check the phenotype of


Description

This will return the creature's currently set PhenoType (body type).

The valid constants are PHENOTYPE_BIG, PHENOTYPE_NORMAL, and PHENOTYPE_CUSTOM.



Remarks

Note that a phenotype is only valid for the default 7 PC races (Dwarf, Human, Half Elf, Half Orc, Elf, Gnome and Halfling).

It is basically the "Fat/Thin" option given when you create your character, however, custom content creators can have a better and more varied use for it as there will no doubt be.


Version

1.64

Example

// If the PC's phenotype is big, we comment on it, in a conversation
 
void main()
{
    // PC speaker
    object oPC = GetPCSpeaker();
 
    if(GetPhenoType(oPC) == PHENOTYPE_BIG)
    {
        // Comment on it dramatically and respectfully, as a Halfling might
        SpeakString("oooh, we got a well-fed kind of a person here, ain't we!");
    }
}

See Also

functions: 

SetPhenoType

constants: 

PHENOTYPE_* Constants



 author: Jasperre, additional contributor(s): Jasperre