Staredit Network > Forums > SC1 UMS Theory and Ideas > Topic: Useful EUD Reference
Useful EUD Reference
Apr 2 2010, 9:09 pm
By: Cinolt
Pages: 1 2 3 >
 

Apr 2 2010, 9:09 pm Cinolt Post #1



Feel free to reply with more information, I'll update it accordingly.

TODO: Player upgrades

Code
NOTE: Verified on Windows-based unmodded (loading hacks is considered modding) clients as of patch 1.16.1. This uses the EPD format (Memory condition in SCMDraft 2). All addresses are local unless otherwise stated. Variables are 0-based unless otherwise stated. Constants prefixed with "0x" are hexadecimal numerals.


VARIABLES:
a: Generic
c: Cooldown
e: Unit entry
f: First unit index address
h: Hotkey
k: Virtual key code
o: Clockwise offset
p: Player ID
u: Unit index
x: X coordinate
y: Y coordinate

[ADDR BASE] [EP FORMULA] [DESC]: [CONDITION/ACTION FORMULA]

0x51C000 -112857 DATA SEGMENT START

0x57FE60 -10561+216*p+12*h+e HOTKEYED UNIT (SHARED): (Unit alpha ID)

0x58A364 0 DEATH TABLE START

0x58CE24 2736 DEATH TABLE END

0x5968AC 12626 LEFT CLICK: AtLeast 1

0x596A18 12717+k/4 SINGLE KEYPRESS: Exactly 256^(k%4)

***FIRST UNIT INDEX START (SHARED)***

0x59CCA8 19025
0x59CCAC 19026
0x59CCB0 19027 HEALTH POINTS: AtLeast 256*a, AtMost 256*a + 255
0x59CCB4 19028
0x59CCB8 19029
0x59CCBC 19030
0x59CCC0 19031
0x59CCC4 19032
0x59CCC8 19033
0x59CCCC 19034
0x59CCD0 19035 CURRENT COORDINATE: Exactly x + 65536*y
0x59CCD4 19036 CURRENT X COORDINATE: Exactly 256*x
0x59CCD8 19037 CURRENT Y COORDINATE: Exactly 256*y
0x59CCDC 19038
0x59CCE0 19039
0x59CCE4 19040
0x59CCE8 19041
0x59CCEC 19042
0x59CCF0 19043 DIRECTION: AtLeast 16777216*o, AtMost 16777216*o + 16777215
0x59CCF4 19044 PLAYER ID: (Only when unit is still) Exactly 768 + p
0x59CCF8 19045
0x59CCFC 19046 ATTACK COOLDOWN: AtLeast 65536*c
0x59CD00 19047 ORDER COORDINATE: Exactly x + 65536*y
0x59CD04 19048 TARGET ID: (Unit index pointer)
0x59CD08 19049 SHIELD POINTS: AtLeast 256*a, AtMost 256*a + 255
0x59CD0C 19050
0x59CD10 19051
0x59CD14 19052
0x59CD18 19053
0x59CD1C 19054
0x59CD20 19055
0x59CD24 19056
0x59CD28 19057
0x59CD2C 19058
0x59CD30 19059
0x59CD34 19060 KILL COUNT: AtLeast 16777216*a, AtMost 16777216*a + 16777215
0x59CD38 19061
0x59CD3C 19062
0x59CD40 19063
0x59CD44 19064
0x59CD48 19065 ENERGY POINTS: AtLeast 16777216*a, AtMost 16777216*a + 16777215
0x59CD4C 19066
0x59CD50 19067
0x59CD54 19068
0x59CD58 19069
0x59CD5C 19070
0x59CD60 19071
0x59CD64 19072
0x59CD68 19073
0x59CD6C 19074
0x59CD70 19075
0x59CD74 19076
0x59CD78 19077
0x59CD7C 19078
0x59CD80 19079
0x59CD84 19080
0x59CD88 19081
0x59CD8C 19082
0x59CD90 19083
0x59CD94 19084
0x59CD98 19085
0x59CD9C 19086
0x59CDA0 19087 RALLY COORDINATE: Exactly x + 65536*y
0x59CDA4 19088
0x59CDA8 19089
0x59CDAC 19090
0x59CDB0 19091
0x59CDB4 19092
0x59CDB8 19093 MATRIX DAMAGE ABSORPTION Exactly a*16777216
0x59CDBC 19094 MATRIX/STIM/ENSNARE/LOCKDOWN TIMER: Exactly a; Exactly 256*a; Exactly 65536*a; Exactly 16777216*a; (Detection) AtLeast 1; AtLeast 256; AtLeast 65536; AtLeast 16777216
0x59CDC0 19095
0x59CDC4 19096
0x59CDC8 19097 BLIND STATE: AtLeast 16777216
0x59CDCC 19098 MAELSTROM TIMER: Exactly a; (Detection) AtLeast 1
0x59CDD0 19099
0x59CDD4 19100
0x59CDD8 19101
0x59CDDC 19102
0x59CDE0 19103
0x59CDE4 19104
0x59CDE8 19105
0x59CDEC 19106
0x59CDF0 19107
0x59CDF4 19108

