Sell A Tower [There's A Catch]

BlackRabbit

New Member
Reaction score
3
I used to have a trigger like this hooked to an ability that allowed me to sell a tower.

Code:
Sell Function
    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 (100 / 75)) to (Owner of (Casting unit)) Current gold
        Unit - Remove (Casting unit) from the game

ONLY problem with it, because it works just fine, is that an ability to show my tower's range [thanks to you guys on here who built that, btw.] uses the unit's point value set as it's range. Any ideas? I've been trying to make this work for a few days and cannot seem to figure out just how to do it...
 

Moradiae

TH.net Regular
Reaction score
14
lol, sorry about that, didnt think you've already used the tower's "point value" for calculating the tower's gold return

btw, does anyone know the default use of the point value?

As for your question, from element td (again :p), they set the tower's total cost (including upgrades) to Hp

So yah, its either of the tower's range and gold to either the point value or hp
mana is not really an option here unless ALL of your tower have none that uses it :)
 

azareus

And you know it.
Reaction score
63
I think the default use for pointvalue is how many points they give in the scorescreen.

HP is the best choice I would say.

Unless of course its a maze TD.
 

NeuroToxin

New Member
Reaction score
46
To answer your question, set the point value to a real variable, or an integer, cant remember which, then just do a polar offset. Create a variable named Angle and set it to 0. Divide 360 by however many dummy units you want to use, then set angle to it. do this.
Trigger:
  • Events
    • A unit starts the effect of an ability
    • Conditions
    • (Ability Being Cast) equal to Tower Range
    • Actions
    • Set angle = 360 / X //This is where the amount of dummy units comes into place because they need to be spread in the circle.
    • For (Each Integer A) from one to X//Amount of dummy units again.
      • Loop - Actions
    • Set POffset = Position of (Triggering Unit) offset by 300 towards angle.
    • Create 1 DummyUnit at POffset for (GetTriggerPlayer) facing Angle degrees.
    • Set Angle = Angle + Angle
    • Custom Script: call RemoveLocation(udg_POffset)
 

BlackRabbit

New Member
Reaction score
3
I think the HP value is most excellent.
Thank you all for the help on this bad boy. I'll try to make sure you all find out when it's released.

Edit: I am given an option to use a custom value, point value, or level of a tower... No hp option. Do I need to set a variable to do so?
 

Moradiae

TH.net Regular
Reaction score
14
did you try both the real and integer conversion?, either one and you should see the whole set of them (Hp, Hp as %, mana, mana as %, acquisition range(???), mspd)


edited
sry, that's not really it,

actually... >>>> Unit - Property (you'll get the option to choose "Life" from that) (Real)
 

BlackRabbit

New Member
Reaction score
3
Oh... I did not know I could do that!
I'd +rep you, but it won't let me because I already have recently! XD
 
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