Difference between revisions of "P hpstat V3"
From Unofficial QEdit Wiki Guide
Pheonixmog (Talk | contribs) (Created page with "==Syntax== ''Syntax:'' <span style='font-size:12px;font-family:courier'><span style='color:red'>p_hpstat_v3 </span>register, xxxxxxxx</span> * ''register'' = Register for op...") |
Pheonixmog (Talk | contribs) (→Also see) |
||
(6 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
''Syntax:'' <span style='font-size:12px;font-family:courier'><span style='color:red'>p_hpstat_v3 </span>register, xxxxxxxx</span> | ''Syntax:'' <span style='font-size:12px;font-family:courier'><span style='color:red'>p_hpstat_v3 </span>register, xxxxxxxx</span> | ||
− | * ''register'' = Register for | + | * ''register'' = Register for OPCode to use. |
* ''xxxxxxxx'' = xxxxxxxx player slot (0-3). | * ''xxxxxxxx'' = xxxxxxxx player slot (0-3). | ||
Line 8: | Line 8: | ||
==Use== | ==Use== | ||
Uses a register to read a character's HP value. The register input will measure: (maximum HP / value) and output 00000000 if current HP is greater than (maximum HP / value), 00000001 if less than. | Uses a register to read a character's HP value. The register input will measure: (maximum HP / value) and output 00000000 if current HP is greater than (maximum HP / value), 00000001 if less than. | ||
+ | |||
+ | Note: The output of this OPCode overwrites the input in the same register. | ||
==Example== | ==Example== | ||
Line 15: | Line 17: | ||
<span style='color:red'> p_hpstat_v3 </span>R1, 00000000 <span style='color:orange'>//Player 1's current HP will be tracked until below 25% maximum HP.</span> | <span style='color:red'> p_hpstat_v3 </span>R1, 00000000 <span style='color:orange'>//Player 1's current HP will be tracked until below 25% maximum HP.</span> | ||
<span style='color:green'> jmpi_= </span> R1, 1, 101 | <span style='color:green'> jmpi_= </span> R1, 1, 101 | ||
− | <span style='color:green'> jmp </span> 100 | + | <span style='color:green'> jmp </span>100 |
<span style='color:blue'>101: </span><span style='color:green'>window_msg </span>'You are at low health.' | <span style='color:blue'>101: </span><span style='color:green'>window_msg </span>'You are at low health.' | ||
<span style='color:green'> winend </span> | <span style='color:green'> winend </span> | ||
Line 22: | Line 24: | ||
==Also see== | ==Also see== | ||
− | [[ | + | [[p_dead_V3]], [[get_player_hp]], [[pl_pkon]] |
Latest revision as of 04:05, 20 January 2022
Contents
Syntax
Syntax: p_hpstat_v3 register, xxxxxxxx
- register = Register for OPCode to use.
- xxxxxxxx = xxxxxxxx player slot (0-3).
Use
Uses a register to read a character's HP value. The register input will measure: (maximum HP / value) and output 00000000 if current HP is greater than (maximum HP / value), 00000001 if less than.
Note: The output of this OPCode overwrites the input in the same register.
Example
100: sync
leti R1, 00000004
p_hpstat_v3 R1, 00000000 //Player 1's current HP will be tracked until below 25% maximum HP.
jmpi_= R1, 1, 101
jmp 100
101: window_msg 'You are at low health.'
winend
ret