***FIRST UNIT INDEX END (SHARED)***

0x628438 161845 NEXT UNIT INDEX POINTER: (Unit index pointer)

0x628448 161849 SCREEN X COORDINATE: (Locked on an 8px grid) Exactly x
0x628470 161859 SCREEN Y COORDINATE: (Locked on an 8px grid) Exactly y

0x6284E8 161889+12*p+e SELECTED UNIT (SHARED): (Unit index pointer)

0x6CDDC4 331416 MOUSE X COORDINATE: (Relative to screen) Exactly x
0x6CDDC8 331417 MOUSE Y COORDINATE: (Relative to screen) Exactly y

0x6DE000 347943 DATA SEGMENT END


Converting to other unit indices:
u > 0: f + 142716 - 84*(u-1)

Unit index pointer:
u = 0: 5885096
u > 0: 6455960 - 336*(u-1)

Unit alpha ID:
u = 0: 2049
u > 0: 3748 - (u-1)


Post has been edited 19 time(s), last time on Oct 6 2011, 5:54 pm by yoonkwun.



None.

Apr 3 2010, 5:45 am stickynote Post #2



Are order and rally point detection shared?



None.

Apr 3 2010, 5:50 am payne Post #3

:payne:

Farty got a whole database dedicated to this, no?



None.

Apr 3 2010, 6:06 am Cinolt Post #4



Quote from payne
Farty got a whole database dedicated to this, no?

Yeah, but his database only has the address and description, not the extended player, if it's shared or not, how to get the value, etc. This just helps the process a bit more.

Quote from stickynote
Are order and rally point detection shared?

Yes. Everything between these two lines is shared:
Code
***FIRST UNIT INDEX START; SHARED VALUES (see below)***
Code
***FIRST UNIT INDEX END; SHARED VALUES (see below)***




None.

Apr 3 2010, 6:27 am rockz Post #5

ᴄʜᴇᴇsᴇ ɪᴛ!

Everything from the unitnode table is shared, and has already been detailed. Most of the time it's obvious whether or not the data is shared or not. The address is more useful, IMO. I find this method confusing, but IDK if EUD noobs will find it easier. If you can't understand little endian and artmoney, you probably shouldn't be doing EUDs.



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

Apr 3 2010, 6:39 am Cinolt Post #6



Quote from rockz
Everything from the unitnode table is shared, and has already been detailed. Most of the time it's obvious whether or not the data is shared or not. The address is more useful, IMO. I find this method confusing, but IDK if EUD noobs will find it easier.

To each their own then. Personally, when creating EUD triggers, I find it easier to copy and paste easily from a list with the extended players, not having to do the math every time. The various formulas are probably the most valuable pieces of information.

Quote from rockz
If you can't understand little endian and artmoney, you probably shouldn't be doing EUDs.

This was also meant to allow those who can't understand the concept of EUDs use them anyway, because they have a lot of potential.



None.

Apr 3 2010, 6:42 am poison_us Post #7

Back* from the grave

