Tower Defense Questions

trackstar627

New Member
Reaction score
0
Hey everyone - I have a couple quick questions about some towers in the map I'm making.

First of all, I have a tower that uses the breath of fire skill as its main attack. The skill itself works how I want it to, but the player has to click each time and select the target. :thdown: I know there is a way to have it continuously auto cast, but I can't figure it out.

Second, I want to have some towers that stun enemy units like 10% of the time. For this, I have no idea where to start. I've tried using different skills, but I'm sure there's an easier way.

I would really appreciate the help and thank everyone in advance! :)
 

Glivee

The Swedish Moose
Reaction score
34
For the stun, can't you just use an custom-made ability that acts like the stun in game and set it to the Tower? Or maybe just use the actual stun-ability on the tower? m on a bus atm so i cant really get into WE and see if this works. That's just something from my head :)
 

Dasslokk

New Member
Reaction score
9
About the first problem;

You could replace the tower's missile with the breath of fire missile and add some splash damage, and then trigger the mana cost:
Trigger:
  • Untitled Trigger 001
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacking unit)) Equal to Guard Tower
    • Actions
      • Unit - Set mana of (Attacking unit) to ((Mana of (Attacked unit)) - 1.00)


Or you could base the ability on one of those autocast arrow- skills (searing arrows, poison arrows, cold arrows and so on) and add some area of effect.
 

Legacyspy

New Member
Reaction score
19
Or when the unit attacks just order it to cast breath of fire on the/at the location of the attacked unit.
 

Syndrome

You can change this now in User CP.
Reaction score
126
'First of all, I have a tower that uses the breath of fire skill as its main attack. The skill itself works how I want it to, but the player has to click each time and select the target. I know there is a way to have it continuously auto cast, but I can't figure it out.'

Code:
Events:
A unit is attacked
Conditions:
Unit Type of Attacking Unit equal to [insert your tower here]
Actions:
Order Attacking Unit to Breath of Fire on position of Attacked Unit

Have your tower have the Breath of Fire-type spell, make it do 0-1 dmg and make it's attack speed really fast.
Adjust cooldown in the Breath of Fire spell to whatever you want. The tower won't cast it if its in Cooldown.

And, what kind of Stun? Like, a Bash-type thing? Cause that will work on Single Units. For a AoE, you can create a dummy unit with the Warstomp ability. Summon the Dummy Unit and make it cast it, then remove it.
 

trackstar627

New Member
Reaction score
0
Thanks for all the help! I got the breath of fire skill to work perfectly now so that's a good thing. As far as the stun tower goes, I want it to shoot like a regular tower, but I also want it to stun, for example, like 10% of the time. I've tried a few different set-ups and can't quite get it to work right. But again, thanks to everyone for the help! I appreciate it!:)
 

trackstar627

New Member
Reaction score
0
Ok, another couple of questions came up while working on my map.

First off, I attempted to use Geoff's example to do the flame tower autocast, but I could not find the appropriate skill to use. The only one I found listed was the Panderan Brewmaster breath of fire skill. I tried altering that skill and doing a bunch of other stuff but nothing really seemed to work. Any clarification would be cool. I worked around the GUI script in my last post, but obviously that way didn't work as well as I wanted.

Second, for a certain tower, I want the the tower requirements to be two of the same thing, for example - In order to build this furnace tower, you need to have 2 fire stones. I've tried a few different things to make this work, but I can't seem to get it. Please, I need a little bit more help!:confused:
 

trackstar627

New Member
Reaction score
0
Oh shoot, one more thing - How do I make units drop items on death? I think I've seen it before but I can't remember how to do it. aaargh:nuts:
 

ZelNaga

New Member
Reaction score
5
For the item it's right in the Object Editor->Items inbetween the
Stats - Cooldown Ground
and
Stats - Gold Cost
Can't miss it, yay I think I helped someone for the first time! =D
 

trackstar627

New Member
Reaction score
0
Yup - that solved about half of it. The other half is - how can I set what items a unit can drop, and is there a way to alter the drop percentage? I want the creeps to drop usable items but I'm stuck and don't know what to do.
 

