• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

TD problem Kills a unit

Status
Not open for further replies.
Create a damage upgrade and increase the level of the upgrade when the tower kills a unit. This will affect all towers of that type own by that player though.

Or.

Make the tower a hero unit and increase it's primary stat when it kills a unit. Set the damage increase per primary point in Gameplay -> Constants

Or.

Give the tower an inventory from which items cannot be dropped but can be used.
When the tower kills a unit give said tower a +dmg item.
If the tower has a +dmg already, remove that before adding the new item.
This require you to make a lot of differet +dmg items.

Or. (Perhaps the best way)

Create a custom aura based on Trueshot Aura with "flat" damage increase and with as many levels as you want the tower to be able to increase it's damage.
When the tower kills a unit set the aura to the current level of that aura +1.
 
Level 5
Joined
Jan 27, 2014
Messages
164
You'll need to trigger this.
Try this mini snippet:
http://www.thehelper.net/forums/showthread.php/127278-Set-Damage
You just need 5 abilities with 10 levels each.
It will give you a range of 1 to 99999 damage.

To add damage on every kill, just do this:
Code:
    Events
        Unit - A unit dies
    Conditions
        Unit Type of (Killing unit) Equal to YourTowerType
    Actions
        Set Int_DamageSys_ADDdamage = 1 <-- This will add 1 damage per kill
        Set Unit_DamageSys_Unit = (Killing unit)
        Trigger - Run Damage System <gen> (checking conditions)
 
Level 3
Joined
Feb 9, 2014
Messages
45
You'll need to trigger this.
Try this mini snippet:
http://www.thehelper.net/forums/showthread.php/127278-Set-Damage
You just need 5 abilities with 10 levels each.
It will give you a range of 1 to 99999 damage.

To add damage on every kill, just do this:
Code:
    Events
        Unit - A unit dies
    Conditions
        Unit Type of (Killing unit) Equal to YourTowerType
    Actions
        Set Int_DamageSys_ADDdamage = 1 <-- This will add 1 damage per kill
        Set Unit_DamageSys_Unit = (Killing unit)
        Trigger - Run Damage System <gen> (checking conditions)

i tried, but doesn't work.
what did i do wrong.. this is the trigger.. :(

  • Tower Damage
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Killing unit)) Equal to Transformed Pool Elemental
    • Actions
      • Set Int_DamageSys_AddDamage = 1
      • Set Unit_DamageSys_Unit = (Killing unit)
      • Trigger - Run Damage System <gen> (checking conditions)
  • Damage System
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Abi_DamageSys_Damage[1] for Unit_DamageSys_Unit) Equal to 0
        • Then - Actions
          • For each (Integer A) from 1 to Int_DamageSys_DigitCount, do (Actions)
            • Loop - Actions
              • Unit - Add Abi_DamageSys_Damage[(Integer A)] to Unit_DamageSys_Unit
        • Else - Actions
      • Set Int_DamageSys_CurrentDmg = 0
      • For each (Integer A) from 1 to Int_DamageSys_DigitCount, do (Actions)
        • Loop - Actions
          • Set Int_DamageSys_CurrentDmg = (Int_DamageSys_CurrentDmg + (((Level of Abi_DamageSys_Damage[(Integer A)] for Unit_DamageSys_Unit) - 1) x (Integer((Power(10.00, ((Real((Integer A))) - 1.00)))))))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Int_DamageSys_ADDdamage Greater than 0
        • Then - Actions
          • Set Int_DamageSys_ADDdamage = (Int_DamageSys_ADDdamage + Int_DamageSys_CurrentDmg)
          • For each (Integer A) from 1 to Int_DamageSys_DigitCount, do (Actions)
            • Loop - Actions
              • Set Int_General = ((Int_DamageSys_ADDdamage mod (Integer((Power(10.00, (Real((Integer A)))))))) / (Integer((Power(10.00, ((Real((Integer A))) - 1.00))))))
              • Unit - Set level of Abi_DamageSys_Damage[(Integer A)] for Unit_DamageSys_Unit to (Int_General + 1)
        • Else - Actions
          • For each (Integer A) from 1 to Int_DamageSys_DigitCount, do (Actions)
            • Loop - Actions
              • Unit - Set level of Abi_DamageSys_Damage[(Integer A)] for Unit_DamageSys_Unit to 1
              • Set Int_General = ((Int_DamageSys_SETdamage mod (Integer((Power(10.00, (Real((Integer A)))))))) / (Integer((Power(10.00, ((Real((Integer A))) - 1.00))))))
              • Unit - Set level of Abi_DamageSys_Damage[(Integer A)] for Unit_DamageSys_Unit to (Int_General + 1)
      • Set Int_DamageSys_ADDdamage = 0
      • Set Int_DamageSys_SETdamage = 0
  • Damage System Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Int_DamageSys_DigitCount = 1
      • Set Abi_DamageSys_Damage[1] = Pool Blessing +25
