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:48 pm]
Ultraviolet -- :wob:
[2024-4-21. : 1:32 pm]
Oh_Man -- I will
[2024-4-20. : 11:29 pm]
Zoan -- Oh_Man
Oh_Man shouted: yeah i'm tryin to go through all the greatest hits and get the runs up on youtube so my senile ass can appreciate them more readily
You should do my Delirus map too; it's a little cocky to say but I still think it's actually just a good game lol
[2024-4-20. : 8:20 pm]
Ultraviolet -- Goons were functioning like stalkers, I think a valk was made into a banshee, all sorts of cool shit
[2024-4-20. : 8:20 pm]
Ultraviolet -- Oh wait, no I saw something else. It was more melee style, and guys were doing warpgate shit and morphing lings into banelings (Infested terran graphics)
[2024-4-20. : 8:18 pm]
Ultraviolet -- Oh_Man
Oh_Man shouted: lol SC2 in SC1: https://youtu.be/pChWu_eRQZI
oh ya I saw that when Armo posted it on Discord, pretty crazy
[2024-4-20. : 8:09 pm]
Vrael -- thats less than half of what I thought I'd need, better figure out how to open SCMDraft on windows 11
[2024-4-20. : 8:09 pm]
Vrael -- woo baby talk about a time crunch
[2024-4-20. : 8:08 pm]
Vrael -- Oh_Man
Oh_Man shouted: yeah i'm tryin to go through all the greatest hits and get the runs up on youtube so my senile ass can appreciate them more readily
so that gives me approximately 27 more years to finish tenebrous before you get to it?
[2024-4-20. : 7:56 pm]
Oh_Man -- lol SC2 in SC1: https://youtu.be/pChWu_eRQZI
Please log in to shout.


Members Online: Roy