ZelNaga

New Member
Reaction score
5
Oh creep drops...that is something about loot tables that I have not gotten into yet. :'( Sorryz.
 

jaybles169

New Member
Reaction score
2
There's two ways you could go about doing it, and it depends on whether your creeps are pre placed or if you use a trigger to create them. If they are pre placed you can just double click the unit in the WE and add a loot table, they're not too hard to figure out. Otherwise what you'll have to do is something like this:

Trigger:
  • Item Drops A
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Owner of (Triggering unit)) Equal to Player 11 (Dark Green)) or ((Owner of (Triggering unit)) Equal to Player 12 (Brown))
    • Actions
      • Set RandomNumberA = (Random integer number between 1 and 100)
      • If (RandomNumberA Equal to 15) then do (Item - Create Tome of Agility +5 at (Position of (Triggering unit))) else do (Do nothing)
      • If (RandomNumberA Equal to 30) then do (Item - Create Tome of Intelligence +5 at (Position of (Triggering unit))) else do (Do nothing)
      • If (RandomNumberA Equal to 45) then do (Item - Create Tome of Strength +5 at (Position of (Triggering unit))) else do (Do nothing)
      • If (RandomNumberA Equal to 60) then do (Item - Create Book of Might at (Position of (Triggering unit))) else do (Do nothing)


And you can of course adjust it how you like. What I just noticed too is that this leaks, and alot of people go crazy about leaks, so I should probably fix this. If you want further explanation on that just ask and I'll go right ahead and tell you :thup:.
 

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
About the stun ability.... You can do like this...

Event - A unit is attacked
Condition - The unit belongs to Creep Player and ......
Action - Pause unit
Add Stun special effect on it...
Wait (stun duration)
Unpause Unit

So, this is the best way. Creeps continue walking after it "stunned", better than the passive original "Bash".... But your creeps wont show stunned buff!!!! I think i can help u ^^
 

trackstar627

New Member
Reaction score
0
Ok, thanks for the help you two - I was just tweaking the creep drop GUI code and I'm not sure I really understand what the leaking part of it means. Otherwise, it seems to work pretty well.
 

jaybles169

New Member
Reaction score
2
Trigger:
  • Item Drops A
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Owner of (Triggering unit)) Equal to Player 11 (Dark Green)) or ((Owner of (Triggering unit)) Equal to Player 12 (Brown))
    • Actions
      • Set TempItem = (Position of (Triggering unit))
      • Set RandomNumberA = (Random integer number between 1 and 100)
      • If (RandomNumberA Equal to 15) then do (Item - Create Tome of Agility +5 at TempItem) else do (Do nothing)
      • If (RandomNumberA Equal to 30) then do (Item - Create Tome of Intelligence +5 at TempItem) else do (Do nothing)
      • If (RandomNumberA Equal to 45) then do (Item - Create Tome of Strength +5 at TempItem) else do (Do nothing)
      • If (RandomNumberA Equal to 60) then do (Item - Create Book of Might at TempItem) else do (Do nothing)
      • Custom script: call RemoveLocation(udg_TempItem)


Here's that same example without the leaks. What leaking is, is essentially memory that is used and cannot be referenced again, so it's sort of lost, but still being used.

For instance, in my first example, the "Position of Triggering Unit" leaks, because the game has to be able to know where the unit is, so it sort of creates its own variable to represent that spot. Only, it keeps that location in memory, even though it can't be used anymore. So in the example above, by creating a temporary "Point" variable, setting it to the position of the dying unit, and then using the variable instead of "Position of Triggering Unit," you can then remove the variable as soon as you're done using it and you have no wasted memory :thup:.

It might not seem like a big deal, but it can really add up eventually and lag the hell out of a game. You can find a whole bunch of threads about it that go into crazy detail.

Good luck on your map bud :)
 

Classe

New Member
Reaction score
1
i belive this will give all tomes you have listed only a 1% pchance to drop each...
correct me if i'm wrong and perhaps that were your intention?
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      • Ghan
        Administrator - Servers are fun

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top