CheckReloadEx: Difference between revisions
From Eternity Wiki
Jump to navigationJump to search
(Created page with '{{codepointer|description= '''CheckReloadEx''' is an extended version of '''JumpIfNoAmmo''' that can compare against flexible values rather than assuming weapon's ammo per sh…') |
No edit summary |
||
Line 1: | Line 1: | ||
{{codepointer|description= | {{codepointer|description= | ||
'''CheckReloadEx''' is | '''CheckReloadEx''' is a weapon scripting function that compares the current ammo with a value or a counter and jumps to another state if the test passes.|usage= | ||
'''CheckReloadEx'''(''state'', ''checktype'', ''value'', ''psprnum'')|parameters= | '''CheckReloadEx'''(''state'', ''checktype'', ''value'', ''psprnum'')|parameters= | ||
*''state'': state to jump to if test | *''state'': state to jump to if test passes | ||
*''checktype'': test to perform. Can be one of the following: | *''checktype'': test to perform. Can be one of the following: | ||
**'''less''' or 0 | **'''less''' or 0 |
Revision as of 18:38, 6 May 2011
Description
CheckReloadEx is a weapon scripting function that compares the current ammo with a value or a counter and jumps to another state if the test passes.
Usage
CheckReloadEx(state, checktype, value, psprnum)
Parameters
- state: state to jump to if test passes
- checktype: test to perform. Can be one of the following:
- less or 0
- lessorequal or 1
- greater or 2
- greaterorequal or 3
- equal or 4
- notequal or 5
- and or 6
- less_counter or 7
- lessorequal_counter or 8
- greater_counter or 9
- greaterorequal_counter or 10
- equal_counter or 11
- notequal_counter or 12
- and_counter or 13
- value: immediate value OR counter number to compare against
- psprnum: psprite to affect (weapon or flash). Can be one of the following:
- weapon or 0
- flash or 1
Examples
No examples given.
Notes
The object of comparison is player's current ammo, either to an immediate value (if checktype is between 0 and 6) or to a weapon counter (if checktype is between 7 and 13). Only 3 counters (0, 1, 2) are available per player weapon. If the comparison test passes, the current player gun frame is switched to the one designated by state.
The psprnum field selects which one of the two types of Doom gun sprites to use: main weapon sprite, or the superimposed gunflash sprite.