Tiberian Technologies Scripts Reference Revision: 9000
Loading...
Searching...
No Matches
List of all members
JFW_Char_Weapon_Switcher Class Reference

Weapon Switch on Keyhook - Infantry Character. More...

#include <jfwweap.h>

Detailed Description

Author
jonwil

This script allows a player to swap one of their weapons for an alternative weapon by pressing a key. The original weapon will be removed from the player and they will be granted a powerup with the alternative weapon. Pressing the key again will remove the alternative weapon from them and grant them a powerup containing their original weapon.

Note
This script will not grant the original weapon to the player, it should be given to them either as their default weapon or by another script such as M00_GrantPowerup_Created.

Because the weapons are removed from the player when swapping from one to the other the ammo count is not preserved, so after swapping a weapon will have whatever amount of ammunition is specified in the powerup that granted it.

After the weapon switch has occurred the newly granted weapon will be selected as the active weapon, regardless of whether the removed weapon was active when the swap key was pressed.
Parameters
SwitchTimeThe amount of time the weapon swap takes, in seconds. During this time the player will not have either their original weapon or the alternative weapon available to them.
WeaponPowerup1The name of a powerup preset which grants the players original weapon
WeaponPowerup2The name of a powerup preset which grants the alternative weapon
KeyhookThe name of the keyhook binding to trigger the weapon swap