(TD) Thread!

morno

Active Member
Reaction score
2
i figured out that wht make all theads for only one thing so here is my TD thread where you can look up things and/or ask things.. so here is my first question for this new thread:

i have maked a selling trigger and the selling thing.. but it dint work.. please help me many more questions will come..

Code:
Sell Trigger
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Sell Tower (Hero Abilities, Thunder Clap) 
    Actions
        Player - Add ((Point-value of (Triggering unit)) x (Integer(0.75))) to (Owner of (Triggering unit)) Current gold
 
T

Twyddli

Guest
You need to add another actions like -

Unit remove triggering unit from the game.

So then it removes the unit from the game, and with your trigger it will add should add the gold too. Hope i helped. ;)
 

morno

Active Member
Reaction score
2
ok it worked.. but if i selected 10 buildings i most click 10 times... i whant when i click one time and have selected 10 all will be removed.. and i diddent get any money.. :(
 

Exide

I am amazingly focused right now!
Reaction score
448
You should change the 'sell unit' from spell into an actual unit.
Then you can train it in your towers, and have the condition (Triggering unit) equal to 'Sell This Tower' - Actions...

I believe that will work if you select several towers, as well.

Oh, and if you want the thunderclap effect, you need to add it with a special effect.
 
T

Twyddli

Guest
Make a unit - call it Sell.

Code:
Event
    Unit - a unit begins Training a unit
Condition
    Traind unit equal to Sell
Actions
    Player - Add ((Point-value of (Triggering unit)) x (Integer(0.75))) to (Owner of (Triggering unit)) Current gold
    Unit - Remove Triggering unit from the game

That should do it i think. make it so that all the towers can Train the unit called Sell.

Edit: This is free hand, i didin't use World editor. But im pretty sure this is right.
 

Exide

I am amazingly focused right now!
Reaction score
448
It's really the same thing that you already have, but instead of having a spell that sells your tower, you use a unit.

So start by making a new custom unit in your object editor and name it 'Sell this tower' or something similar.
Then add this trigger:

Code:
Sell Trigger
    Events
        Unit - A unit finishes training a unit
    Conditions
        (Trained unit) equal to '[I]Sell this tower[/I]' 
    Actions
        Set [B]Location[/B] = Position of (Triggering Unit)
        Special Effect - Create 1 special effect at [B]Location[/B] using blabla/Thunderclap
        Special Effect - Destroy Last Created Special Effect
        Player - Add ((Point-value of (Triggering unit)) x (Integer(0.75))) to (Owner of (Triggering unit)) Current gold
        Unit - Remove (Triggering Unit) from the game
        Custom Script - call RemoveLocation(udg_[B]Location[/B])

Something like that. The triggers might look a bit odd, I don't have World Editor open at the moment. :p
 
T

Twyddli

Guest
You need to make it so you aren't converting the 0.75 to an integer, it needs to stay as a real value.

So i would be -
Player - Add ((Point-value of (Triggering unit)) x (0.75) to (Owner of (Triggering unit)) Current gold

And if that doesn't work, them im don't know whats wrong :eek:
 

morno

Active Member
Reaction score
2
i can't add (0.75) to Player - Add ((Point-value of (Triggering unit)) x (Integer(0.75))) to (Owner of (Triggering unit)) Current gold. becouse i cant add . to ''Value''
 
T

Twyddli

Guest
Can you do
Add 0.75 x (Integer((Point-value of (Triggering unit))) to (Owner of (Triggering unit)) current gold?
Just a thought, because isn't the first value a real? Or is that with something else? I'm not sure.

Make a real Variable? Set it to your equation, Point value of trigger unit x 0.75 and then do
Add Variable to owner of triggering units current gold.

Im not sure.
 

ManyTimes

I'm so lonesome I could cry...
Reaction score
293
Here is a tip: If you put the unit to "sell" the tower under:
Techtree Units Sold <-unit here, then you can select 1000 buildings, and theywill be sold at once. Train unit got a timer, but then again, with training a unit you can regreat and have the possiblity to cancel..
And to get 75%...of the point value, you need a variable type Real.
Here:
Code:
Actions
    Set real = ((Real((Point-value of (Selling unit)))) x 0.75)
    Player - Add (Integer(real)) to Player 1 (Red) Current gold
 

Exide

I am amazingly focused right now!
Reaction score
448
Remade

Ok, I remade the trigger in World Editor.
This should work:

Code:
selling
    Events
        Unit - A unit Finishes training a unit
    Conditions
        ((Triggering unit) is A structure) Equal to True
        (Unit-type of (Trained unit)) Equal to Sell this tower
    Actions
        Set Location = (Position of (Triggering unit))
        Special Effect - Create a special effect at Location using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
        Special Effect - Destroy (Last created special effect)
        Unit - Remove (Triggering unit) from the game
        Unit - Remove (Trained unit) from the game
        Player - Add ((Point-value of (Triggering unit)) / 2) to (Owner of (Triggering unit)) Current gold
        Custom script:   call RemoveLocation(udg_Location)
 

Sooda

Diversity enchants
Reaction score
318
> i figured out that wht make all theads for only one thing so here is my TD thread where you can look up things and/or ask things.. so here is my first question for this new thread

And here is the final answer: Tower Defense Tutorial by Andrewgosu
 

morno

Active Member
Reaction score
2
here is the thing i don't like complecated triggers... i have tried the TD turnal but the sell trigger diddent work.. here is the trigger im useing but it dont work! im getting mad!

Code:
Sell Trigger
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Sell Tower 
    Actions
        Player - Add ((Point-value of (Triggering unit)) x (Integer((0.75 x Real)))) to (Owner of (Triggering unit)) Current gold
        Unit - Remove (Triggering unit) from the game

if someone knows an easy sell trigger THAT WORKS! please post it here..
 

Magentix

if (OP.statement == false) postCount++;
Reaction score
107
here is the thing i don't like complecated triggers... i have tried the TD turnal but the sell trigger diddent work.. here is the trigger im useing but it dont work! im getting mad!

Code:
Sell Trigger
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Sell Tower 
    Actions
        Player - Add ((Point-value of (Triggering unit)) x (Integer((0.75 x Real)))) to (Owner of (Triggering unit)) Current gold
        Unit - Remove (Triggering unit) from the game

if someone knows an easy sell trigger THAT WORKS! please post it here..


You DID make an ability called Sell Tower I assume?
Preferably based upon Channel...


Since your sell trigger looks a lot like mine and guess what... it works :/
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      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