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.



Rs_yes-im4real - Clan Aura - jjf28.net84.net

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.
[05:45 am]
Kolokol -- Okay, are both of these games referencing something else here? If so, what are they both referencing?
[05:45 am]
Kolokol -- So I am looking at the custom campaign "Legacy of the Confederation". One of the missions has references such as "Doctor Halsey" and "Noble", but the campaign was made almost 10 years before Halo Reach.
[02:55 am]
Dem0n -- ya
[02:45 am]
Wing Zero -- Ah damn it Demon
[02:03 am]
KrayZee -- Yeah, we just need 3 more. We can get a complete F if it's 4.
[10:06 pm]
jjf28 -- i'll take that advice into cooperation
[07:43 pm]
KrayZee -- Okay, but we need other people to cooperate and not ruin it
[2020-2-26. : 6:27 pm]
Wing Zero -- Next we need to spell out F in the boxes
[2020-2-26. : 5:25 pm]
Sie_Sayoka -- the i is silent
[2020-2-26. : 4:58 pm]
NudeRaider -- for a second I thought Sie was talking about CUNTs
Please log in to shout.


Members Online: NudeRaider, kasztaner124543, jjf28