Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: [SOLVED] Hydralisk Virus
[SOLVED] Hydralisk Virus
This topic is locked. You can no longer write replies here.
Sep 8 2011, 12:28 am
By: Mouse  

Sep 8 2011, 12:28 am Mouse Post #1



Hello everyone. I am trying to make a virus that is spread through whatever the Hydralisk touches. So when Hydralisk touches unit A, it slowly loses health. It will lose 10% from what it CURRENTLY IS not set to 90%, then slowly go down 10% every second till it reaches 10% and doesn't kill it. The problem is, mine always loops with a preserve trigger. But when I take out the preserve trigger, it only works once. And then if possible, I would like all of the unit's healths to go back to 100% when the Hydralisk is killed. Is there a way to do this without EUD's? If so, please make a test map so that I can see or help me with some specific triggers because all my switches are taken and I've been using DC's a lot in my map. Thanks in advance!

~Mouse



None.

Sep 8 2011, 12:33 am Roy Post #2

An artist's depiction of an Extended Unit Death

Without EUDs? Not directly. There is no way to detect a unit's HP without using extended conditions.

You may want to look into a virtual hp system and see if you can use that in your map. You probably have enough DCs remaining to do it.




Sep 8 2011, 12:36 am Mouse Post #3



I don't 100% understand how this would work. The explanation on that site is kind of confusing.



None.

Sep 8 2011, 12:43 am Roy Post #4

An artist's depiction of an Extended Unit Death

In the most primitive sense, it is saying that you must detect when the unit is being attacked, and subtract from an artificial counter when this happens. If you review the Burrowed vHP system, it states that a unit is made to be invincible, but a number of burrowed units that are vulnerable are always below the unit. In this effect, it looks like the unit is being shot, when in actuality it's the units beneath that particular unit.

So if you wanted to "give" a unit 10 HP, you'd have 10 one-hit burrowed units always centered beneath them. When all of those units are dead, the unit "has" 0 HP and you can kill it. So to employ the poison effect, you would remove one unit to drop 10% and keep doing this until only one unit remains.

Edit: Out of curiosity, why do you want to avoid EUDs? They would be the most seamless solution to your problem. Is it because you cannot track the Index IDs for the units?




Sep 8 2011, 12:48 am Mouse Post #5



But there is no way for it to say it has 10% damage done to it because I can't tell if a different unit attacked it during this trigger. Plus the trigger loops with the preserve trigger so if that one unit gets down to 10% and it goes back next to the Hydralisk, it will go back into that loop again. I'll attach a test map to show you what I mean. In the test map, put the hydralisk next to the firebat and the ultralisk.

Attachments:
test.scm
Hits: 1 Size: 37.75kb



None.

Sep 8 2011, 1:17 am Roy Post #6

An artist's depiction of an Extended Unit Death

Your trigger is definitely going to experience wait blocks with the current setup. You should replace the waits with a death counter system of some sort. You also need a way to uniquely identify the different units using something like http://www.staredit.net/topic/11454/ (which can be applied only to the infected units). I would say that you'd need a good number of locations for this, depending on how many units can become infected at one time.

Anyway, your basic setup would be like this:

- unit enters infection_location
- Infection_1_DC is exactly 0
- bring 0 unit to lid_1
-> center location lid_1 on unit at infection_location
-> Set Infection_1_DC to 216
-> preserve

- Infection_1_DC is at least 1
- bring 1 unit to lid_1
-> center lid_1 on unit at lid_1
-> subtract 1 from Infection_1_DC
-> preserve

- Infection_1_DC is exactly 204
- bring 1 unit to lid_1
-> (Health drop by 10%)
-> preserve

- Infection_1_DC is exactly 192
- bring 1 unit to lid_1
-> (Health drop by 10%)
-> preserve

- Infection_1_DC is exactly 180
- bring 1 unit to lid_1
-> (Health drop by 10%)
-> preserve

.
.
.

- Infection_1_DC is exactly 120
- bring 1 unit to lid_1
-> (Health drop by 10%)
-> preserve

- Infection_1_DC is exactly 108
- bring 1 unit to lid_1
-> (Health increase by 10%)
-> preserve

- Infection_1_DC is exactly 96
- bring 1 unit to lid_1
-> (Health increase by 10%)
-> preserve

.
.
.


- Infection_1_DC is exactly 0
- bring 1 unit to lid_1
-> (Health increase by 10%)
-> Move lid_1 to unused_corner_of_map
-> preserve


