Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: EUD unit Health Detection Problem.
EUD unit Health Detection Problem.
This topic is locked. You can no longer write replies here.
Feb 9 2009, 12:52 pm
By: Keirebu  

Feb 9 2009, 12:52 pm Keirebu Post #1



Well, I made a little test map for some EUD practice, So I made the game, found the HP address for the marine, put it in EUDTrig, got the P# And Unit ID, Made the Condition for the trigger, and set it to desplay a text message when the unit is fully healed and or at 35 hp (max 40). Here is what my triggers look like.
Code
Trigger("Player 1"){
Conditions:
    Deaths("Player 8", "UnitID:13471", Exactly, 40);

Actions:
    Display Text Message(Always Display, "Marine is at Full HP");
    Preserve Trigger();
}

//-----------------------------------------------------------------//

Trigger("Player 1"){
Conditions:
    Deaths("Player 8", "UnitID:13471", Exactly, 35);

Actions:
    Display Text Message(Always Display, "Marine is at 35 HP");
    Preserve Trigger();
}

//-----------------------------------------------------------------//

Note: I only used Trigedit to copy and paste, not to actually make them.
Marines HP Offset:0x628151
Heres the Map if you want to look at it,

Attachments:
EUDTest.scm
Hits: 3 Size: 40.45kb



None.

Feb 9 2009, 2:07 pm NudeRaider Post #2

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

I'm pretty sure you can't check for 40/35 deaths to detect 40/35 hp.
Maybe this sheds some light on it.




Feb 9 2009, 2:11 pm Elvang Post #3



Isn't health stored as a float since 0 damage or less damage done than armor present equals a 0.5 reduction to health?



None.

Feb 9 2009, 2:12 pm NudeRaider Post #4

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

The actual hp value is 2x of what you see in sc. No float.




Feb 9 2009, 2:20 pm Elvang Post #5



I changed the trigger to detect 80 and 70 deaths, and also turned off randomized start. Still didn't detect it, either your offset is wrong or the order you placed the units on the map is wrong.



None.

Feb 9 2009, 2:42 pm NudeRaider Post #6

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

if you could check for 80/70 deaths I would have said that, don't you think?
It's more complicated because sc stores it in 2-4 byte long variables, plus the regeneration information for shield/zerg hp. You should check the link I provided.




Feb 9 2009, 2:51 pm Elvang Post #7



Ah, missed your link. Multiplying the amount of health you want to check for by 256 does the trick.



None.

Feb 9 2009, 9:51 pm O)FaRTy1billion[MM] Post #8

👻 👾 👽 💪

Also you must take into account the possible values of the first byte... So (using your trigger to base this on):

Code
Trigger("Player 1"){
Conditions:                                             // X = 40
   Deaths("Player 8", "UnitID:13471", At Least, 10240); // X*256
   Deaths("Player 8", "UnitID:13471", At Most, 10495);  // (X+1)*256-1


Actions:
   Display Text Message(Always Display, "Marine is at Full HP");
   Preserve Trigger();
}

The first byte is a timer (for regen) or fractional value. The next 3 are the HP that is shown and used. Shields act the same, but are a different value.



TinyMap2 - Latest in map compression! ( 7/09/14 - New build! )
EUD Action Enabler - Lightweight EUD/EPD support! (ChaosLauncher/MPQDraft support!)
EUDDB - topic - Help out by adding your EUDs! Or Submit reference files in the References tab!
MapSketch - New image->map generator!
EUDTrig - topic - Quickly and easily convert offsets to EUDs! (extended players supported)
SC2 Map Texture Mask Importer/Exporter - Edit texture placement in an image editor!
\:farty\: This page has been viewed [img]http://farty1billion.dyndns.org/Clicky.php?img.gif[/img] times!

Feb 9 2009, 10:43 pm Keirebu Post #9



Thanks everyone, I did what you guys said, I understand it, And its really simple ^-^, Thanks for all the help guys.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[10:53 pm]
Oh_Man -- https://youtu.be/MHOZptE-_-c are yall seeing this map? it's insane
[2024-5-04. : 1:05 am]
Vrael -- I won't stand for people going around saying things like im not a total madman
[2024-5-04. : 1:05 am]
Vrael -- that's better
[2024-5-04. : 12:39 am]
NudeRaider -- can confirm, Vrael is a total madman
[2024-5-03. : 10:18 pm]
Vrael -- who says I'm not a total madman?
[2024-5-03. : 2:26 pm]
UndeadStar -- Vrael, since the ad messages get removed, you look like a total madman for someone that come late
[2024-5-02. : 1:19 pm]
Vrael -- IM GONNA MANUFACTURE SOME SPORTBALL EQUIPMENT WHERE THE SUN DONT SHINE BOY
[2024-5-02. : 1:35 am]
Ultraviolet -- Vrael
Vrael shouted: NEED SOME SPORTBALL> WE GOT YOUR SPORTBALL EQUIPMENT MANUFACTURING
Gonna put deez sportballs in your mouth
[2024-5-01. : 1:24 pm]
Vrael -- NEED SOME SPORTBALL> WE GOT YOUR SPORTBALL EQUIPMENT MANUFACTURING
[2024-4-30. : 5:08 pm]
Oh_Man -- https://youtu.be/lGxUOgfmUCQ
Please log in to shout.


Members Online: Roy