Am attempting to use EUDs for a specific (preplaced) unit in the map, came upon a critical question. I have some doodad objects that may be removed via triggers at certain points in the game. Will this change the unit indexes? Currently the unit I want to use EUDs on is index 0 in the editor however as I understand it doodads take precedence in index count in the actual game.
So my question is, if at the start of the game I have 10 doodads and some unit A with an index of 0 + 9 = 10, and at some point 5 doodads are removed, will unit A retain index value 10 or will the value decrease by 5?
Just to clarify by doodads I mean the installation traps/defences.
Also related question: are there any other unit types which take precedence when unit indexes are calculated (such as powerups or dark swarm/web)?
Post has been edited 2 time(s), last time on Jun 8 2016, 7:57 pm by Zoko-TkZ.
None.
An artist's depiction of an Extended Unit Death
Am attempting to use EUDs for a specific (preplaced) unit in the map, came upon a critical question. I have some doodad objects that may be removed via triggers at certain points in the game. Will this change the unit indexes? Currently the unit I want to use EUDs on is index 0 in the editor however as I understand it doodads take precedence in index count in the actual game.
So my question is, if at the start of the game I have 10 doodads and some unit A with an index of 0 + 9 = 10, and at some point 5 doodads are removed, will unit A retain index value 10 or will the value decrease by 5?
Just to clarify by doodads I mean the installation traps/defences.
A unit's index never changes once assigned, regardless of the death and creation of other units. So to your question, Unit A will retain index value 10.
Also related question: are there any other unit types which take precedence when unit indexes are calculated (such as powerups or dark swarm/web)?
The only general exceptions are doodads (which always take precedence) and Start Locations (which never consume an index). Powerups and the like are treated as regular units, and they occupy the next available index as expected.
From
Section 6 of the EUD Guide:
However, it's not always this simple. Here's a couple ways the index value can be incorrect in SCMDraft:
- SCMDraft assigns an index ID to Start Locations, but the actual game does not. This means if a Start Location was at index 0 and a Marine was at index 1, the Marine's actual index in-game would be Index 0.
- Any doodad units placed on the map (e.g., a floor gun trap) that is placed as a doodad will not show in SCMDraft's list of units, but it will also be assigned an index ID. Doodad units are assigned IDs before preplaced units are, regardless of whether the doodad was placed before or after the unit(s). For example, if you first place a Marine (shown as index 0), a Floor Gun Trap doodad, and then a Firebat (shown as index 1), the Floor Gun Trap will receive index 0, the Marine will receive index 1, and the Firebat will receive index 2.
Another thing to remember is that players that are not in the game will not have their units placed. This again alters the actual indexes of preplaced units.
Thanks Roy! Your guide has been very helpful.
Another new question: do unit indexes or EUDs act differently regarding units with doodad state enabled (using the method for cloaking)?
Post has been edited 1 time(s), last time on Jun 8 2016, 9:39 pm by Zoko-TkZ.
None.
Another thing to keep in mind is that tank and goliath turrets count as separate units too, so tanks and goliaths count as 2 units.
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!
This page has been viewed [img]http://farty1billion.dyndns.org/Clicky.php?img.gif[/img] times!
Don't forget interceptors in hanger, which come in the slots after a carrier; not sure how scarabs work; there's probably a few more nuances we haven't mentioned, you're probably best off just checking the indexes in game with
Unit Viewer
TheNitesWhoSay - Clan Aura -
githubReached the top of StarCraft theory crafting 2:12 AM CST, August 2nd, 2014.
I believe the 1st unit placed on the map is at the beginning of the unit table and the 2nd unit placed on the map is at the end of the unit table, and it goes backwards from there.
This would mean that carriers' interceptors are actually placed
before the carrier in memory. Please correct me if I'm wrong.
"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"
For pre-placed units, interceptors are always at unit table indexes (referred to as 'slots' above) after the carrier they're in.
In terms of where units start in memory the unit table goes...
0000 - 0x0059CCA8
0001 - 0x00628298
0002 - 0x00628148
...
1699 - 0x0059CDF8
So in terms of starting address they come before (unless the carrier is at index 0), though I don't recommend memorizing that
, here's a excel formula to turn an index (assumed to be at B2) into the address a unit starts at in memory:
=DEC2HEX(IF(B2=0,5885096,6456296-336*B2))
TheNitesWhoSay - Clan Aura -
githubReached the top of StarCraft theory crafting 2:12 AM CST, August 2nd, 2014.
Is there any way to get a unit's index number other than unit viewer? I'm attempting a simple EUD trigger that checks a unit's energy but even after checking and re-evaluating the formula many times it seems that the trigger is using the wrong unit index. I believe the best way to debug it is to find the actual index of the unit I am attempting to use. The index that I am trying to use I got by setting the index of the unit to 0 in scmdraft and then counting the number of doodads, and then using that value.
None.
An artist's depiction of an Extended Unit Death
Is there any way to get a unit's index number other than unit viewer? I'm attempting a simple EUD trigger that checks a unit's energy but even after checking and re-evaluating the formula many times it seems that the trigger is using the wrong unit index. I believe the best way to debug it is to find the actual index of the unit I am attempting to use. The index that I am trying to use I got by setting the index of the unit to 0 in scmdraft and then counting the number of doodads, and then using that value.
You should only be counting doodad
units; doodads that are just terrain and sprites don't get assigned an index. If you can select the doodad in-game, or if it has HP, it takes up an index.
There are a few ways you can debug to get a unit's index. You could open a memory scanner like Cheat Engine and search for a property on the unit on SC (for example, search the HP of the unit, have the unit take damage, and repeat for the new value until you've found the address) and then figure out the index ID from there. You could also generate triggers for all indexes looking up some fixed value and spitting out a display text message.
You should only be counting doodad units; doodads that are just terrain and sprites don't get assigned an index. If you can select the doodad in-game, or if it has HP, it takes up an index.
Just to clarify by doodads I mean the installation traps/defences.
This still applies haha.
But interestingly enough I found that even though I have those doodads, my target unit still ends up at index 0, which is why I was having trouble with the trigger in the first place.
None.
An artist's depiction of an Extended Unit Death
But interestingly enough I found that even though I have those doodads, my target unit still ends up at index 0, which is why I was having trouble with the trigger in the first place.
Did you place the traps as doodads, or did you place them as units?
As units, which I didn't take into account, I guess I assumed that since they were from the doodad section under neutral they would be counted as such.
None.