Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Hotkey EUD Trigger
Hotkey EUD Trigger
Mar 28 2013, 8:38 pm
By: Golondrin  

Mar 28 2013, 8:38 pm Golondrin Post #1



Hello there, first of all I've already read that awesome Roy's guide on EUD triggers and I managed to make some easy but neat triggers (defeat on any speed settings but fastest, exit the level by selecting an egg and pressing ESC...)

Now I've hit a wall with these one condition:
http://farty1billion.dyndns.org/EUDDB/?pg=entry&addr=0x0057FE60&ver=1.16.1&plat=win

That formula is turning me crazy, I'm trying to test it first by having just 1 marine hotkeyed (action display text hello), but no results so far.

My ultimate goal is to make triggers with conditions where the players must have selected 12 units of one kind on each control key.
( Ex: control group 1: 12 zealots, control group 2: 12 Dragoons)

Please, could have some help there?



None.

Mar 28 2013, 9:55 pm jjf28 Post #2

Cartography Artisan

There is another listing for this same address here

There are 12 separate hotkey addresses for each slot for a single hotkey number, each is 4 bytes (the next address is at +4 from the address of the last one, value ranges from 0 to 2^32-1)

Hotkey #1 is +48 from hotkey #0

The player is zero based (meaning for p1 you enter 0, p2 you enter 1, etc.)

Unit entry (aka Unit alpha ID) corresponds to the index of the hotkeyed unit (or current position in memory).

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





I did a little in-game testing, perhaps these addresses will help get you started.

Player 1's Hotkey ctrl+0 slot 1 = 0x0057FE60
Player 1's Hotkey ctrl+0 slot 2 = 0x0057FE64
Player 1's Hotkey ctrl+1 slot 1 = 0x0057FE90

Quote
My ultimate goal is to make triggers with conditions where the players must have selected 12 units of one kind on each control key.
( Ex: control group 1: 12 zealots, control group 2: 12 Dragoons)

This doesn't seem practical. The hotkey addresses store an "Alpha ID" not a "UnitID", you will not be able to easily find which type of unit is hotkeyed (and will certainly not find it using the hotkey addresses alone).



TheNitesWhoSay - Clan Aura - github

Reached the top of StarCraft theory crafting 2:12 AM CST, August 2nd, 2014.

Mar 28 2013, 11:23 pm Golondrin Post #3



Dang, still can't nail it... Tomorrow I'll resume trying to finally understand that formula, too tired now.

Still, for what you told, i fear this trigger will lead me nowhere from what I originally intended. Having 12 addresses for each control group, to read 4 groups of units would require 48 conditions. BUT, since the units must be pointed by the Index instead of unit ID it's practically impossible to know which unit will end in what slot and and what type the unit is. It's even worse if on those control groups are entering and disappearing units in a constantly flux (like losing units in battle and making new ones on gateways)

I've at least got that correct, ain't I?

Thanks for all the info anyway



None.

Mar 28 2013, 11:25 pm jjf28 Post #4

Cartography Artisan

Quote
Still, for what you told, i fear this trigger will lead me nowhere from what I originally intended. Having 12 addresses for each control group, to read 4 groups of units would require 48 conditions. BUT, since the units must be pointed by the Index instead of unit ID it's practically impossible to know which unit will end in what slot and and what type the unit is. It's even worse if on those control groups are entering and disappearing units in a constantly flux (like losing units in battle and making new ones on gateways)

I've at least got that correct, ain't I?

Sounds right



TheNitesWhoSay - Clan Aura - github

Reached the top of StarCraft theory crafting 2:12 AM CST, August 2nd, 2014.

Mar 29 2013, 6:51 pm Azrael Post #5



Does this only need to be done once, such as at the beginning of the game? Or is it something which will be done mid-game? If it only needs to be done once, or for a single set of units, it's pretty easy to setup. You just need to preplace the 12 units so you know their indexes from the start, and then when you check the 12 hotkeyed slots, simply check for the index range of those units (ie, if their indexes are 101 to 112, then check for "at least 101" and "at most 112" for each hotkeyed slot, using whatever the address values would actually be for those index values).

If the units can be killed and need to be created mid-game, there are still ways to do this, and finding both the index and unit type of any given unit wouldn't be particularly complex. However, actually applying those values to the triggers which verify that the given information matches the expected values would be harder, since you could no longer check for a range of indexes or any specific indexes.

You'd need to make the system recycle the same indexes for the units which were removed from the map (which is also demonstrated in that thread), so that your verification triggers can operate on a single range of indexes for every set of hotkeyed units.




Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[03:08 pm]
Sylph-Of-Space -- woah! nice! thank you!
[04:05 am]
O)FaRTy1billion[MM] -- the setting exists, it's just hidden in a weird place
[04:04 am]
O)FaRTy1billion[MM] -- instead change "Microtile Overlay" to "Impassable"
[04:04 am]
O)FaRTy1billion[MM] -- er, wait, idk why i was looking for height
[04: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"
[03:57 am]
Sylph-Of-Space -- Unless I'm dum (possible)
[03:57 am]
Sylph-Of-Space -- It would be so so so nice if SCMDraft had some kind of dedicated "walkability" view for the tilesets.
[03:53 am]
Sylph-Of-Space -- :'( dont cry for me cat-gentina
[09:18 pm]
Ultraviolet -- 🔪🐈
[2024-5-19. : 12:34 pm]
NudeRaider -- curiosity kills the cat!
Please log in to shout.


Members Online: Roy