(I chose to start with 216 deaths because 12 DCs is approximately 1 second, and you're going from 100 to 10 to 100 in increments of 10, which takes 18 steps total.)
That would be the effect for one unit being infected, but this is completely disregarding the original issue, which is that you have no way to detect the current HP of the unit through conditions without resorting to EUDs (and EUDs would be too messy for this problem, anyway). That's why I suggested a vHP system, so you have some way to keep track of the unit's HP. Once you use a system like that, you'll need additional conditions to the above trigger to make sure you don't subtract by 10% when the unit doesn't have more than 10% HP and doesn't add more than what the unit started with.

To use the above method on units simultaneously, you'd need multiple lid locations and infection counters (one for each simultaneously infected unit).




Sep 8 2011, 1:33 am Lanthanide Post #7



Personally I'd find this sort of behaviour so difficult to implement properly without bugs, and so limited due to Starcraft's restrictions, that I'd just abandon it and come up with something more feasible.



None.

Sep 8 2011, 1:36 am Mouse Post #8



On a completely different side note: If I want a Disruption web to appear, how do I do that with an AI Script? I tried having a corsair owned by Current Player and then Running AI Script for it. What is wrong?



None.

Sep 8 2011, 1:41 am Roy Post #9

An artist's depiction of an Extended Unit Death

AI Scripts do not work for human players; it must be owned by a computer. Also, it must have enough energy to cast, and must have the ability available for the player that owns it.




Sep 8 2011, 1:55 am Azrael Post #10



What kind of units do you want to make infected, and is it possible they will move while infected? If you want to use an LID approach, it will only work on certain unit types if they move (ones that don't move too fast, basically). You'll likely need LIDs no matter what, in which case make sure the infected units will either be stationary or are unit types which work while moving.

The most efficient approach is probably EUD, but it will only work if all the infected units are preplaced. If they have to be created during the game, keeping track of them is too complicated for general purposes.

There's also vHP, which Roy has described already.

Another option is to create a system that damages the infected unit with an actual unit attack, the damage of which would be 10% of the infected unit's max life. The problem with this would be that you'd either need to move the infected unit away and back (and doing that every second would basically make the unit stationary, constantly stopping), or you'd have to move a unit to it (which, even if you could manage a working system, is going to show the attack animation no matter what). It would also be hard to account for the fact that you aren't detecting the HP, so the attacks will continue even if they would kill the unit.

One more possibility is setting up an area on the map to force a Defiler to cast Plague on any unit that's moved there. Then you could move the unit there, have it be Plagued, and move it back to where it was. It would keep going to 1% health, but it's basically the effect you're looking for already made for you. The problem is that people have had very little success getting Plague to consistently work, and usually abandon trying. It's possible that if you experimented with AI scripts, had a number of hostile Defilers, and made some tweaks (like having a bunch of other units spawn at the Defiler location when you move the infected units there, things like that) that you may be able to get something working.

If it was me, I would opt for the EUD approach, making a system that allows for all possibly infected units to be preplaced, even if I had to store them in an unused area of the map until they were needed. That way you can detect their health, which allows you to directly subtract 10% of their current HP and stop the infection when their health reaches 10%.

Also, I'd advise against using Waits in general, DC timers are the way to go.




Sep 8 2011, 2:05 am Mouse Post #11



Thanks for the help guys. ^^



None.

Sep 8 2011, 4:01 am Sacrieur Post #12

Still Napping

LIDs don't work on Hydralisks, but they may work on slowed Hydralisks.



None.

Sep 8 2011, 4:08 am Azrael Post #13



Hydralisks don't necessarily need LIDs, the units they are infecting are the ones which almost certainly do.




Sep 8 2011, 4:10 am Sacrieur Post #14

Still Napping

So LID the infected ones and make them slower.



None.

Sep 8 2011, 4:25 am Azrael Post #15



They don't necessarily need to be slower since there's no information regarding what unit types can be infected.




Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[09:19 am]
Linekat -- cool
[01:56 am]
Oh_Man -- cool bit of history, spellsword creator talking about the history of EUD ^
[09:24 pm]
Moose -- denis
[05:00 pm]
lil-Inferno -- benis
[2024-4-19. : 10:41 am]
v9bettel -- Nice
[2024-4-19. : 1:39 am]
Ultraviolet -- no u elky skeleton guy, I'll use em better
[2024-4-18. : 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
[2024-4-18. : 10:11 pm]
Ultraviolet -- :P
[2024-4-18. : 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
Please log in to shout.


Members Online: Roy