i change the Damage System Init trigger.
because i have only 1 ability for it. +25 - +500 .. :ogre_icwydt:
 
Level 5
Joined
Jan 27, 2014
Messages
164
> because i have only 1 ability for it. +25 - +500
You strictly need to have 5 abilities.
Simple.
Create 5 damage bonus ability. Each will have 10 levels.
And then set the damage value for each level according to the sample map.

Of course you can even have 3 or 4 abilities, but only if you know what you're doing.
So I advice you to use 5 abilities.

You can use this system on all of your other units.

Edit:
On a related note, add this line of action in the map init if you wanna prevent the first instance lag:
Code:
Damage System Init
    Events
        Map initialization
    Conditions
    Actions
        Set Int_DamageSys_DigitCount = 5
        Set Abi_DamageSys_Damage[1] = Damage (1x) 
        Set Abi_DamageSys_Damage[2] = Damage (10x) 
        Set Abi_DamageSys_Damage[3] = Damage (100x) 
        Set Abi_DamageSys_Damage[4] = Damage (1000x) 
        Set Abi_DamageSys_Damage[5] = Damage (10000x) 
        [i]Unit - Create 1 Footman for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
        For each (Integer A) from 1 to Int_DamageSys_DigitCount, do (Actions)
            Loop - Actions
                Unit - Add Abi_DamageSys_Damage[(Integer A)] to (Last created unit)
        Unit - Remove (Last created unit) from the game[/i]
Then again, most computers now are pretty fast.
Some may not even notice the small amount of lag.
 
Last edited:
I prefer the best approach though, this offers more than just a damage bonus system.
While it looks complex, it's actually not.
You can use http://www.hiveworkshop.com/forums/...css-v1-5g-229885/?prev=d=list&r=20&u=Doomlord by Doomlord to handle damage bonus.
Read the first post (the description) carefully, especially the What if I don't want to use your stinky item system and only the BonusMod alternative?
This offers from -131072 to 131071 stat bonus. It's also pretty simple to implement, if you have JNGP.
 
Level 3
Joined
Feb 9, 2014
Messages
45
> because i have only 1 ability for it. +25 - +500
You strictly need to have 5 abilities.
Simple.
Create 5 damage bonus ability. Each will have 10 levels.
And then set the damage value for each level according to the sample map.

Of course you can even have 3 or 4 abilities, but only if you know what you're doing.
So I advice you to use 5 abilities.

You can use this system on all of your other units.

Edit:
On a related note, add this line of action in the map init if you wanna prevent the first instance lag:
Code:
Damage System Init
    Events
        Map initialization
    Conditions
    Actions
        Set Int_DamageSys_DigitCount = 5
        Set Abi_DamageSys_Damage[1] = Damage (1x) 
        Set Abi_DamageSys_Damage[2] = Damage (10x) 
        Set Abi_DamageSys_Damage[3] = Damage (100x) 
        Set Abi_DamageSys_Damage[4] = Damage (1000x) 
        Set Abi_DamageSys_Damage[5] = Damage (10000x) 
        [i]Unit - Create 1 Footman for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
        For each (Integer A) from 1 to Int_DamageSys_DigitCount, do (Actions)
            Loop - Actions
                Unit - Add Abi_DamageSys_Damage[(Integer A)] to (Last created unit)
        Unit - Remove (Last created unit) from the game[/i]
Then again, most computers now are pretty fast.
Some may not even notice the small amount of lag.

doesn't work also :goblin_cry:even , it further worsen the situation and added me some problem..
i set the unit creep spawn to 20 last i'd make and it is working, but when i add this trigger, that change the spawn of the creeps.. and now, the creeps will only spawn 6 units.
this is the picture..
no damage was added
377c35ae1410ef9d0ab53f134387e17d_80055.jpg


