GSC reference › Built-in
CanThrowGrenadePos()
Built-in (engine)
Server
AI Called on: actor
Checks whether the actor can throw a grenade at a given position. If he can't then result will be undefined, otherwise the result is the resultant velocity vector
Signature
<actor> CanThrowGrenadePos(<hand offset>, <targetpos>)
Called on an entity: actor CanThrowGrenadePos(...)
Parameters
| Name | Required? | Details |
|---|---|---|
| hand offset | Required | (vector) the estimated offset of the hand for the throw |
| targetpos | Required | (vector) The target position, should be at ground level of potential target |
Example (from Treyarch's docs)
throwvel = self CanThrowGrenadePos( armOffset, targetPos )
Real uses in BO3's scripts
Called 2 times in the decompiled scripts. A few, zombies first:
- scripts/shared/ai/archetype_human_cover.gsc, line 143
throw_vel = behaviortreeentity canthrowgrenadepos(arm_offset, behaviortreeentity lastknownpos(behaviortreeentity.enemy)); - scripts/shared/ai/archetype_notetracks.gsc, line 346
throw_vel = animationentity canthrowgrenadepos(arm_offset, animationentity.grenadethrowposition);
Related built-ins
- CheckGrenadeThrowPos()Checks whether the actor can throw a grenade at a given position.
- GrenadeThrow()Throw a grenade.
- aithrowgrenade()Throw a grenade.
- CanThrowGrenade()Checks whether the actor can throw a grenade at a given position.
- CheckGrenadeThrow()Checks whether the actor can throw a grenade at his target.
- IsGrenadePosSafe()Checks a grenade throw target position is safe.
- IsThrowingGrenade()Returns true if the player is currently throwing a grenade
- ForceGrenadeThrow()Forces the player to throw a held grenade
- setgoalpos()Set this AI 's goal.
- UsePosition()Override where the actor should run to.
- LastKnownPos()Return the last known pos of an AI.
- CalcApproximatePathToPosition()Returns an array of world positions representing the approximate path an actor will take.
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).