Difference between revisions of "P hpstat V3"

From Unofficial QEdit Wiki Guide
Jump to: navigation, search
(Use)
(Also see)
 
(4 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 op code to use.
+
* ''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.
 
Note: The output of this OPCode overwrites the input in the same register.
  
Line 23: Line 24:
  
 
==Also see==
 
==Also see==
[[get_slotnumber]], [[ret]] [[reservedregisters]]
+
[[p_dead_V3]], [[get_player_hp]], [[pl_pkon]]

Latest revision as of 04:05, 20 January 2022

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 

Also see

p_dead_V3, get_player_hp, pl_pkon