Selling towers...

kungfuturte0

New Member
Reaction score
2
If been searching for this and I could'y find it :eek:
Im making a TD and just adding some finishing touches. I want to be able to sell towers, so I found out how to only thing is you click sell tower, the tower disappears but i get NO gold back ( i want 75% of towers intial value). Is there something wrong with trigger or ability? Heres the trigger:

Event - Unit - A unit starts the effect of an ability

Condition - (Ability being cast) equal to Sell Tower

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

Any ideas why its not giving any gold???:confused: Thanks for any help
 
Reaction score
333
If been searching for this and I could'y find it :eek:
Im making a TD and just adding some finishing touches. I want to be able to sell towers, so I found out how to only thing is you click sell tower, the tower disappears but i get NO gold back ( i want 75% of towers intial value). Is there something wrong with trigger or ability? Heres the trigger:

Event - Unit - A unit starts the effect of an ability

Condition - (Ability being cast) equal to Sell Tower

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

Any ideas why its not giving any gold???:confused: Thanks for any help

Your unit's point value is probably set to 0. You need to change it in the object editor.
 

kungfuturte0

New Member
Reaction score
2
Checked but the point values are above 0 well for the first tower its 10 so 75% of 10 is 2.5 but i dont get this gold?? is it because its a number with numbers after the decimal point?
 

Fatmankev

Chef, Writer, and Midnight Toker
Reaction score
240
Try...

Try this:
PHP:
Actions - Add (Point-value of ([B]Casting Unit[/B]) x (blah blah blah)) to Owner of ([B]Casting Unit[/B])
Hopefully, this will work. If it doesn't, then... well, I can't really help ya. Good luck, bud.
 
Reaction score
333
Checked but the point values are above 0 well for the first tower its 10 so 75% of 10 is 2.5 but i dont get this gold?? is it because its a number with numbers after the decimal point?

I just realised.

Code:
(Integer(0.75)))

Try instead:

Code:
Actions - Player - Add Integer(Real(Point value of (triggering unit))) x 0.75) to (owner of (triggering unit)) current gold
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
890
Yes, if you convert to an integer, it will round the number.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top