FireWeapon

From GECK
Jump to: navigation, search


A function included in the GECK for Fallout 3.

Description

FireWeapon fires a projectile from any specified reference (does NOT have to be an actor).

For example, vanilla New Vegas uses this in TrapShotgunSCRIPT to fire the trap when it is sprung, with the trap itself being an Activator.

Syntax

[help]
callingRef.FireWeapon weapon:baseForm

Example

Turret01REF.FireWeapon WeapGrenadeFrag

Reference with the EditorID of Turret01 will fire a Frag Grenade.

Notes

  • The fired projectile should spawn in the middle of the ref and go straight out in the direction the ref is pointing, UNLESS it has a dummy node called "ProjectileNode" (the name is dependent on the weapon's data in the editor but "ProjectileNode" is the default). If the ref has such a node the projectile will come out of it instead.
  • If called on the player, and the player's currently-equipped weapon uses ammo, FireWeapon will expend one shot's worth. FireWeapon will also use the spread of any equipped weapon instead of the spread of the firing weapon.
  • If called on the player, and the fired weapon is a Grenade-type weapon with Ammo Use set to 1, the player's weapon art will vanish. It'll reappear after unequipping and reequipping.
  • If the weapon has an enchantment or an OnHit block, it will not take effect.

See Also