Im making this map right now and I decided I might use tbc. I know you would have to have a lot of triggers for everything action and stuff but what I can't figure out is how to perfectly 'damage' the unit. For example:
'X' attacks 'Y' with 'weapon'
Modify 'Y' hp: set to 89%
Or something like that... Now what confuses me is this!:
'X' attacks 'Y' with 'weapon'
Set 'Y' hitpoints to 79%
How do you do that? Its easy when the unit has full health or 1 hit point but how do you 'subtract' it?
There isn't a trigger for adding subtracting.. only setting.. there's probally a way around that will add like 100KB to your map though.. I dunno.. =/
Well the guy who made Blazing Fang did it pretty well...
You could put a unit that does a certain amount of damage and leave it next to the unit that you want hurt for a certain amount of time, or place infested terrans next to it one at a time until the desired amount of total damage has been dealt. So if a unit has 10 hitpoints, and you want to deal four damage to it, you can put a one-damage unit next to it for a length of time that allows it to fire four times, or put an infested terran next to it, let it attack (die), then another, and so on until four have attacked: You could even use a deathcount, where you set one deathcount to the amount of damage that is dealt to that unit. Then so long as the player has any deathcounts of that unit, and no infested terrans, create an infested terran next to the target and subtract a deathcount.
Actually I just figured out a way to do it but I dont think it would work... Like this:
'X' attacks 'Y'
Modify hit points for 'Y' Set to %
----//----\\----
'X' attacks 'Y'
Remove 'Y' at 'Somewhere'
Create 1 'Y' at 'Somewhere'
Modify hit points for 'Y': Set to %
That could work but I think it would take longer.... I wouldn't know Ive never done TBC.
You can just use a death counter to keep track of an enemy's HP. When one of the HP is supposed to be taken away, just subtract it from the counter. And to use the HP%, just have another counter for the unit number it is and amount of VHP it has to correctly show the percentage.
you can make multiple triggers with score conditions..
| Trigger |
| Players: |
| ¤ Player X |
| Conditions: |
¤ (Old conditions)
|
| ¤ Custom score is 0 |
| Actions: |
¤ Set life of 'Y' to 89%
|
¤ Modify score for Player X: add 1 score
|
| ¤ (other actions) |
| Trigger |
| Players: |
| ¤ Player X |
| Conditions: |
¤ (Old conditions)
|
| ¤ Custom score is 1 |
| Actions: |
¤ Set life of 'Y' to 79%
|
¤ Modify score for Player X: add 1 score
|
| ¤ (other actions) |
etc., etc.
You can use death counters, as Fwop_ suggested...
| Trigger |
| Players: |
| ¤ Player X |
| Conditions: |
¤ (Old conditions)
|
| ¤ Player Y has suffered exactly 0 deaths of khaydarin crystal |
| Actions: |
¤ Set life of 'Y' to 89%
|
¤ Modify death counts for player X: add 1 for khaydarin crystal.
|
| ¤ (other actions) |
| Trigger |
| Players: |
| ¤ Player X |
| Conditions: |
¤ (Old conditions)
|
| ¤ Player Y has suffered exactly 1 deaths of khaydarin crystal |
| Actions: |
¤ Set life of 'Y' to 79%
|
¤ Modify death counts for player X: add 1 for khaydarin crystal.
|
| ¤ (other actions) |
~~~This isn't exactly what Fwop was talking about but it's similar
Also, don't post the same topic twice....
Why you want to remove and put a new unit? You also can modify the HP of the 'old' unit directly:
X attacks Y first time:
set HP to 90%
X attacks Y second time:
set HP to 80%
...
But you have to count for the current HP of the unit somewhere and make an equation for every possible HP amount. Also you have to do this for every unit. And that could be a lot of triggers.
the ideal way to do this is with EUD conditions, which can detect the exact health and you can just subtract this manually. the problem is that EUDs are scrambled and are unusable and that they would be a pain to use because you would need almost a hundred triggers for every percentage point and you need to know the exact unit ID?
the best way is with a virtual HP system where your unit is invincible and enemies attack a burrowed or airborne unit above it. each unit would represent a percentage or a HP bar and you measure with death counters how many of these units have been killed and use triggers to set the hp accordingly.(keep in mind, when moving burrowed units under a ground unit, the latter will be slowed)
e.g.
burrowed ling = 10%hp
deathcounter = 1 zergling dead
set hp% to 90%
deathcounter = 7 lings dead
set hp% to 30%