GetLastPerceptionSeen()

Determines if the last perceived object was seen.

int GetLastPerceptionSeen();

Description

Use this in an OnPerception script to determine whether the object that was perceived was seen.

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



Version

1.29

Example

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

See Also

functions: GetCanSeePC
categories: Perception Functions


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