So if I'm understanding the unit selection part right, I can use Memory(161889, Exactly, 5885096) to detect if player 1 is selecting the first Unit ID? And for each subsequent selection, I just add 1 to the 161889, until I hit my max?

SWEET. Just realized how much work this will be.


Post has been edited 1 time(s), last time on Apr 3 2010, 6:44 am by poison_us. Reason: :ermm:




Apr 3 2010, 6:48 am Cinolt Post #8



Quote from poison_us
So if I'm understanding the unit selection part right, I can use Memory(161889, Exactly, 5885096) to detect if player 1 is selecting the first Unit ID? And for each subsequent selection, I just add 1 to the 161889, until I hit my max?

SWEET. Just realized how much work this will be.

The latest version of SCMDraft 2 has the unit index in the unit properties dialog, which would help a lot with preplaced units.



None.

Apr 3 2010, 3:38 pm stickynote Post #9



Sticky this please. I find this rather useful. I just noticed that you can not only view the local id in scmdraft, you can change it too via move up or down. So awesome.



None.

Apr 3 2010, 4:26 pm rockz Post #10

ᴄʜᴇᴇsᴇ ɪᴛ!

If you want to be useful, make it a user friendly excel sheet. That way you can easily change the numbers and such.
from my excel sheet




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

Apr 3 2010, 8:16 pm O)FaRTy1billion[MM] Post #11

👻 👾 👽 💪

Quote from name:yoonkwun
Yeah, but his database only has the address and description,
Address, version, platform, name, data size, length, and description ... You don't need any more.
Quote from name:yoonkwun
not the extended player
It takes negligible time to find that. If I did add it, though, I'd have to manually add the death table for every version for it to calculate with.
... If someone had ever requested such a thing, it would take a very minute amount of time to add.
Quote from name:yoonkwun
if it's shared or not, how to get the value, etc.
Hence the description field. It's a big textarea for a reason. Add any other/misc. information you feel necessary or useful.

;o
Though the EUDDB does have a disadvantage since nobody seems to update it. ... the 1.16.1 addresses are very lacking and there is a lot of random things.

Post has been edited 3 time(s), last time on Apr 3 2010, 8:25 pm by FaRTy1billion.



TinyMap2 - Latest in map compression! ( 7/09/14 - New build! )
EUD Action Enabler - Lightweight EUD/EPD support! (ChaosLauncher/MPQDraft support!)
EUDDB - topic - Help out by adding your EUDs! Or Submit reference files in the References tab!
MapSketch - New image->map generator!
EUDTrig - topic - Quickly and easily convert offsets to EUDs! (extended players supported)
SC2 Map Texture Mask Importer/Exporter - Edit texture placement in an image editor!
\:farty\: This page has been viewed [img]http://farty1billion.dyndns.org/Clicky.php?img.gif[/img] times!

Apr 4 2010, 12:00 am Leeroy_Jenkins Post #12



Quote from O)FaRTy1billion[MM]
... If someone had ever requested such a thing, it would take a very minute amount of time to add.
Do it.



None.

Apr 4 2010, 4:43 pm Kaias Post #13



I'm still looking for a way to detect when the players have given an order:
Quote from Kaias
My objective is to manually substitute in new voices for specific units. An 'is talking' byte wouldn't have surprised me, simply because of the 'show portrait talking' and 'transmission' actions; in any case, it was simply a mean to that end. Right click detection and selection detection combined could achieve the desired effect, however, as far as I know right click hasn't been found (if it can be). If anyone has any bright ideas for another method, I'd love to hear it.
Now I'm looking for it for a different reason. In Io, when a player selects a target for his spell (depending on the spell type) the Hero will attempt to close the distance between himself and the target area until he is within casting range of it. The problem, of course, is that I need to know if the hero is given a new order before reaching proximity so that I cancel the order to cast. Obviously, this stipulates using a shared value.

Less important things that I could use: Whether or not a unit is maelstromed, locked-down, or defense-matrixed.

I'm also curious, rockz, what addresses/detections you would utilize to create a vHP system that could track every hit exchanged between a set number of units (IE 30).



