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.
[2024-5-06. : 5:02 am]
Oh_Man -- whereas just "press X to get 50 health back" is pretty mindless
[2024-5-06. : 5:02 am]
Oh_Man -- because it adds anotherr level of player decision-making where u dont wanna walk too far away from the medic or u lose healing value
[2024-5-06. : 5:01 am]
Oh_Man -- initially I thought it was weird why is he still using the basic pre-EUD medic healing system, but it's actually genius
[2024-5-06. : 3:04 am]
Ultraviolet -- Vrael
Vrael shouted: I almost had a heart attack just thinking about calculating all the offsets it would take to do that kind of stuff
With the modern EUD editors, I don't think they're calculating nearly as many offsets as you might imagine. Still some fancy ass work that I'm sure took a ton of effort
[2024-5-06. : 12:51 am]
Oh_Man -- definitely EUD
[2024-5-05. : 9:35 pm]
Vrael -- I almost had a heart attack just thinking about calculating all the offsets it would take to do that kind of stuff
[2024-5-05. : 9:35 pm]
Vrael -- that is insane
[2024-5-05. : 9:35 pm]
Vrael -- damn is that all EUD effects?
[2024-5-04. : 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
Please log in to shout.


Members Online: NudeRaider, Zycorax, UndeadStar