Staredit Newtork
Community
StarCraft
Games
Site
Favourites
detect local ID's unit health?

Creator: Maps
Time: Jul 2 2008, 4:48 pm

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

[Avatar]
 offline contact
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.
Top

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

[Avatar]
I paid eleven minerals for THIS?
 online contact
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.
"Three can keep a secret, if two are dead." -Benjamin Franklin

"Had, having, and in quest to have, extreme;
A bliss in proof, and proved, a very woe;
Before, a joy proposed; behind, a dream.
All this the world well knows; yet none knows well
To shun the heaven that leads men to this hell."
-William Shakespeare
Top

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

[Avatar]
Remember the game! P.s.: Feldspar.
 offline contact
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.)
>The Game!<
>Taking SCD4 Suggestions!<
Clicky, Clicky!
Top

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

[Avatar]
Omg got a title!
 offline contact
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.
This post was edited 1 time, last edit by Clokr_: Jul 3 2008, 1:41 am.
_______________
G T C A A G T C \__________________________
C A G U···/ŻŻŻŻ\ A G T C G A G A T C A G T
··········\____/ T C A G C T C T A G T C A
C A G T T C A G
/ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ

Was anyone missing my DNA signature? :P (yeah it is broken, I know it :/)

Top

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

[Avatar]
Remember the game! P.s.: Feldspar.
 offline contact
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.
>The Game!<
>Taking SCD4 Suggestions!<
Clicky, Clicky!
Top

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

[Avatar]
Omg got a title!
 offline contact
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.
_______________
G T C A A G T C \__________________________
C A G U···/ŻŻŻŻ\ A G T C G A G A T C A G T
··········\____/ T C A G C T C T A G T C A
C A G T T C A G
/ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ

Was anyone missing my DNA signature? :P (yeah it is broken, I know it :/)

Top

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

[Avatar]
Remember the game! P.s.: Feldspar.
 offline contact
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.
>The Game!<
>Taking SCD4 Suggestions!<
Clicky, Clicky!
Top

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

[Avatar]
Omg got a title!
 offline contact
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).
_______________
G T C A A G T C \__________________________
C A G U···/ŻŻŻŻ\ A G T C G A G A T C A G T
··········\____/ T C A G C T C T A G T C A
C A G T T C A G
/ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ

Was anyone missing my DNA signature? :P (yeah it is broken, I know it :/)

Top

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

[Avatar]
Remember the game! P.s.: Feldspar.
 offline contact
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.
>The Game!<
>Taking SCD4 Suggestions!<
Clicky, Clicky!
Top

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

[Avatar]
 offline contact
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.
Top

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

[Avatar]
Omg got a title!
 offline contact
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.
_______________
G T C A A G T C \__________________________
C A G U···/ŻŻŻŻ\ A G T C G A G A T C A G T
··········\____/ T C A G C T C T A G T C A
C A G T T C A G
/ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ

Was anyone missing my DNA signature? :P (yeah it is broken, I know it :/)

Top
0 members in this topic: None
+ 0 guest(s)


[02:06 am]
TassadarZeratul -- Especially NerdyTerdy.
[02:06 am]
TassadarZeratul -- Town fails in Speed Mafia.
[01:54 am]
Lord Malvanis -- thanks, thats one of my favorite maps, its very old
[01:53 am]
Falkoner -- Uploaded to dldb
[01:52 am]
Lord Malvanis -- dl please?
[01:51 am]
Falkoner -- I have it :)
[01:43 am]
Lord Malvanis -- Does anyone have "Don't Look At The Dot!" ?
You must log in to shout.

©2003-2008 Staredit Network.
Starcraft & Starcraft II are trademarks of Blizzard Entertainment.
Site Index   |   Terms of Service   |   Privacy Policy   |   Contributions