Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: EUD's r for the cool kids. (Help with EUD's)
EUD's r for the cool kids. (Help with EUD's)
Apr 8 2010, 4:27 pm
By: TiKels  

Apr 8 2010, 4:27 pm TiKels Post #1



So I decided I wanted to learn how to form and create EUD conditions and actions.

I got all the way to the part in the wiki that says "What now" and got that right, and I tried doing the "Inputting the Address" section where things started being weird.

I did basically what they said but I got a different address (Which is not not surprising, nor is it a problem), but I have no idea what "Object ID/Len" and the number to the right of that does, and the wiki says nothing about it. I assume I'm supposed to have "Use extended player Deaths" off, but it is on by default and the wiki says nothing about it. Please help me understand if I am doing this correctly.

The byte offset bit isn't making any sense either. It says "add 256 to each value." I don't quite understand where they are getting "256."

PS: The memory offset I got was 0x006282A1 and the byte offset is 00 00 00 00 00 00 00 00



"If a topic that clearly interest noone needs to be closed to underline the "we don't want this here" message, is up to debate."

-NudeRaider

Apr 8 2010, 4:39 pm CecilSunkure Post #2



That wiki was written to show you how to make traditional conditions. Now the standard EUD condition is the memory condition.

So if you wanted to do some HP detection, you find your address via artmoney. Sounds like you did this on your own. Now you need to convert this address from a hexadecimal value to a decimal value, you can do this on the internet with a google search of hex to decimal. Then you need to subtract the lowest readable point of SC RAM via extended deaths from your address, this value is 5808996. So, you will subtract this value (5808996) from your address, after your address is converted to decimal format.

Here is the equation for setting up your condition: Your Address = 5808996 + (4*P) + (48*Unit:ID). The P is your player number; if the memory condition is for player one substitute in a 1 for P. The memory condition in Scmdraft uses the Terran Marine to make this condition, and the ID of a marine is 0, so the (48*Unit:ID) simplifies to 0.

To detect health for a unit for player 1, you do this: ((Your Address in decimal) - 5808996) / (4 * P); this is the same equation as the one above, just simplified.

As explained in this post http://www.staredit.net/177864/, your resulting value (from the above equation) will tell you how to create your condition for detecting a specific HP amount. If your resulting value ends with .25, then the unit's HP will be represented in increments of 256. So you would use: Memory(some number, exactly, 256); to detect when this unit has 1 hp, assuming the "some number" when calculated ended in .25.

Here is a helpful topic on this: http://www.staredit.net/topic/8600/

Post has been edited 2 time(s), last time on Apr 8 2010, 4:46 pm by CecilSunkure. Reason: Tidying up post.



None.

Apr 8 2010, 5:10 pm TiKels Post #3



God, this is confusing, but I am not giving up.

The number I got from calculations is 161743.25.

What happens when I DON'T have a number ending in .25 ?

The condition for the unit having 30 hp would be Memory(161743.25, exactly, 7680) correct? How would I do this in EUD action format (Changing the unit's HP to 30; I have farty's EUD enabler on)

When I put this into scmdraft, the 161743.25 shaves off the .25

Edit: I tested it and it worked, though it was less than instant. It had a little delay.

Post has been edited 1 time(s), last time on Apr 8 2010, 5:18 pm by TiKels.



"If a topic that clearly interest noone needs to be closed to underline the "we don't want this here" message, is up to debate."

-NudeRaider

Apr 8 2010, 5:20 pm CecilSunkure Post #4



Yeah you did this correctly. rockz explained in the post I linked to you what to do when you get different values. Alternatively you could use EUDTrig to determine the byte offset, and how to create your comparison.



None.

Apr 8 2010, 5:26 pm TiKels Post #5



Quote from TiKels
How would I do this in EUD action format (Changing the unit's HP to 30; I have farty's EUD enabler on)

When I put this into scmdraft, the 161743.25 shaves off the .25

