|
I paid eleven minerals for THIS?
|
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. 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 |
|
Remember the game! P.s.: Feldspar.
|
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.) |
|
Omg got a title!
|
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? |
|
Omg got a title!
|
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? |
|
Remember the game! P.s.: Feldspar.
|
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. |
|
Omg got a title!
|
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? |
|
Omg got a title!
|
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? |