For several months, I've been watching Korean maps being played on youtube in order to learn and replicate their EUD techniques (Koreans are WAY ahead on EUD knowledge, if you didn't know).
One thing I haven't solved is how they push regen/recharge rates as high as 40/sec. Maybe I'm just not looking hard enough at the available memory addresses?
(All of this is being done on Remastered multiplayer, so very unlikely it was modded)
There's no memory address for it, beyond turning the standard protoss shield or zerg HP regen on or off.
They'll simply be running a loop that adds shields / HP every execution to each unit via the cUnit struct. Simple. I did it in the last version of my DS Night Remastered map 3.21 for the Roach , Immortal and Void Ray units.
None.
Ohhh ok.
I'd like to employ this is a current project, but the necessary unit indexes would not be known ahead of time. Considering that you did regen EUDs in a DS map (involving tons of units killing eachother constantly), there's a way to "get" unit indexes by unit type and player ownership, right?
In my case, each player would own 1 of a unique unit type, so that already narrows it down. The problem then lies in how to handle respawning it and getting the new index.
I just loop over all 1700 units and check if the unit type == Roach, if it does, add some HP.
You can loop over units owned by only particular players, to reduce the CPU load of the loop operation.
In the EUD Channel in SEN Discord, Armo gave an explanation a week or two ago for how you can use variables to track specific units. If a player only has a fixed number of units at a time and you only have to deal with respawning of them occasionally, then using variables to track specific units is a tenable approach.
None.
For anyone's benefit who reads this topic later, here's a private message between SPyro_Malin and myself:
Hey there, you seem to have worked out this
http://www.staredit.net/topic/17741/#6How do you add some hp to unit instead of setting it to a %? Or is it just giant loop of detecting exact ammount of hp and setting it slighty higher?
Hey, it's a little more elegant than that. I use EUD Editor 2 for this purpose. Here's an image of the advanced portion of EUD Editor 2's TriggerEditor where I have a trigger from one of my maps to regenerate HP for any Fenix (Zealot) owned by Player 1:
The first part is a For All Unit loop with Player 1 as the selected player which simply cycles through all of Player 1's units every trigger cycle. Then I create a new If condition which is basically a standard trigger and I set the conditions to detect if the unit being pointed at is a Fenix (Zealot) and if its HP is at most 149 (HP is stored where every single value we can see = 256 because the last section is used for detecting partial HP for regeneration, so 149*256 = 38144). These conditions can be found under "Structure" then "CUnitData" in EUD Editor 2's TriggerEditor. The first field I always set to ptr which just tells it to detect whichever unit is currently being pointed at in the for loop. The second field tells you what data you're checking. I use unitType to detect if the unit is Fenix or not and hitPoints to detect quantity of HP. Once you have your conditions, you must decide what you're going to do to the unit if the conditions are met. So for actions in the case, we do a similar thing. We create a new action and go to "Structure" then "AddCUnitData". For HP regeneration we'll add a quantity to ptr for hitPoints. This quantity will be added every trigger loop (so once every ~2 seconds with non-hyper triggers, 12 times per second with hyper triggers and 24 times per second with ultra hyper triggers, on fastest game speed). So in my example, my map has hyper triggers and the Fenix (Zealot) unit also has (Zerg) Regeneration ticked under his advanced settings. So every second he will regenerate 14*12 + 4*24 (4 is the quantity of hp regenerated with zerg regeneration and it is regenerated once per frame which is 24 per second on fastest game speed) = 264/256 =~ 1 HP/s (1.03125 precisely). I detect that his HP is under 149 in the health regeneration trigger because adding CUnitData doesn't consider what the max HP of the unit is. In my map Fenix's max HP is 150, so I make sure the regeneration trigger won't operate if his current HP is above 149.