1.16.1 · Index · Add Address · Statistics · Reference · About

 ?  Address 0x0059CCB0
 ?  Player ID 19027 (Byte Offset: 00)
 ?  Version 1.16.1
 ?  Name CUnit - HP
 ?  Size 4
 ?  Length 1
 ?  SC:Remaster Supported
 ?  Description The amount of HP that a unit currently has. Value displayed in-game is divided by 256. For example, a Marine that has 40 HP in-game would have 10240 or 0x2800 HP in memory. Offset from unit index address: 0x08 Unit Index 0 HP = 0x0059CCA8 + 0x08 = 0x0059CCB0 Unit Index 1 HP = 0x00628298 + 0x08 = 0x006282A0 Unit Index 2 HP = 0x00628148 + 0x08 = 0x00628150 Example: Regenerate HP for unit at index 2 to a max of 100 HP Unit Index 2 HP = 0x00628148 + 0x08 = 0x00628150 #### Trigger Examples: ```trig Trigger("Player 1"){ Conditions: // HP is less than 100 MemoryAddr(0x628150, At most, 25599); Actions: // Add 16/256 HP MemoryAddr(0x628150, Add, 16); Preserve Trigger(); } //-----------------------------------------------------------------// Trigger("Player 1"){ Conditions: // HP is over 100 MemoryAddr(0x628150, At least, 25601); Actions: // Set to 100 HP MemoryAddr(0x628150, Set To, 25600); Preserve Trigger(); } ``` #### EPS Examples: ```eps // Get hitpoints with epd unit address const hp = dwread_epd(epd + 0x008 / 4) / 256; // Set hitpoints with epd unit address const value = 300; SetMemoryEPD(epd + 0x008 / 4, SetTo, value * 256); // Always keep HP for P1 units at 100 foreach(ptr, epd : EUDLoopPlayerUnit($P1)) { if (dwread_epd(epd + 0x008 / 4) / 256 < 100) { SetMemoryEPD(epd + 0x008 / 4, SetTo, 100 * 256); } } ```
Edit
Links: full · short · direct