[Solved] Need help with Salvaging buildings

ryanradnell

New Member
Reaction score
0
Hi, i'm currently working on a tower defense and i'm trying to put in the salvage ability for towers (using the bunker salvage as reference). However when i use the ability all it does is start the 5 second countdown and nothing afterward (Doesn't destroy building), I've checked over and over and it's exactly like the bunker salvage is, can anyone help?
 
Last edited:

X-maul

AKA: Demtrod
Reaction score
201
I assume you want to destroy the unit and get back the resources spend. What you should do, is to use a trigger that activates when the spell is finished casting, giving the mineral and vespene gas cost of unit type of triggering unit to the owner.

The spell should be a no target spell (forgot the name), with the effect set to the effect "Suicide" and the cast time set to whatever you want it to be.

Hopefully this makes sense.

If you do not want to use triggers, you can make an effect that gives a resource to the player (take a look at minerals that you pick up in campaign), but that will need a unique effect for each different unit using the ability.
 

ryanradnell

New Member
Reaction score
0
I don't fully understand what you're trying to say, but perhaps i can elaborate a little on what i'm trying to do, I've already setup triggers to refund the costs which works. I was copying the Salvage Bunker ability to do the countdown and destroy the building, but the building doesn't get destroyed after the countdown and i cant find out why.
 

Dave312

Censored for your safe viewing
Reaction score
269
On your salvage ability there should be an "Effect" property. Make sure this is set to a damage effect that will kill your unit. There are a few existing ones you can use such as "Salvage - Salvage Death" or you could just make your own. If your making your own, make sure the Kill flag is checked in the "Effect: Flags" property and "Target: Impact Location" is set to "Source Unit" (or "Caster Unit" will work too) on the damage effect.
 

ryanradnell

New Member
Reaction score
0
On your salvage ability there should be an "Effect" property. Make sure this is set to a damage effect that will kill your unit. There are a few existing ones you can use such as "Salvage - Salvage Death" or you could just make your own. If your making your own, make sure the Kill flag is checked in the "Effect: Flags" property and "Target: Impact Location" is set to "Source Unit" (or "Caster Unit" will work too) on the damage effect.

It's weird that the unit dies when using the original Bunker Salvage (Refund) ability, but with my duplicated one it wouldn't destroy the unit, though it could have been that i didn't set the ability after duplicating it i can't remember. But thank you for your response, i decided to not duplicate the bunker salvage and it seems to work.
 

X-maul

AKA: Demtrod
Reaction score
201
It might be that, when you dublicated it, it somehow set the effect to something unknown, making it not work. Anyway glad you made it work :) I did not have the editor installed so I had to tap from my memory ;)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top