Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: detect local ID's unit health?
detect local ID's unit health?
Jul 2 2008, 4:48 pm
By: Maps  

Jul 2 2008, 4:48 pm Maps Post #1



i'm not speak English well, so please understand my English skills, vocabulary and grammar.


I can't find local unit's health EUD.
I can't suppose how to find this EUD using Artmoney filter, either.
if local 0 recognize offset is 0x0059CCE4, how to recognize local 0's health?

what i want to know is when i clicking on local id ## unit, then EUD condition recognize this unit's health, and run trigger action.
if i'm not use 'detect Local id's unit health' EUD, my map will crash when it play multiplay mode.



None.

Jul 2 2008, 5:26 pm DT_Battlekruser Post #2



Quote
if local 0 recognize offset is 0x0059CCE4, how to recognize local 0's health?

It was posted somewhere, or you use ArtMoney. Create a unit and you know that its local ID is 0. Then change its HP with triggers and see what value changes in ArtMoney.

Quote
what i want to know is when i clicking on local id ## unit, then EUD condition recognize this unit's health, and run trigger action.

You must know the Local ID of the unit to find its HP. There is not a way to find out the HP of the unit you clicked on.




None.

Jul 2 2008, 8:41 pm O)FaRTy1billion[MM] Post #3

👻 👾 👽 💪

What I do is put the Current Selection Group address in ArtMoney and then read the first 4-byte int in ArtMoney (takes out the whole search/filter process. ;)) That is the pointer to the unit in the unitnode table. Then, as shown in the UnitNode Struct, you find HP is +0x8 of that address.
However, the first byte of HP is for regen timers (Zerg) and for a fraction (I'm not completely certain about this, but it is used for something related to HP and screws up the values.) So when reading multiply the number by 256. It would probably be best if you did At Least HPVal*256, At Most (HPVal+1)*256-1 or something.

(Sorry if any of that is confusing, I just woke up and am not thinking properly yet.)



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!

Jul 2 2008, 9:21 pm Clokr_ Post #4



Quote from O)FaRTy1billion[MM]
What I do is put the Current Selection Group address in ArtMoney and then read the first 4-byte int in ArtMoney (takes out the whole search/filter process. ;)) That is the pointer to the unit in the unitnode table. Then, as shown in the UnitNode Struct, you find HP is +0x8 of that address.
However, the first byte of HP is for regen timers (Zerg) and for a fraction (I'm not completely certain about this, but it is used for something related to HP and screws up the values.) So when reading multiply the number by 256. It would probably be best if you did At Least HPVal*256, At Most (HPVal+1)*256-1 or something.

(Sorry if any of that is confusing, I just woke up and am not thinking properly yet.)

Divide by 256*.

EDIT: Nvm.

Post has been edited 1 time(s), last time on Jul 3 2008, 1:41 am by Clokr_.



?????

Jul 2 2008, 11:38 pm O)FaRTy1billion[MM] Post #5

👻 👾 👽 💪

Why would you dividy by 256? If you have the value 35 on the 2nd byte, you multiply.
00230000h = 8960d, not 0.13671875.

You are comparing values, not converting them.



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!

Jul 2 2008, 11:47 pm Clokr_ Post #6



Quote from O)FaRTy1billion[MM]
Why would you dividy by 256? If you have the value 35 on the 2nd byte, you multiply.
00230000h = 8960d, not 0.13671875.

The second byte is 0x0000AA00 <- that one. Blame Intel's little endian byte order. If you want to remove the first byte you gotta shift right the number 8 bits or use the integer division by 256.



?????

Jul 3 2008, 1:02 am O)FaRTy1billion[MM] Post #7

👻 👾 👽 💪

You are comparing the values, not converting or removing anything. If you want to see if HP is 35, you multiply 35 by 256 and compare that to what is in the death. I am aware of little-endian stuff.

The second byte is offset 0x00000001, not 0x00000002. If you dividy by 256 you get some decimal, and these aren't FP.



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!

Jul 3 2008, 1:11 am Clokr_ Post #8



Quote from O)FaRTy1billion[MM]
You are comparing the values, not converting or removing anything. If you want to see if HP is 35, you multiply 35 by 256 and compare that to what is in the death. I am aware of little-endian stuff.

The second byte is offset 0x00000001, not 0x00000002. If you dividy by 256 you get some decimal, and these aren't FP.

But you're supposing that the low 8 bits of the HP field contains zeros. And that might not be true in an ongoing game, so you'd have to compare it to 35*256, 35*256+1, 35*256+2, ..., 35*256+255 because all of them would be valid values for 35 HP.

Also by 0x0000AA00 I was refering to the number 0000AA00h using C's notation, not an offset (AA was just a placeholder to mark the position).



?????

Jul 3 2008, 1:24 am O)FaRTy1billion[MM] Post #9

👻 👾 👽 💪

Quote
It would probably be best if you did At Least HPVal*256, At Most (HPVal+1)*256-1 or something.


I still don't know where you are getting dividing by 256 from. You can't edit the value you are reading, and even if you could bad things would happen if you did.



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!

Jul 3 2008, 1:31 am Heimdal Post #10



You guys are misunderstanding each other.

When going from "SC Values" to "logical HP" you divide by 256. When writing a trigger to compare SC's values, you multiply the HP you want by 256.

Endianness does not come into play here.



None.

Jul 3 2008, 1:42 am Clokr_ Post #11



Yeah, that's right. Got confused when I read "So when reading multiply the number by 256". Anyway "It would probably be best if you did At Least HPVal*256, At Most (HPVal+1)*256-1 or something" comparing it that way is analogous to divide the DC value by 256.



?????

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[2026-7-18. : 2:27 am]
Symmetry -- https://staredit.net/topic/18903/ THE REVIEWS ARE HERE! "ok these are pretty good memes" - ssj9Kevin
[2026-7-17. : 2:58 pm]
Ultraviolet -- Symmetry
Symmetry shouted: Man I wish we had this tech back in the day when people played ums lmao
fr fr
[2026-7-17. : 2:39 am]
Symmetry -- Man I wish we had this tech back in the day when people played ums lmao
[2026-7-16. : 6:28 am]
NudeRaider -- EUD actions, specifically. The conditions remained. Today we can even have actions again, but they're all virtualized/whitelisted (not sure on the actual technical implementation) so you can only use them for specific intended purposed, not arbitrary code injections.
[2026-7-16. : 6:26 am]
NudeRaider -- I mean yes, maps - through EUDs - were theoretically able to do that as well, but that was patched quickly.
[2026-7-16. : 6:25 am]
NudeRaider -- Symmetry
Symmetry shouted: Ohhh imagine a SC map that could delete itself
not the map, the editor
[2026-7-16. : 2:28 am]
Symmetry -- I vaguely remember Voy doing some ACE back in the day, but I had no idea EUDs could do that kind of shit. I am very much catching up on the technology
[2026-7-16. : 2:28 am]
Symmetry -- Ohhh imagine a SC map that could delete itself
[2026-7-15. : 8:51 pm]
NudeRaider -- Symmetry
Symmetry shouted: NudeRaider Is EUD editor capable of writing shit onto the player's harddrive? That seems like it would be dangerous
yeah an editor that isn't allowed to write files sounds rather pointless, so I'd assume it can. Like most other programs too btw. and yes, obviously that's dangerous, but also kinda necessary. MS introduced that virtualization for exactly that reason.
[2026-7-15. : 4:10 am]
Ultraviolet -- I don't think so. I think they shut that shit down after 1.16, maybe even earlier
Please log in to shout.


Members Online: DarkenedFantasies, lil-Inferno