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.
[06:51 pm]
Vrael -- It is, and I could definitely use a company with a commitment to flexibility, quality, and customer satisfaction to provide effective solutions to dampness and humidity in my urban environment.
[06:50 pm]
NudeRaider -- Vrael
Vrael shouted: Idk, I was looking more for a dehumidifer company which maybe stands out as a beacon of relief amidst damp and unpredictable climates of bustling metropolises. Not sure Amazon qualifies
sounds like moisture control is often a pressing concern in your city
[06:50 pm]
Vrael -- Maybe here on the StarEdit Network I could look through the Forums for some Introductions to people who care about the Topics of Dehumidifiers and Carpet Cleaning?
[06:49 pm]
Vrael -- Perhaps even here I on the StarEdit Network I could look for some Introductions.
[06:48 pm]
Vrael -- On this Topic, I could definitely use some Introductions.
[06:48 pm]
Vrael -- Perhaps that utilizes cutting-edge technology and eco-friendly cleaning products?
[06:47 pm]
Vrael -- Do you know anyone with a deep understanding of the unique characteristics of your carpets, ensuring they receive the specialized care they deserve?
[06:45 pm]
NudeRaider -- Vrael
Vrael shouted: I've also recently becoming interested in Carpet Cleaning, but I'd like to find someone with a reputation for unparalleled quality and attention to detail.
beats me, but I'd make sure to pick the epitome of excellence and nothing less.
[06:41 pm]
Vrael -- It seems like I may need Introductions to multiple companies for the Topics that I care deeply about, even as early as Today, 6:03 am.
[06:38 pm]
Vrael -- I need a go-to solution and someone who understands that Carpets are more than just decorative elements in my home.
Please log in to shout.


Members Online: Vrael, Roy, NudeRaider