Tower get bonus damage when attacking the same target 5 times in a row (help)

Exoudar

New Member
Reaction score
2
Hello there, I managed to make my tower get bonus damage, speed and anything after attacking the same target 5 times, and if it change the target the bonus will be lost, Also if it attacks any target 3 times then start to another target it will have to build 5 attacks and not to continue from the 3 attacks.

What do I need?

the trigger I made is very complicated and needs a lot of times and actions.

Here's how I did it :

First I need to set my targets.

Trigger:
  • Setting Targets
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Owner of (Attacked unit)) Equal to Player 12 (Brown)
      • (Unit-type of (Attacking unit)) Equal to Sniper Tower
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Sniper_Target Equal to 0
        • Then - Actions
          • Set Sniper_Aim[1] = (Attacking unit)
          • Set Sniper_Target = 1
          • Set Sniper_Targ[1] = (Attacked unit)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Sniper_Target Equal to 1
          • (Attacking unit) Not equal to Sniper_Aim[1]
        • Then - Actions
          • Set Sniper_Aim[2] = (Attacking unit)
          • Set Sniper_Target = 2
          • Set Sniper_Targ[2] = (Attacked unit)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Sniper_Target Equal to 2
          • (Attacking unit) Not equal to Sniper_Aim[1]
          • (Attacking unit) Not equal to Sniper_Aim[2]
        • Then - Actions
          • Set Sniper_Aim[3] = (Attacking unit)
          • Set Sniper_Target = 3
          • Set Sniper_Targ[3] = (Attacked unit)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Sniper_Target Equal to 3
          • (Attacking unit) Not equal to Sniper_Aim[1]
          • (Attacking unit) Not equal to Sniper_Aim[2]
          • (Attacking unit) Not equal to Sniper_Aim[3]
        • Then - Actions
          • Set Sniper_Aim[4] = (Attacking unit)
          • Set Sniper_Target = 4
          • Set Sniper_Targ[4] = (Attacked unit)
        • Else - Actions



And then the trigger:

Trigger:
  • Carful Aim
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Owner of (Attacked unit)) Equal to Player 12 (Brown)
      • (Unit-type of (Attacking unit)) Equal to Sniper Tower
    • Actions
      • For each (Integer A) from 1 to 4, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Attacking unit) Equal to Sniper_Aim[(Integer A)]
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Attacked unit) Equal to Sniper_Targ[(Integer A)]
                • Then - Actions
                  • Wait 0.40 seconds
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Custom value of (Attacking unit)) Less than or equal to 4
                    • Then - Actions
                      • Unit - Set the custom value of (Attacking unit) to ((Custom value of (Attacking unit)) + 1)
                    • Else - Actions
                • Else - Actions
                  • Unit - Set the custom value of (Attacking unit) to 0
                  • Unit - Remove Item Damage Bonus (+10) from (Attacking unit)
                  • Unit - Remove Carful Aiming (Sniper Tower) from (Attacking unit)
              • Wait 0.30 seconds
              • Set Sniper_Targ[(Integer A)] = (Attacked unit)
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Custom value of (Attacking unit)) Equal to 3
        • Then - Actions
          • Wait 0.40 seconds
          • Unit - Add Item Damage Bonus (+10) to (Attacking unit)
          • Unit - Add Carful Aiming (Sniper Tower) to (Attacking unit)
        • Else - Actions



