EUDs

From Staredit Network Wiki
Revision as of 02:37, 23 November 2012 by DevliN (Talk | contribs) (What Will I Need?)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

What Will I Need?

First off, it is recommended that you download the following programs, which are free.

Once you have all of these programs downloaded, unzipped, and installed you can continue.

What Do I Do First?

First off, you need to make sure that what you want to search for is something that can actually be read by StarCraft's memory. Although you can only use EUD Conditions in the current patch (1.16.1) you can still do some pretty cool things. If you want to widen your array, simply downgrade to version 1.12 or less using SCDG3 by FaRTy, or use the new EUD Action Enabler. Once you have figured out what you want to search for run your StarCraft.exe and then the Artmoney.exe files. In this tutorial I will be showing you how to search for a units hit points.

Once you have both of the programs open go to Artmoney and "Select process" bar and select "Brood War" Now that you have that done, you should make a simple map which features two units. One of them that you will try to detect is HP and the other to decrease its HP. In This test we will be using a "Terran Marine" and attacking it will be a modified "Terran Ghost" I chose to modify its attack to 1 so I don't kill the "Terran Marine" too fast.

Now that you have you completed these steps you should now open the game and start playing your map.

Searching For An Address

First Search

With both Artmoney and StarCraft running and while in a game, click on the "Search" button in Artmoney. This will bring up another window titled "Search ( Step 1 )" You will notice that you have different types of searches you can proceed with, but for this one, you will need to use "Exact value". Now you want to try to search for the current Hit Points of the "Terran Marine". To do this input the current HP of the "Terran Marine", normally 40. All you have to do now is just hit "ok" and the left most tree should be populated with addresses followed by there byte value. You will also notice that there is a lot of values that will populate your list, this is normal of most first searches.

Filter 1

Now that you have populated the list with the search for "40", you now need to go into StarCraft and decrease the Terran Marine's hit points by what ever variable, in this test we will just attack the Terran Marine enough to decrease its hit points by 1 making its new hit points 39. Now that this is completed, go back into Artmoney and click on the Filter button right next to the Search button. This time instead of the original search of 40, you should now search for the new hit points of the Terran Marine, in this case it will be 39. Enter the number and hit OK. You will now notice that the list is decreased dramatically this time. If you messed up, or it comes back saying something like "there were no results for your search", simply repeat steps 1 and then step 2 again. Note: Searching and Filtering will not always work every time you start a Search, or Filter more in depth for your address. Now that we have the First Filter complete, we can now go on to the next step.

What Now?

With the First Filter complete we now decreased the list from many addresses to just 2 this time. Now instead of Filtering the search we now want to find the address with the 2 byte value. To do this simply click on the value (anywhere in the box) and click the top red arrow (add only selected) This should move that specific address with its value and some other custom information into the bigger window. Now what you do is click on the number under the Value in the table. You can now type in a number to test and see if this is the correct address for the Terran Marine's hit points. The Value was 39 and now we will make it 60, just for fun. Now after the number is inputed, go into StarCraft again and view the Terran Marine's hit points. If it says 60/40, or what ever you inputed, you will know you have the correct address for the Search. If any of this has not worked for you, simply restart the map and start over from step 1. NOTE: It will not always work for you.

Inputting The Address

Now that you have the address, for me its "0059CC99" now you need to do some calculations. EUDTrig 1.3 can do some of this calculation for you. However, it is still important to understand how the math explained below works.

The formula for creating an EUD condition is Memory Address = Death Table Start + (4*Player) + (48*Unit:ID). The Memory Address is the address you just found with ArtMoney. The Death Table Start is the lowest readable address in StarCraft's RAM (with extended unit deaths), and is equal to 0x0058A364, or in decimal 5808996. The Player is simply the player number for the condition you are making: e.i. a condition for Player 1 would make Player in the equation equal to the number 1. Unit:ID is the ID for the unit you are using to create the condition. The memory condition in newer versions SCMDraft 2 uses the Terran Marine to create EUD conditions. The ID of a Marine is 0, so you can just change (48*Unit:ID) to 0 for this equation. Once you convert your address into decimal format, you can quickly solve this equation by using this simplified form: P = (Address - Death Table Start) / 4. The number calculated here will tell you how to construct your comparison in the Memory condition.

What To Do With The Information?

After you complete your calculation and solve for your value, you can end up with a few different numbers in the decimal. Whatever ends up in the decimal will tell you how to create your comparison.

In the case of a value with a decimal, an even number means it's divisible by 4 and you want to just simply detect the exact value of HP (easiest by far). A .25 at the end of your value means you're looking for byte 2, so you have to multiply your desired HP amount by 256 (256=1 hp, 25600=100 hp). .5 means you're looking for byte 3, so multiply by 256^2. .75 you will probably never encounter, and you just multiply by 256^3.

Deaths read every 4 bytes. That means they actually read 4 bytes, no matter what is there. In the case of HP, HP is split up into 4 bytes (lucky us!).

Zerg HP regeneration is basically adding 4 to this number every frame. Once this byte reaches 256, it loops back to 00 and adds 1 hp that you can actually see in game. The second byte through the fourth byte are all the HP that you see in game. If a marine has 100 hp, it's actually got a 100 in the 2nd byte, and 00 in the first byte.

So now you take your solved value, which is 19021.25 in this example, and place it in the first section of the Memory condition in SCMDraft. The HP value for this unit is in the second byte, as denoted by the .25, and as denoted by the red 00's in EUDTrig. When you place this value into SCMDraft the .25 is shaved off - that is perfectly fine; EUDTrig doesn't even show you the .25. See Byte Values below for more information.

Since the HP for this particular example is in the second byte, that means you will multiply whatever HP amount you want to detect by 256. Here is a complete condition for detecting 40 HP for the unit in our example: Memory(19021, Exactly, 10240);. Take note that the 10240 is really 40 * 256.

Byte Values

  • Byte Offset: 00 00 00 00 = multiply by 1 (256^0)
  • Byte Offset: 00 00 00 00 = multiply by 256 (256^1)
  • Byte Offset: 00 00 00 00 = multiply by 65536 (256^2)
  • Byte Offset: 00 00 00 00 = multiply by 16777216 (256^3)

If All Else Fails...

When in doubt and all else fails, make a topic in the UMS Mapmaking Assistance thread for specific questions or uncertainty.

Extra Information

From O)FaRTy1billion Not including single-player actions (for obvious reasons), these are all of the actions will not drop (brute-testing, ftw): Preserve Trigger, Wait*, Transmission, Play WAV, Display Text Message, Center View, Set Mission Objectives, Set Switch*, Set Countdown Timer*, All Leader Board (and Goal), Set Score*, Minimap Ping, Talking Portrait, Mute Unit Speech, Unmute Unit Speech, Move Location*, Set Invincibility**, Set Deaths*, Comment, Pause Timer*, Unpause Timer*.

Quote from a text file I wrote a while ago with this information

  • Be cautious if you have any other desynching triggers that are dependant on these or use them in any way because they may cause a desync.
    • Set Invincibility wont desync by itself, but if you target a unit that was effected by the action then it will desync.

Video Tutorial

This video provides an animated tutorial of how to use ArtMoney to search for an address.