How2do Eud Actions?

Why shave?



"If a topic that clearly interest noone needs to be closed to underline the "we don't want this here" message, is up to debate."

-NudeRaider

Apr 8 2010, 5:37 pm CecilSunkure Post #6



It shaves it off because the leftover value is unneeded information for the particular slot you place that value into. I don't anything about EUD actions, you'll have to ask someone like rockz or Ahli, or Apos.

[Edit]Or Farty. Go check out the EUD Action Enabler thread and read stuffs.

Post has been edited 2 time(s), last time on Apr 8 2010, 5:49 pm by CecilSunkure.



None.

Apr 8 2010, 6:02 pm TiKels Post #7



Can you give me a formula for turning memory into death? Like an easy way to interchange them?



"If a topic that clearly interest noone needs to be closed to underline the "we don't want this here" message, is up to debate."

-NudeRaider

Apr 8 2010, 6:15 pm rockz Post #8

ᴄʜᴇᴇsᴇ ɪᴛ!

Quote from wiki
The formula for creating an EUD condition is Memory Address = Death Table Start + (4*Player) + (48*Unit:ID).
http://www.staredit.net/wiki/EUDs#Inputing_The_Address
Address, death table start are constants and don't change. The memory condition uses unitID of 0. Traditional EUDs use a legal player number and an extended unit. Converting between the two is as simple as balancing the two equations.

