GetAnimalCompanionCreatureType

From NWN Lexicon
Jump to navigationJump to search



GetAnimalCompanionCreatureType(object)

Get a creature's animal companion creature type.

Parameters

oCreature

PC or NPC that may have an animal companion


Description

Returns oCreature's animal companion creature type (ANIMAL_COMPANION_CREATURE_TYPE_*).
Returns ANIMAL_COMPANION_CREATURE_TYPE_NONE if oCreature is invalid or does not currently have an animal companion.



Remarks

Returns no information for summoned creatures. Note that an animal companion is different from a animal companion.

This function returns the type of animal companion that can be summoned, not the type of animal companion that is currently summoned, so you can't use this to determine if an animal companion has been summoned or not.

If oCreature is possessing the animal companion when this function is called, it will return ANIMAL_COMPANION_CREATURE_TYPE_NONE. Presumably this is because a possessed animal companion can't summon an animal companion.


Known Bugs

This function returns 0 (ANIMAL_COMPANION_CREATURE_TYPE_BADGER) instead of 255 (ANIMAL_COMPANION_CREATURE_TYPE_NONE) if oCreature does not have an animal companion at all. If the goal is to check if oCreature could summon an animal companion, GetHasFeat(FEAT_ANIMAL_COMPANION, oCreature) may be a more reliable check.


Version

1.61

See Also

functions: 

SummonAnimalCompanion, GetAnimalCompanionName

constants: 

ANIMAL_COMPANION_CREATURE_TYPE_* Constants



 author: Charles Feduke, editor: Jody Fletcher, additional contributor(s): Jody Fletcher, Gene Koo, Don Allman