unit that gets stronger with more kills?

TheRat

New Member
Reaction score
3
I'm trying to make a trigger to make it so when a tower gets 25 kills, it upgrades into a stronger tower.

I'm trying to make a variable so that it will be equal to the value of the number of units a tower has killed, but I don't know how to do that.

Can someone tell me how to do that, or perhaps a better way to do this?
 

Drakens

New Member
Reaction score
7
Code:
Event:
   Unit Dies
Conditions:
   Killing unit = Your Tower
Actions:
   Set TowerKills = TowerKills +1
   If TowerKills = 25
     Then do
       Replace Your Tower with Your Upgrade Tower
     Else do nothing
Maybe that works... but only if you have 1 tower.
 
G

Goauld

Guest
When a unit dies, check for killing unit's unit-type and set killing unit's custom value to custom value of killing unit + 1. Then if-then-else if custom value of killing unit equal to 25 then replace killing unit with upgraded tower.

Edit: Yeah, that trigger but with custom values and it works for all towers.
 

TheRat

New Member
Reaction score
3
I can see that this will work, but is there anyway to have it be upgraded instead of replaced? I'd like to keep the animation if possible.
 

Drakens

New Member
Reaction score
7
Maybe creating a dummy worker and ordering him to create the upgraded building? (After you detete the old one...)
And i'm not sure if you can order to "Build Building", or you can try using the "Summon Building" item ability...
 
G

Goauld

Guest
TheRat said:
I can see that this will work, but is there anyway to have it be upgraded instead of replaced? I'd like to keep the animation if possible.
Not really if you don't want to show the upgrade icon to be able to be pressed. You could have the upgrade require some dummy unit which name's 25 kills, and then it will say - Requires 25 kills. Of course add to your tower that it upgrades to that tower. Then have the actions be instead of replacing:
Code:
set temp_point = center of map
Create 1 25 kills (dummy) for owner of killing unit at temp_point
Order killing unit to upgrade (can't say the exact one now, don't have WE up)
Remove last created unit
custom script: call RemoveLocation (udg_temp_point)
 

Evote

New Member
Reaction score
4
ok um
2 parts
u'll need to mkae a variable interger
trigger:
fsddf
Events
Unit - A unit Dies
Conditions
(Owner of (Killing unit)) Equal to (Owner of (Triggering unit))
Actions
Set help = (help + 1)
and then
Untitled Trigger 002
Events
Time - Every 0.01 seconds of game time
Conditions
(Unit-type of (Matching unit)) Equal to Cannon Tower
Actions
Unit - Set Level of Attribute Bonus for (Triggering unit) to (help / 15)
 

Nigerianrulz

suga suga how'd you get so fly?
Reaction score
198
Code:
Unit - Set Level of Attribute Bonus for (Triggering unit) to (help / 15)
What is this? towers dont have Attribute Bonus ability im not sure if there is an action telling buildings to upgrade but might be anyway Drakens' trigger should work if there is an upgrade actions
As for Evote you shouldnt bump this topic the owner will decide if he wants to reply or not
 

Ryuu

I am back with Chocolate (:
Reaction score
64
Well, I think out of all the other ways to do this, this is one of them.

Firstly, you'll have to create some variables.

Kills_of_tower : Integer Variable

Code:
EVENTS
A unit Dies
CONDITIONS
ACTIONS
Set Kills_of_tower = Kills_of_tower + 1

Then, add this trigger.

Code:
ACTIONS
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
          Kills_of_tower Equal to 25
      Then - Actions
          Unit - Order (Matching Unit) to train/upgrade to a [Unit that will be upgraded from the tower that has 25 kills]
       Else - Actions
          Do nothing

So whenever the kill of the tower reaches 25, it will order the tower which is matching the condition (kills_of_tower = 25) to upgrade into a unit that you want.

Also, another way, is using nigerianrulz's way. You can set the ability "Attribute Bonus" to a non-hero ability. Then add this abiltiy to all your towers. Then, set two triggers:
  • A unit dies
  • Set the skill level of "Attribute Bonus" of Killing Unit to 25

Then, create another trigger.
  • Skill "Attribute Bonus" level equal to 25
  • Create a unit to upgrade triggering unit

P.S Sorry I didn't do any triggers, I was doing this part w/e WE. PSPS!

EVOTE, you Double-Posted! *HeHe*
 

Ryuu

I am back with Chocolate (:
Reaction score
64
Just use the replace. I don't see why you can't

I think what he really wants is the upgrade effects, like the "Upgrade Complete" voice when you normally upgrade a tower. Also another effect is the build time. Maybe he already set all the build time in the towers and now you said to replace it.. isn't it a waste of effort cuz he already set all the build time?!
 
D

dariidar

Guest
Variables seem like the best way to deal with this. But instead of replacing the towers, can't you just allow it to upgrade X upgrades?
 

Andrewgosu

The Silent Pandaren Helper
Reaction score
716
Initialize the towers.

Code:
Initialize Towers
    Events
        Map initialization
    Conditions
    Actions
        Set GuardTowerArray[1] = Guard Tower (Level 2)
        Set GuardTowerArray[2] = Guard Tower (Level 3)
        Set GuardTowerArray[3] = Guard Tower (Level 4)
        Set GuardTowerArray[4] = Guard Tower (Level 5)

The following trigger uses point values of the towers. Change them to: 1 for level 1 Guard Tower, 2 for level 2 Guard Tower etc.
Code:
Upgrade Towers
    Events
        Unit - A unit Dies
    Conditions
        Or - Any (Conditions) are true
            Conditions
                (Unit-type of (Killing unit)) Equal to Guard Tower (level 1)
                (Unit-type of (Killing unit)) Equal to Guard Tower (level 2)
                (Unit-type of (Killing unit)) Equal to Guard Tower (level 3)
                (Unit-type of (Killing unit)) Equal to Guard Tower (level 4)
                (Unit-type of (Killing unit)) Equal to Guard Tower (level 5)
    Actions
        Unit - Set the custom value of (Killing unit) to ((Custom value of (Killing unit)) + 1)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Custom value of (Killing unit)) mod 25) Equal to 0
            Then - Actions
                Unit - Order (Killing unit) to train/upgrade to a GuardTowerArray[(Point-value of (Killing unit))]
            Else - Actions

Basically, it orders the killing unit to upgrade into a better tower every time it reaches 25 kills.
 
G

guitarplay

Guest
better as in what. You could probably just use attributes. Set it so at 25 kills instead of upgrading just give it so many strength, agility, and intelligence. (does it have to be a hero to take attributes?)

Maby take a hero, give it the model and icon of a tower. Attack of a tower. And make it immobile. Then you could use levels if you made the experience correspond and everything so that at 25 kills of footmen it went up, or at 20 kills of footmen, and 2 or 3 kills of like knights. Or 15 kills of knights it would level up. I don't know. Just the only way i can think of without actually upgrading the tower.
 

Ryuu

I am back with Chocolate (:
Reaction score
64
better as in what. You could probably just use attributes. Set it so at 25 kills instead of upgrading just give it so many strength, agility, and intelligence. (does it have to be a hero to take attributes?)

Maby take a hero, give it the model and icon of a tower. Attack of a tower. And make it immobile. Then you could use levels if you made the experience correspond and everything so that at 25 kills of footmen it went up, or at 20 kills of footmen, and 2 or 3 kills of like knights. Or 15 kills of knights it would level up. I don't know. Just the only way i can think of without actually upgrading the tower.

Isn't that just like my trigger I mentioned above?
 
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