ReFire: Difference between revisions

From Eternity Wiki
Jump to navigationJump to search
(Initial commit.)
 
No edit summary
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
'''ReFire''' is a player weapon codepointer used to check for refiring at the end of a weapon's attack sequence. If the player is holding down the fire key, the weapon will try to fire again without entering the weapon's ready state first. This pointer increments or clears the player's refire counter, which when positive, causes the player's aim to become less accurate with some weapons. Remaining ammo is also checked, and if the player does not have enough ammo to fire another shot, the weapon will be lowered.
{{codepointer|description='''ReFire''' is a player weapon codepointer used to check for refiring at the end of a weapon's attack sequence. If the player is holding down the fire key, the weapon will try to fire again without entering the weapon's ready state first.|usage='''ReFire'''
|notes=The most obvious example is the plasma rifle's cooldown animation, which only gets visible when player releases fire. Otherwise, the raised barrel frame, which has '''ReFire''', jumps instantly to the first attack frame when fire is held.


[[Category:Codepointers]]
This pointer increments or clears the player's refire counter, which when positive, causes the player's aim to become less accurate with some weapons. This applies to the pistol, chaingun, elven wand and dragon claw, all of which pass through '''ReFire''', which reduces the accuracy for the next shots.
 
Remaining ammo is also checked, and if the player does not have enough ammo to fire another shot, the weapon will be lowered (note that the Doom 2 SSG uses a different, unrelated approach to check ammo: [[CheckReload]]).
 
Omitting this codepointer is unusual (all default game weapons call this at or near the end of their attack sequences), but is acceptable. Beware, as mentioned in the previous paragraph, that omitting this is going to make some gunshot attacks always accurate (but this is unrecommended, since you can just use [[FireCustomBullets]] with "always" accuracy). More interestingly, omitting it can be combined with the '''NOAUTOFIRE''' [[weaponinfo]] flag to prevent the weapon from firing again when holding the attack command.
|examples={{example|description=From base\frames.edf:|code=<nowiki>frame S_PLASMA2      { cmp = "PLSG|1|*|20|ReFire    |S_PLASMA";    dehackednum = 78 }</nowiki>}}}}

Latest revision as of 03:32, 17 April 2020

Description

ReFire is a player weapon codepointer used to check for refiring at the end of a weapon's attack sequence. If the player is holding down the fire key, the weapon will try to fire again without entering the weapon's ready state first.

Usage

ReFire

Parameters

No parameters.

Examples

From base\frames.edf:

frame S_PLASMA2      { cmp = "PLSG|1|*|20|ReFire     |S_PLASMA";    dehackednum = 78 }

Notes

The most obvious example is the plasma rifle's cooldown animation, which only gets visible when player releases fire. Otherwise, the raised barrel frame, which has ReFire, jumps instantly to the first attack frame when fire is held.

This pointer increments or clears the player's refire counter, which when positive, causes the player's aim to become less accurate with some weapons. This applies to the pistol, chaingun, elven wand and dragon claw, all of which pass through ReFire, which reduces the accuracy for the next shots.

Remaining ammo is also checked, and if the player does not have enough ammo to fire another shot, the weapon will be lowered (note that the Doom 2 SSG uses a different, unrelated approach to check ammo: CheckReload).

Omitting this codepointer is unusual (all default game weapons call this at or near the end of their attack sequences), but is acceptable. Beware, as mentioned in the previous paragraph, that omitting this is going to make some gunshot attacks always accurate (but this is unrecommended, since you can just use FireCustomBullets with "always" accuracy). More interestingly, omitting it can be combined with the NOAUTOFIRE weaponinfo flag to prevent the weapon from firing again when holding the attack command.

See also