Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Eud's to detect changes in units energy
Eud's to detect changes in units energy
Jan 17 2010, 8:57 pm
By: Project100  

Jan 17 2010, 8:57 pm Project100 Post #1



I need to know the number for the scmdraft "memory" condition (Memory at death table + ____ is ____ ___) to detect energy of a unit. Can somebody post it, as i have been trying to figure it out all day and can't come up with anything that works.



None.

Jan 17 2010, 9:17 pm Biophysicist Post #2



You can use Kaias's energy scan system. Look in Theory and Ideas.



None.

Jan 17 2010, 9:21 pm Kaias Post #3



Quote from name:TassadarZeratul
You can use Kaias's energy scan system. Look in Theory and Ideas.
He told me he doesn't have computers to spare for it.



None.

Jan 17 2010, 10:20 pm rockz Post #4

ᴄʜᴇᴇsᴇ ɪᴛ!

Uh, its different for each unit, find hp and add 154 to the address. Note it's a 2 byte variable, so you'll read 65536 as 1/256th of energy



"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"

Jan 17 2010, 10:34 pm Project100 Post #5



Quote from rockz
Uh, its different for each unit, find hp and add 154 to the address. Note it's a 2 byte variable, so you'll read 65536 as 1/256th of energy
Ok, so i find the adress of a defiler and add 154 to it to get its energy...then what?



None.

Jan 17 2010, 11:50 pm CecilSunkure Post #6



Quote from rockz
Uh, its different for each unit, find hp and add 154 to the address.
What if a unit has over 154 hp points?



None.

Jan 18 2010, 1:31 am rockz Post #7

ᴄʜᴇᴇsᴇ ɪᴛ!

Quote from Project100
Quote from rockz
Uh, its different for each unit, find hp and add 154 to the address. Note it's a 2 byte variable, so you'll read 65536 as 1/256th of energy
Ok, so i find the adress of a defiler and add 154 to it to get its energy...then what?
Typical adresses for a unit (not sure which unit, though, sorry)

Take a look in the collapse box. You'll note that dwHP is a double word (4 bytes), and has a specific address. To convert an address into a memory condition, use the formula:
4*Player + 48*UnitID + Offset = Address. Memory condition simplifies this by using terran marine as the unitID (which is 0).

Now, since you want energy, add +154 or +0x9A to the dwHP address, then convert that. You'll note that the player number needed will be something something and a half. That means you have to read the 3rd and 4th byte. wEnergy is a word, so is only 2 bytes long. wQueue5 is in bytes 1 and 2, but they are insignificant.

Once you have your address, plug it into the formula to get the player number, or use EUDTrig. The number you need to be looking for is 2^24 * Energy. Note that the 3rd byte is hidden from the GUI, and every frame the game adds 8 to the 3rd byte, until it reaches 256, at which point, it converts into 1 energy in the 4th byte. The GUI will always round up to the nearest whole number, too, so if you have 192 energy, and a 16 in the third byte, the GUI will display 193 energy. That makes it hard to search for, though you can always use hyper triggers and set energy to a certain % to change the number. Once you get over 127 energy, you'll have to put in negative numbers, or they'll change to negative numbers, so be careful with those. SC treats them like they aren't negative though, so you can use at least/at most as if they were the whole number. See attached map for an example trigger of detecting HP, Energy, and Shields. It's the trigger that looks like this:
Code
Conditions:
    Deaths("Player 10", "UnitID:1588", At least, 3355443428);
Actions:
    Set Deaths("Player 2", "Terran Marine", Set To, 1);

except I did it before the memory condition was available. the player for the memory condition would be (48*UnitID + 4*Player number)/4, so (48*1588+4*9)/4. Note that player number is 0 based, so player 1 is 0, player 2 is 1, player 10 is 9.
Quote from CecilSunkure
Quote from rockz
Uh, its different for each unit, find hp and add 154 to the address.
What if a unit has over 154 hp points?
You don't worry about it, since the number in the HP address has nothing to do with the address.

[attach=2052]

Attachments:
RengenerationEUD.scx
Hits: 14 Size: 24.18kb



"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[2024-5-20. : 3:08 pm]
Sylph-Of-Space -- woah! nice! thank you!
[2024-5-20. : 4:05 am]
O)FaRTy1billion[MM] -- the setting exists, it's just hidden in a weird place
[2024-5-20. : 4:04 am]
O)FaRTy1billion[MM] -- instead change "Microtile Overlay" to "Impassable"
[2024-5-20. : 4:04 am]
O)FaRTy1billion[MM] -- er, wait, idk why i was looking for height
[2024-5-20. : 4:03 am]
O)FaRTy1billion[MM] -- below the minimap should be a thing that says "Overlay Settings" with a little + button in the corner, press the + to expand it, uncheck Use Defaults, then change "Tile Overlay" to "Height"
[2024-5-20. : 3:57 am]
Sylph-Of-Space -- Unless I'm dum (possible)
[2024-5-20. : 3:57 am]
Sylph-Of-Space -- It would be so so so nice if SCMDraft had some kind of dedicated "walkability" view for the tilesets.
[2024-5-20. : 3:53 am]
Sylph-Of-Space -- :'( dont cry for me cat-gentina
[2024-5-19. : 9:18 pm]
Ultraviolet -- 🔪🐈
[2024-5-19. : 12:34 pm]
NudeRaider -- curiosity kills the cat!
Please log in to shout.


Members Online: Roy