None.

Apr 4 2010, 5:34 pm rockz Post #14

ᴄʜᴇᴇsᴇ ɪᴛ!

I thought lethal was asking these questions...

As I told him:
+0x5C - CUNIT* Target_Order will display the target, and you can detect cooldown, so you know who attacked whom.

Maelstrom, lockdown, and dmatrix are easy.

Burrowed units is pretty much the standard for VHP, but looks ugly imo and has slowdown problems. Since you know the set number of units, however, EUD HP isn't hard at all. If you're going to use EUDs, you may as well do it right, and detect changes in HP. You'd need a trigger for each HP value you want to detect (a 100 HP unit would probably have 200 states max), then a binary countoff set to detect changes (no more than 20 triggers in total).

As for casting the spell, You select the unit to cast, right? then the unit is ordered towards the selected unit. Once it is in range, it casts the spell. It won't cast the spell until that time, so think of casting the spell as a concentration based spell. You can't move your unit unless you reselect it, which will cancel the spell. You set a DC to know which unit you have selected, another DC to know which unit you had selected last trigger, and if you've selected yourself after selecting another unit while a spell was in progress, cancel any order.



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

Apr 4 2010, 6:05 pm O)FaRTy1billion[MM] Post #15

👻 👾 👽 💪

Quote from Leeroy_Jenkins
Quote from O)FaRTy1billion[MM]
... If someone had ever requested such a thing, it would take a very minute amount of time to add.
Do it.
In the address listing or in the info page?



TinyMap2 - Latest in map compression! ( 7/09/14 - New build! )
EUD Action Enabler - Lightweight EUD/EPD support! (ChaosLauncher/MPQDraft support!)
EUDDB - topic - Help out by adding your EUDs! Or Submit reference files in the References tab!
MapSketch - New image->map generator!
EUDTrig - topic - Quickly and easily convert offsets to EUDs! (extended players supported)
SC2 Map Texture Mask Importer/Exporter - Edit texture placement in an image editor!
\:farty\: This page has been viewed [img]http://farty1billion.dyndns.org/Clicky.php?img.gif[/img] times!

Apr 4 2010, 6:06 pm Kaias Post #16



Quote from rockz
+0x5C - CUNIT* Target_Order will display the target, and you can detect cooldown, so you know who attacked whom.
I was wondering if you knew of any other good way. The greatest problem here are units that shoot projectiles. Technically you could just add in an average wait time or even find the distance between target and attacker. Either way, it isn't a big problem; I don't need dragoons, vultures or any air units.

Quote from rockz
Burrowed units is pretty much the standard for VHP, but looks ugly imo and has slowdown problems. Since you know the set number of units, however, EUD HP isn't hard at all. If you're going to use EUDs, you may as well do it right, and detect changes in HP. You'd need a trigger for each HP value you want to detect (a 100 HP unit would probably have 200 states max), then a binary countoff set to detect changes (no more than 20 triggers in total).
Originally we had different damage bits for each attacker (with reserved bits for 50% and 25% damage from concussive damage) and did a binary countoff on the health value to find each attacker for each attackable unit. It worked extremely well, but the trigger count was a concern and health couldn't be displayed on the unit (unless we wanted the maximum health value to be significantly larger than the maximum damage value, which of course, would've taken a ridiculous amount of triggers per attackable unit. This is why we switched to Cooldown+Current Target

Quote from rockz
As for casting the spell, You select the unit to cast, right? then the unit is ordered towards the selected unit. Once it is in range, it casts the spell. It won't cast the spell until that time, so think of casting the spell as a concentration based spell. You can't move your unit unless you reselect it, which will cancel the spell. You set a DC to know which unit you have selected, another DC to know which unit you had selected last trigger, and if you've selected yourself after selecting another unit while a spell was in progress, cancel any order.
That's one method, but not the one I was referring to. We're using order destination coordinate detection and the target for the spell could be a patch of ground. Technically you'd use a scourge to cast so selecting the Hero to cancel could work, however, it seems unintuitive and would make it so you couldn't see the health of your Hero as it walks into a heated zone to cast a spell.

