Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Unit ID of created units
Unit ID of created units
Oct 25 2019, 5:26 am
By: Zoan  

Oct 25 2019, 5:26 am Zoan Post #1

Math + Physics + StarCraft = Zoan

I want players to control units with specified Unit ID's so I can do stuff like set their health and things.

However if their unit dies, can I reliably create another of the same unit that has that same ID? Or is there a way to prevent a unit from dying once it hits 0 hp, using EUDs?

What I'm worried about is if, for example, my map creates a different unit at the same time that the hero unit should be created (who I want to have the special Unit ID) and accidentally has that different unit assume the Unit ID I want reserved for the hero unit.



\:rip\:ooooo\:wob\:ooooo \:angel\: ooooo\:wob\:ooooo\:rip\:

Oct 25 2019, 2:46 pm MTiger156 Post #2

Veteran Mapper

Its a tricky concept. Though I haven't been able to nail this down, there's another technique that comes very close to this.
Assuming that there will only be 1 of the "hero unit" at a time, then its just a matter of using EUDs on that specific unit type.
To accomplish this across multiple players, each player's "hero" just needs to be a unique unit type.

For the specific trick of setting HP by quantity, try this sequence of actions:
-(EUD) Set max HP to target value
-(Standard) Set current HP to 100%
-(EUD) Set max HP back to original

Unfortunately, healing by quantity will require unit ID.




Oct 25 2019, 3:44 pm jjf28 Post #3

Cartography Artisan

Back in 1.16.1 the ordering was pretty well identified here: Identifying Index IDs

Your other option is looping through the units with EUDs as needed, then storing a pointer (address/4-0x0058A364) to the unit (or to a specific field in the unit) in a counter, which you can copy to current player value in memory (http://farty1billion.dyndns.org/EUDDB/?pg=entry&id=815), then use EUDs on current player. Because you never need addresses higher than the unit table your countoff from counter to current player need only go up to 221.

Post has been edited 2 time(s), last time on Oct 25 2019, 3:58 pm by jjf28.



TheNitesWhoSay - Clan Aura - github

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

Oct 25 2019, 4:06 pm Zoan Post #4

Math + Physics + StarCraft = Zoan

Hmm. These are some good options.

I also thought about it and I think so long as the hero units have the lowest indexes then I have at the top of the trigger list triggers that detect the respective players not commanding these units, it creates them for that player in the correct order.

If there is no unit production or transformation in the map then this should work, right?



\:rip\:ooooo\:wob\:ooooo \:angel\: ooooo\:wob\:ooooo\:rip\:

Oct 25 2019, 6:04 pm Zoan Post #5

Math + Physics + StarCraft = Zoan

Actually, can you explain the cp trick a bit more?

Is it like, let’s say I want to modify address 0xXXXXXXXX, say add 7 to it.

Then I set the CP address to 0xXXXXXXXX, thenn
Deaths Current Player, Terran Marine, add 7?

After this though don’t I have to set the CP address back to whatever it is for the player currently running the trigger, so that later if I do (deaths, Current Player, Terran Marine, blah blah) everything’s not screwey?

Edit: Ok I tested, and yes it's exactly as I described.

If player 1, you should set it back to 0,
player 2 should set it back to 1,
etc.

This is actually very useful! Cool ^^

Post has been edited 1 time(s), last time on Oct 25 2019, 10:19 pm by Zoan.



\:rip\:ooooo\:wob\:ooooo \:angel\: ooooo\:wob\:ooooo\:rip\:

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[07:00 pm]
Symmetry -- poo poo papa
[02:46 pm]
lil-Inferno -- pee pee child
[2026-6-27. : 6:10 pm]
Ultraviolet -- sweet summer child
[2026-6-26. : 10:31 am]
NudeRaider -- blessed innocent soul knows nothing of the strife we had before EUDs were discovered :teehee:
[2026-6-23. : 3:29 am]
DarkenedFantasies -- Probably just didn't care. For example, at some point before release, they've updated the graphics of some of the Protoss buildings (Forge, CyberCore, Citadel, Observatory, Arbiter Tribunal), but instead of properly re-rendering them with edited 3D models, they did crappy copy-paste jobs on the rendered graphics.
[2026-6-22. : 8:35 pm]
Ultraviolet -- :wob:
[2026-6-21. : 11:38 pm]
Symmetry -- :wob:
[2026-6-21. : 4:56 am]
Ultraviolet -- I suppose we'll likely never know, but my guess would be that they already saw it operating successfully and there was no monetary incentive to finish the original work. And the dev cycle in old school Blizzard was so hectic, it's possible it just got forgotten about after the original game got released. Plus there's an element of existing MPQ files that were packaged with the original discs becoming outdated if they updated it. And it's not like they remade the original MPQs, they just made new ones for BW specifically
[2026-6-21. : 4:26 am]
Oh_Man -- so that makes me think maybe the theory they are unfinished is not true and its a deliberate design decision, coz why not finish them wen ur making brood war?
[2026-6-21. : 4:25 am]
Oh_Man -- the thing is thos buildings are from classic. that means they went ahead and made brood war without ever finishing the 'unfinished' buildings
Please log in to shout.


Members Online: Moose