Hello. Littlefury with another noob question. So I've been using tutorials from OneTwoSC. ("Advanced Tower Defense" good tutorial by the way) But my sell tower trigger won't work. So when you press the button on any of my towers, The tower gets destroyed, but no money is recieved by the player. (Or at least for me when i press test document.)
Here's the trigger:
Event: Any unit is ordered to Sell tower T1
Actions: modify (owner of triggering unit) minerals add (( minerals cost of (unit type of (triggering unit))) * 1) I just wanted 100% of the cost. I know how to do the fraction part. What could be wrong?
Well, I have been checking everything that could be wrong. I'm stumped on what it could be. I still am looking for any suggestions. Maybe another way to set up the trigger or something?
Perhaps the tower is dying before its mineral cost registers. Talon's suggestion of putting the kill part in the trigger should work, but if you really want to use data...
You could have the sell ability create a persistent with a very short period (0.0625) and a periodic effect of suicide. That should ensure that the trigger has a chance to finish running before the tower dies.
Thanks guys. I found the problem. I would put the mineral cost of each tower in the Build that it was in when the trigger was refering to the minerals in the "cost" box for each unit. So i just switched the minerals around. It's all set. Thanks again!
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hello. Littlefury with another noob question. So I've been using tutorials from OneTwoSC. ("Advanced Tower Defense" good tutorial by the way) But my sell tower trigger won't work. So when you press the button on any of my towers, The tower gets destroyed, but no money is recieved by the player. (Or at least for me when i press test document.)
Here's the trigger:
Event: Any unit is ordered to Sell tower T1
Actions: modify (owner of triggering unit) minerals add (( minerals cost of (unit type of (triggering unit))) * 1) I just wanted 100% of the cost. I know how to do the fraction part. What could be wrong?
Well, I have been checking everything that could be wrong. I'm stumped on what it could be. I still am looking for any suggestions. Maybe another way to set up the trigger or something?
Have you tried using the event
instead?
Also have you tried to make the ability just a dummy ability and put the kill part inside the trigger instead?
Perhaps the tower is dying before its mineral cost registers. Talon's suggestion of putting the kill part in the trigger should work, but if you really want to use data...
You could have the sell ability create a persistent with a very short period (0.0625) and a periodic effect of suicide. That should ensure that the trigger has a chance to finish running before the tower dies.
Thanks guys. I found the problem. I would put the mineral cost of each tower in the Build that it was in when the trigger was refering to the minerals in the "cost" box for each unit. So i just switched the minerals around. It's all set. Thanks again!