For eud actions, you use the "set deaths" action, and set the address (player number and unit id based) to a 4 byte integer (the number you'd input).

You can only read 4 bytes at a time, so if you want to read 59ccb1 or something, you'll have to read 59ccb0, 59ccb1, 59ccb2, and 59ccb3 all at the same time. Deaths condition reads addresses that end in 0, 4, 8, and C without anything special done to them. If they end in 1, 4, 9, or D (HP that you can read is like this), you'll have to multiply by 256. Most addresses fit nicely into the 4 bytes, but some don't.

you DID watch the video right?



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

Apr 8 2010, 7:13 pm TiKels Post #9



I have dialup. Takes a good hour to load up a few minutes of video... I'll consider watching it, where's the link?

I honestly understood about 10% of what you said.



"If a topic that clearly interest noone needs to be closed to underline the "we don't want this here" message, is up to debate."

-NudeRaider

Apr 8 2010, 8:00 pm bobo Post #10



here is the video (at the bottom) http://www.staredit.net/wiki/EUDs or alternatively here is a tutorial for heath detection by rockz using just pictures and explanations just as good in my opinion http://sites.google.com/site/whathuh052/eud.html?attredirects=0



None.

Apr 8 2010, 8:19 pm Cinolt Post #11



An in-depth explanation for someone who's curious about how EUDs actually work:

When StarCraft encounters the Death condition in a trigger, it has to refer to some place in game memory that contains the death values. As you probably know all data is stored in bytes, and each death value happens to be stored in four bytes. To help StarCraft know which four bytes to pick from, all the death values are clumped together in sequential order. The first death value in this clump would be Player 1's deaths of UnitID 0 (Terran Marine), then the next would be Player 2's deaths of UnitID 0 until Player 12. From there it's Player 1's deaths of UnitID 1, etc. Here's how it would look like:

01 02 03 04 | 05 06 07 08 | 09 0A 0B 0C | 0D 0E 0F 10
01 02 03 04 | 05 06 07 08 | 09 0A 0B 0C | 0D 0E 0F 10
01 02 03 04 | 05 06 07 08 | 09 0A 0B 0C | 0D 0E 0F 10
01 02 03 04 | 05 06 07 08 | 09 0A 0B 0C | 0D 0E 0F 10
01 02 03 04 | 05 06 07 08 | 09 0A 0B 0C | 0D 0E 0F 10
01 02 03 04 | 05 06 07 08 | 09 0A 0B 0C | 0D 0E 0F 10
The bolded bytes are Player 2's deaths of UnitID 1 (Terran Ghost).

Each byte has a unique address that is used to identify it. The address of the first byte of the death table is 0x0058A364, and the address of the second byte would be that plus 1 (0x0058A364 + 0x1 = 0x0058A365). In case you didn't know these are numeric values like any other, they're just in hexadecimal notation and the 0x prefix is there to tell us that.

Let's say StarCraft is handling the condition "Player 2 suffered 42 deaths of Terran Ghost". First off you need to know that the player value is 0-based, meaning that "Player 1" is actually a value of 0, "Player 2" is a value of 1, etc. So in this case the player value is 1, and the unit value is 1. Studying the diagram above, we can identify that because the death data is organized so conveniently, if we add 48 (decimal) to the first byte's address (P1 deaths of UnitID 0), we'd have the address of the next UnitID (P1 deaths of UnitID 1). If we add 48 again, we'd have the deaths of UnitID 2, and so on. With that in mind, we can say that in the condition, increasing the UnitID by 1 increases the address that StarCraft checks by 48. If we increase the player value by 1, we'd add the address by 4. So, what StarCraft will do is simply take the player value in the condition and multiply it by 4, and take the UnitID value and multiply it by 48, then add them together. In this case it would solve as 52 (1*4 = 1; 1*48 = 48; 4 + 48 = 52). Then add that value to the first byte of the death table (0x0058A364 + 0x34 = 0x0058A398; remember, 52 in hex is 0x34) and that would return the address of the death value it's looking for, and would check if that value is 42.

So where do EUDs come in the picture? An EUD is simply what its name is: Extended Unit Deaths. There are only so many UnitIDs are used by StarCraft, and therefore the death table only has enough bytes to contain the deaths of those UnitIDs that StarCraft uses. So if you put in a UnitID that's bigger than the maximum UnitID contained in the death table, StarCraft will still utilize the regular formula and come up with an address of a byte that's not in the death table, but a byte that contains some other numeric value. For example, it could return the address for a unit's HP. Of course we can't plug in any old value so we have to find the address of the value you want using a memory searcher (Cheat Engine, TSearch), and with the knowledge of how StarCraft handles the death condition it's possible to figure out what UnitID/Player values to put in. EUD actions follow almost the exact procedure except you're just setting the values, not detecting them.

Post has been edited 2 time(s), last time on Apr 8 2010, 10:20 pm by yoonkwun.



None.

Apr 8 2010, 9:21 pm TiKels Post #12



Wow that was wonderfully informative and makes so much more sense.

I got better answers actually asking the same question in the Eud Enabler program section.



"If a topic that clearly interest noone needs to be closed to underline the "we don't want this here" message, is up to debate."

-NudeRaider

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[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
[2024-5-04. : 1:05 am]
Vrael -- that's better
[2024-5-04. : 12:39 am]
NudeRaider -- can confirm, Vrael is a total madman
[2024-5-03. : 10:18 pm]
Vrael -- who says I'm not a total madman?
[2024-5-03. : 2:26 pm]
UndeadStar -- Vrael, since the ad messages get removed, you look like a total madman for someone that come late
[2024-5-02. : 1:19 pm]
Vrael -- IM GONNA MANUFACTURE SOME SPORTBALL EQUIPMENT WHERE THE SUN DONT SHINE BOY
[2024-5-02. : 1:35 am]
Ultraviolet -- Vrael
Vrael shouted: NEED SOME SPORTBALL> WE GOT YOUR SPORTBALL EQUIPMENT MANUFACTURING
Gonna put deez sportballs in your mouth
[2024-5-01. : 1:24 pm]
Vrael -- NEED SOME SPORTBALL> WE GOT YOUR SPORTBALL EQUIPMENT MANUFACTURING
[2024-4-30. : 5:08 pm]
Oh_Man -- https://youtu.be/lGxUOgfmUCQ
Please log in to shout.


Members Online: Oh_Man, Roy