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
| Name | Required? | Details |
|---|---|---|
| entity | Required | The enemy entity |
| time | Required | 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:
- scripts/shared/ai/archetype_utility.gsc, line 1729
hasattackedenemyrecently = entity attackedrecently(entity.enemy, 5); - scripts/shared/vehicles/_quadtank.gsc, line 1760
if(issentient(e_target) && e_target attackedrecently(self, 2)) - scripts/cp/gametypes/_globallogic_ui.gsc, line 79
if(ai attackedrecently(playerent, 10))
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).