P hpstat V3

From Unofficial QEdit Wiki Guide
Jump to: navigation, search

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