these are the triggers.

  • Tower Damage
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Killing unit)) Equal to Transformed Pool Elemental
    • Actions
      • Set Int_DamageSys_AddDamage = 2
      • Set Unit_DamageSys_Unit = (Killing unit)
      • Trigger - Run Damage System <gen> (checking conditions)
  • Damage System
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Abi_DamageSys_Damage[1] for Unit_DamageSys_Unit) Equal to 0
        • Then - Actions
          • For each (Integer A) from 1 to Int_DamageSys_DigitCount, do (Actions)
            • Loop - Actions
              • Unit - Add Abi_DamageSys_Damage[(Integer A)] to Unit_DamageSys_Unit
        • Else - Actions
      • Set Int_DamageSys_CurrentDmg = 0
      • For each (Integer A) from 1 to Int_DamageSys_DigitCount, do (Actions)
        • Loop - Actions
          • Set Int_DamageSys_CurrentDmg = (Int_DamageSys_CurrentDmg + (((Level of Abi_DamageSys_Damage[(Integer A)] for Unit_DamageSys_Unit) - 1) x (Integer((Power(10.00, ((Real((Integer A))) - 1.00)))))))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Int_DamageSys_ADDdamage Greater than 0
        • Then - Actions
          • Set Int_DamageSys_ADDdamage = (Int_DamageSys_ADDdamage + Int_DamageSys_CurrentDmg)
          • For each (Integer A) from 1 to Int_DamageSys_DigitCount, do (Actions)
            • Loop - Actions
              • Set Int_General = ((Int_DamageSys_ADDdamage mod (Integer((Power(10.00, (Real((Integer A)))))))) / (Integer((Power(10.00, ((Real((Integer A))) - 1.00))))))
              • Unit - Set level of Abi_DamageSys_Damage[(Integer A)] for Unit_DamageSys_Unit to (Int_General + 1)
        • Else - Actions
          • For each (Integer A) from 1 to Int_DamageSys_DigitCount, do (Actions)
            • Loop - Actions
              • Unit - Set level of Abi_DamageSys_Damage[(Integer A)] for Unit_DamageSys_Unit to 1
              • Set Int_General = ((Int_DamageSys_SETdamage mod (Integer((Power(10.00, (Real((Integer A)))))))) / (Integer((Power(10.00, ((Real((Integer A))) - 1.00))))))
              • Unit - Set level of Abi_DamageSys_Damage[(Integer A)] for Unit_DamageSys_Unit to (Int_General + 1)
      • Set Int_DamageSys_ADDdamage = 0
      • Set Int_DamageSys_SETdamage = 0
  • Damage System Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Int_DamageSys_DigitCount = 5
      • Set Abi_DamageSys_Damage[1] = Pool Blessing 0-100
      • Set Abi_DamageSys_Damage[2] = Pool Blessing 100-200
      • Set Abi_DamageSys_Damage[3] = Pool Blessing 200-300
      • Set Abi_DamageSys_Damage[4] = Pool Blessing 300-400
      • Set Abi_DamageSys_Damage[5] = Pool Blessing 400-500
      • Unit - Create 1 Footman for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
      • For each (Integer A) from 1 to Int_DamageSys_DigitCount, do (Actions)
        • Loop - Actions
          • Unit - Add Abi_DamageSys_Damage[(Integer A)] to (Last created unit)
          • Unit - Remove (Last created unit) from the game
I prefer the best approach though, this offers more than just a damage bonus system.
While it looks complex, it's actually not.
You can use http://www.hiveworkshop.com/forums/...css-v1-5g-229885/?prev=d=list&r=20&u=Doomlord by Doomlord to handle damage bonus.
Read the first post (the description) carefully, especially the What if I don't want to use your stinky item system and only the BonusMod alternative?
This offers from -131072 to 131071 stat bonus. It's also pretty simple to implement, if you have JNGP.

