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.
[06:51 pm]
Vrael -- It is, and I could definitely use a company with a commitment to flexibility, quality, and customer satisfaction to provide effective solutions to dampness and humidity in my urban environment.
[06:50 pm]
NudeRaider -- Vrael
Vrael shouted: Idk, I was looking more for a dehumidifer company which maybe stands out as a beacon of relief amidst damp and unpredictable climates of bustling metropolises. Not sure Amazon qualifies
sounds like moisture control is often a pressing concern in your city
[06:50 pm]
Vrael -- Maybe here on the StarEdit Network I could look through the Forums for some Introductions to people who care about the Topics of Dehumidifiers and Carpet Cleaning?
[06:49 pm]
Vrael -- Perhaps even here I on the StarEdit Network I could look for some Introductions.
[06:48 pm]
Vrael -- On this Topic, I could definitely use some Introductions.
[06:48 pm]
Vrael -- Perhaps that utilizes cutting-edge technology and eco-friendly cleaning products?
[06:47 pm]
Vrael -- Do you know anyone with a deep understanding of the unique characteristics of your carpets, ensuring they receive the specialized care they deserve?
[06:45 pm]
NudeRaider -- Vrael
Vrael shouted: I've also recently becoming interested in Carpet Cleaning, but I'd like to find someone with a reputation for unparalleled quality and attention to detail.
beats me, but I'd make sure to pick the epitome of excellence and nothing less.
[06:41 pm]
Vrael -- It seems like I may need Introductions to multiple companies for the Topics that I care deeply about, even as early as Today, 6:03 am.
[06:38 pm]
Vrael -- I need a go-to solution and someone who understands that Carpets are more than just decorative elements in my home.
Please log in to shout.


Members Online: Roy