This does make me think of a new option, however. Instead of ordering the Hero to the target area, I could order him to one of a set of specific order points that would put him on a collision course with the target area and then detect if the Hero's order coordinates are not one of these preset coordinates.



None.

Apr 4 2010, 7:29 pm Cinolt Post #17



Quote from Kaias
Less important things that I could use: Whether or not a unit is maelstromed, locked-down, or defense-matrixed

Updated OP.

Quote from Kaias
Now I'm looking for it for a different reason. In Io, when a player selects a target for his spell (depending on the spell type) the Hero will attempt to close the distance between himself and the target area until he is within casting range of it. The problem, of course, is that I need to know if the hero is given a new order before reaching proximity so that I cancel the order to cast. Obviously, this stipulates using a shared value.

I don't know if I'm understanding this correctly but why couldn't you use my Order map in the other thread? It will detect when the unit recently made an order, which you could use to cancel the spell.



None.

Apr 4 2010, 7:51 pm Kaias Post #18



Quote from name:yoonkwun
I don't know if I'm understanding this correctly but why couldn't you use my Order map in the other thread? It will detect when the unit recently made an order, which you could use to cancel the spell.
An order would be made when the unit is ordered to the target area; it takes a few loops for the order detection to return false, and if the player makes a new order within that time it wouldn't register it. Hmm, actually, I noticed an effect where if the unit was ordered to the exact same place twice it would immediately stop returning true. I wonder if I can use this to my advantage.



None.

Apr 4 2010, 8:38 pm Kaias Post #19



Quote from Kaias
Quote from name:yoonkwun
I don't know if I'm understanding this correctly but why couldn't you use my Order map in the other thread? It will detect when the unit recently made an order, which you could use to cancel the spell.
An order would be made when the unit is ordered to the target area; it takes a few loops for the order detection to return false, and if the player makes a new order within that time it wouldn't register it. Hmm, actually, I noticed an effect where if the unit was ordered to the exact same place twice it would immediately stop returning true. I wonder if I can use this to my advantage.
I just tested it and it will work beautifully. Originally my problem was that the order detection would return true too long, so that orders made soon after would go unnoticed. If you order a unit to the exact same position twice in a row, however, it stops returning true. I can just order it to the location again on the second loop after ordering and it will return true only once. Any order between then and casting is then a new player-given order and thus interrupts. Unfortunately this doesn't solve my voice-over woes.

Quote from name:yoonkwun
Quote from Kaias
Less important things that I could use: Whether or not a unit is maelstromed, locked-down, or defense-matrixed
Updated OP.
Danke.



None.

Apr 4 2010, 8:47 pm Cinolt Post #20



The byte is a decrementing counter, so if you increase the value in the condition, you can in effect shorten the time it returns true. I made it the smallest value in the test map because I was too lazy to brute test what was the best highest value. Now I did and found it's 234881024 (16777216 * 14). It works pretty well too, it always runs at most once per order, and it's pretty hard to unintentionally click twice fast enough for it to return true only once.

Post has been edited 1 time(s), last time on Apr 4 2010, 8:53 pm by yoonkwun.



None.

Options
Pages: 1 2 3 >
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[12:30 am]
ClansAreForGays -- When you join a pub lobby because you see 7/8 players, but then realize host is bating you with computers. :flamer: :flamer:
[11:48 pm]
O)FaRTy1billion[MM] -- :wob:
[2024-10-30. : 6:24 pm]
Ultraviolet -- :wob:
[2024-10-29. : 4:33 pm]
Vrael -- :wob:
[2024-10-29. : 1:32 pm]
Zoan -- :wob:
[2024-10-28. : 5:21 pm]
Ultraviolet -- :wob:
[2024-10-27. : 4:34 pm]
jjf28 -- :wob:
[2024-10-27. : 9:01 am]
Zycorax -- :wob:
[2024-10-27. : 3:31 am]
RIVE -- :wob:
[2024-10-26. : 7:12 pm]
Ultraviolet -- :wob:
Please log in to shout.


Members Online: Roy