Difference between revisions of "GetActorType"
Byline removed
imported>GBHis |
imported>QQuix (Byline removed) |
||
(20 intermediate revisions by 8 users not shown) | |||
Line 1: | Line 1: | ||
This isn't a function, but a work-around to get an actor's "type". | |||
This isn't a function, but a work-around to get an actor's "type". | |||
<pre> | |||
short GAT ; GetActorType | |||
set GAT to (GetIsCreature *8)+(getIsGhost)+(getVampire *2)+IsActor+(isEssential *4)-1</pre> | |||
This returns the following values: | |||
<pre> | <pre> | ||
-1 - Not an actor | |||
0 - NPC | |||
1 - NPC Ghost | |||
2 - NPC vampire | |||
3 - NPC Ghost AND Vampire | |||
4 - Essential NPC | |||
5 - Essential NPC Ghost | |||
6 - Essential NPC Vampire | |||
7 - Essential NPC Ghost AND Vampire | |||
8 - Creature | |||
9 - Creature Ghost (creatures considered ghost by the game-engine). | |||
10 - Creature Vampire | |||
11 - Creature Ghost AND Vampire | |||
</pre> | |||
Note that "Ghost" refers to creatures and NPCs who are affected by the [[SetGhost]] function. Ordinarily, a creature like a wraith will return 2 for "Creature", not "Creature Ghost." | |||
[[Category:Solutions]] | |||
[[Category:Useful_Code]] |