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.
[10:41 am]
v9bettel -- Nice
[01:39 am]
Ultraviolet -- no u elky skeleton guy, I'll use em better
[10:50 pm]
Vrael -- Ultraviolet
Ultraviolet shouted: How about you all send me your minerals instead of washing them into the gambling void? I'm saving up for a new name color and/or glow
hey cut it out I'm getting all the minerals
[10:11 pm]
Ultraviolet -- :P
[10:11 pm]
Ultraviolet -- How about you all send me your minerals instead of washing them into the gambling void? I'm saving up for a new name color and/or glow
[2024-4-17. : 11:50 pm]
O)FaRTy1billion[MM] -- nice, now i have more than enough
[2024-4-17. : 11:49 pm]
O)FaRTy1billion[MM] -- if i don't gamble them away first
[2024-4-17. : 11:49 pm]
O)FaRTy1billion[MM] -- o, due to a donation i now have enough minerals to send you minerals
[2024-4-17. : 3:26 am]
O)FaRTy1billion[MM] -- i have to ask for minerals first tho cuz i don't have enough to send
[2024-4-17. : 1:53 am]
Vrael -- bet u'll ask for my minerals first and then just send me some lousy vespene gas instead
Please log in to shout.


Members Online: Revenant