o don't know how to use JAZZ..
i'm too lazy to read more tutorials.
hard to understand JAZZ.. :(
 
Not JAZZ but Jass.
That don't require too much Jass knowledge. All you need is JNGP and a Laptop that can run Macros (64 Bits are said to have issues with Lua AFAIR).
Just follow the instruction of how to implement the BonusMod alternative and you're pretty much issue-less, it also allows you to add/reduce armor, strength, agility, intelligence, hit-points, mana-points, hit/mana-points regeneration, and sight range. More than just adding damage bonus.
 
Level 3
Joined
Feb 9, 2014
Messages
45
Not JAZZ but Jass.
That don't require too much Jass knowledge. All you need is JNGP and a Laptop that can run Macros (64 Bits are said to have issues with Lua AFAIR).
Just follow the instruction of how to implement the BonusMod alternative and you're pretty much issue-less, it also allows you to add/reduce armor, strength, agility, intelligence, hit-points, mana-points, hit/mana-points regeneration, and sight range. More than just adding damage bonus.

oh.. is it compatible on PC ?
btw, nice site though..
 
Level 5
Joined
Jan 27, 2014
Messages
164
Set Int_DamageSys_DigitCount = 5
Set Abi_DamageSys_Damage[1] = Pool Blessing 0-100
Set Abi_DamageSys_Damage[2] = Pool Blessing 100-200
Set Abi_DamageSys_Damage[3] = Pool Blessing 200-300
Set Abi_DamageSys_Damage[4] = Pool Blessing 300-400
Set Abi_DamageSys_Damage[5] = Pool Blessing 400-500
Did you check out the test map?
According to your description here, the damage values are completely wrong.
Imitate the damage values as in the demo map.
Or perhaps you could upload your map and I'll try fix it (depending on when you upload though).

Anyway,
Code:
Item damage bonus 1: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 damage (from level 1 to 10)
Item damage bonus 2: 0, 10, 20, 30, 40, 50, 60, 70, 80, 90 damage (from level 1 to 10)
Item damage bonus 3: 0, 100, 200, 300, 400, 500, 600, 700, 800, 900 damage (from level 1 to 10)
Item damage bonus 4: 0, 1000, 2000, 3000, 4000, 5000, 6000, 7000, 8000, 9000 damage (from level 1 to 10)
Item damage bonus 4: 0, 10000, 20000, 30000, 40000, 50000, 60000, 70000, 80000, 90000 damage (from level 1 to 10)

The mini system shouldn't affect your other triggers, unless of course, if you have clashing of variables.


Edit: And for your Damage System Init trigger, the 'Remove last created unit' should be outside the loop. This could be the reason why your spawn units are not correctly numbered, though unlikely.
 
Level 3
Joined
Feb 9, 2014
Messages
45
it is compatible AFAIR.
try run the Lua yourself in JassNewGenPack. See if it's working.

Can you givve me a link of the simplest tutorial and not boring to read about Jass ?

Did you check out the test map?
According to your description here, the damage values are completely wrong.
Imitate the damage values as in the demo map.
Or perhaps you could upload your map and I'll try fix it (depending on when you upload though).

Anyway,
Code:
Item damage bonus 1: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 damage (from level 1 to 10)
Item damage bonus 2: 0, 10, 20, 30, 40, 50, 60, 70, 80, 90 damage (from level 1 to 10)
Item damage bonus 3: 0, 100, 200, 300, 400, 500, 600, 700, 800, 900 damage (from level 1 to 10)
Item damage bonus 4: 0, 1000, 2000, 3000, 4000, 5000, 6000, 7000, 8000, 9000 damage (from level 1 to 10)
Item damage bonus 4: 0, 10000, 20000, 30000, 40000, 50000, 60000, 70000, 80000, 90000 damage (from level 1 to 10)

The mini system shouldn't affect your other triggers, unless of course, if you have clashing of variables.


Edit: And for your Damage System Init trigger, the 'Remove last created unit' should be outside the loop. This could be the reason why your spawn units are not correctly numbered, though unlikely.

Wait, i will delete the trigger first, so that, you will not confused..
btw, the tower that i have to add damage is Pool Elemental :)
 
Level 5
Joined
Jan 27, 2014
Messages
164
> not boring to read about Jass ?
Seriously, if you have problems import this simple GUI snippet into your map, you're gonna get more headache when you deal with the JASS one.
There are also item abilities that you need to set to respective damage values.

At the end of the day, the most important thing is to understand the instructions and you'll do fine. :)
 
Level 3
Joined
Feb 9, 2014
Messages
45
> not boring to read about Jass ?
Seriously, if you have problems import this simple GUI snippet into your map, you're gonna get more headache when you deal with the JASS one.
There are also item abilities that you need to set to respective damage values.

At the end of the day, the most important thing is to understand the instructions and you'll do fine. :)

is Jass are hard to use ?
 
is Jass are hard to use ?
No, it's not difficult.
Actually, the script I show you only uses one custom script line to add damage bonus (it also supports other stuffs, if you know BonusMod by Earth-Fury, you know what I mean).
It's not complicated to import actually, as long as you follow the importing guide in the system I linked to you properly.

Can you givve me a link of the simplest tutorial and not boring to read about Jass ?
Jass is boring to look at in normal WE, try JassNewGenPack, it colors Jass syntax, making them more fun to read than in normal WE.
You can't avoid Jass forever, you need to use them in some situations, GUI has many limits. You can corporate Jass in GUI using Custom Script, remember that.
 
Status
Not open for further replies.
Top