GetLastPerceptionSeen

From NWN Lexicon



Contents

[edit] GetLastPerceptionSeen()

Determines whether the current perception event was triggered by the last perceived object entering the caller's view.

[edit] Description

Use this in an OnPerception script to determine whether the current perception event was triggered by the Seen state changing from FALSE to TRUE.

Returns TRUE if the last perceived object was seen, otherwise FALSE.



[edit] Version

1.29

[edit] Example

// OnPerception script that attacks a perceived enemy 
void main()
{
     object oNoticed = GetLastPerceived();
     if(GetIsObjectValid(oNoticed))
     {
          if (GetLastPerceptionSeen() && GetIsEnemy(oNoticed))
          {
               ClearAllActions();
               ActionAttack(oNoticed);
          }
     }
}

[edit] See Also

functions: 

GetCanSeePC



 author: Tom Cassiotis, editor: Charles Feduke, additional contributor(s): Alex Meduna
 

Personal tools
Categories