GSC reference › Built-in

AttackedRecently()

Built-in (engine) Server AI Called on: sentient

Returns true if given sentient has attacked the entity within last "time" sec.

Signature

<sentient> AttackedRecently(<entity>, <time>)

Called on an entity: sentient AttackedRecently(...)

Parameters

NameRequired?Details
entityRequired The enemy entity
timeRequired Time interval in seconds.

Returns

Returns true if given sentient has attacked the entity within last "time" sec.

Example (from Treyarch's docs)

self AttackedRecently(self.enemy)

Real uses in BO3's scripts

Called 3 times in the decompiled scripts. A few, zombies first:

Related built-ins

  • SeeRecently()
    Check to see if the AI saw the given sentient in the past <time>.
  • SetGoal()
    Set this AI 's goal.
  • ForceTeleport()
    Force Teleport the actor to a new position with the given origin and angles, regardless of wether it will be visible to the player or not.
  • OrientMode()
    Set the orient mode of this actor.
  • AnimMode()
    Set the way that animation deltas are interpreted by the game engine
  • PathMode()
    Set the path mode of this actor.
  • HasPath()
    Returns true/false if AI has a path
  • ClearForcedGoal()
    Clears the forcedGoal for this AI's goal.
  • setgoalpos()
    Set this AI 's goal.
  • UsePosition()
    Override where the actor should run to.
  • CanSee()
    Check to see if the AI can see the given entity.
  • GetPerfectInfo()
    Forces the AI to become aware of this entity regardless of whether it can be seen or not.

New to GSC?

Start with the basics, or paste a compile error to get the fix.

Built-in descriptions, parameters and examples come from Treyarch's BO3 mod tools docs. Usage links point at shiversoftdev/t7-source (decompiled BO3 scripts).