My problem is with the first trigger (Setting targets), It requires a lot of actions, If the player need to make 10 towers, then I have to set 10 targets, and look how big it is with 4 targets only, now lets assume the player will make infinite towers :(


the second trigger is fine, please help with the first one.
 

Inflicted

Currently inactive
Reaction score
63
Good timing, I'm actually in the process of making a system/spell which is of the same effect called Empowered Strikes. Using Hashtables to make it MUI.

If I complete it, then I will make a demo map for you that is adjusted to work for only your type of unit.

Here is the link to my Thread: Empowered Strikes Hashtable In Process

Only difference is that my additional damage is dealt in magic damage, do you want it to be added and display the additional value (eg +100)?
That might actually be much easier. I can do that in like 20 minutes if that's what you want.


Okay i had time, so I did a quick version. I know it does not implement a GDD system, but for a simple usage, this is effective.

Trigger:
  • Create hashtable
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable


Trigger:
  • Bonus
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacking unit)) Equal to Guard Tower
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Attacked unit) Equal to (Load (Key (Attacking unit)) of 0 in (Last created hashtable))
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of +10 d p/l for (Attacking unit)) Less than 5
            • Then - Actions
              • Unit - Increase level of +10 d p/l for (Attacking unit)
            • Else - Actions
        • Else - Actions
          • Unit - Set level of +10 d p/l for (Attacking unit) to 1
      • Hashtable - Save Handle Of(Attacked unit) as (Key (Attacking unit)) of 0 in (Last created hashtable)
      • Unit - Add +10 d p/l to (Attacking unit)


+10 d p/l - Ability, Based off Item Damage Base.
Increases by 10 per level.

Easy to implement, copy from my map and adjust values.
Hope this helps.
 

Attachments

  • Tower Attack Spell.w3x
    8.8 KB · Views: 132

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
why dont you just base it off incinerate? its a simple ability that adds stacking damage every time the owning unit deals damage with an attack
 

Exoudar

New Member
Reaction score
2
Good timing, I'm actually in the process of making a system/spell which is of the same effect called Empowered Strikes. Using Hashtables to make it MUI.

If I complete it, then I will make a demo map for you that is adjusted to work for only your type of unit.

Here is the link to my Thread: Empowered Strikes Hashtable In Process

Only difference is that my additional damage is dealt in magic damage, do you want it to be added and display the additional value (eg +100)?
That might actually be much easier. I can do that in like 20 minutes if that's what you want.

Yes I want the tower to get something like +10 bonus damage, but only if it attacks the same target 5 times and the bonus will be removed if it change the target.

why dont you just base it off incinerate? its a simple ability that adds stacking damage every time the owning unit deals damage with an attack

Incinerate does add damage for each hit and not after 5 hits, also incinerate makes the target explode (or removed)
 

Inflicted

Currently inactive
Reaction score
63
kay, i adjusted the base to be 0.

Therefore now it has 6 levels.
0/10/20/30/40/50 bonus damage

@GFreak45 - he wants it to show the increase amount i think

Trigger:
  • Bonus
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacking unit)) Equal to Guard Tower
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Attacked unit) Equal to (Load (Key (Attacking unit)) of 0 in (Last created hashtable))
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of +10 d p/l for (Attacking unit)) Less than 6
            • Then - Actions
              • Unit - Increase level of +10 d p/l for (Attacking unit)
            • Else - Actions
        • Else - Actions
          • Unit - Set level of +10 d p/l for (Attacking unit) to 1
      • Hashtable - Save Handle Of(Attacked unit) as (Key (Attacking unit)) of 0 in (Last created hashtable)
      • Unit - Add +10 d p/l to (Attacking unit)


Try this demo map:
 

Attachments

  • Tower Attack Spell #2.w3x
    8.7 KB · Views: 123

Exoudar

New Member
Reaction score
2
kay, i adjusted the base to be 0.

Therefore now it has 6 levels.
0/10/20/30/40/50 bonus damage

@GFreak45 - he wants it to show the increase amount i think

Trigger:
  • Bonus
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacking unit)) Equal to Guard Tower
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Attacked unit) Equal to (Load (Key (Attacking unit)) of 0 in (Last created hashtable))
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of +10 d p/l for (Attacking unit)) Less than 6
            • Then - Actions
              • Unit - Increase level of +10 d p/l for (Attacking unit)
            • Else - Actions
        • Else - Actions
          • Unit - Set level of +10 d p/l for (Attacking unit) to 1
      • Hashtable - Save Handle Of(Attacked unit) as (Key (Attacking unit)) of 0 in (Last created hashtable)
      • Unit - Add +10 d p/l to (Attacking unit)


Try this demo map:

Sir, thank you so much, you saved me alot of time and work, THANK YOU :D
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top