[Solved] Need help with Salvaging buildings

Discussion in 'Starcraft 2 (SC2) Editor Help' started by ryanradnell, Dec 25, 2014.

  1. ryanradnell

    ryanradnell New Member

    Ratings:
    +0 / 0 / -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: Dec 25, 2014
  2. X-maul

    X-maul AKA: Demtrod

    Ratings:
    +200 / 0 / -0
    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.
     
  3. ryanradnell

    ryanradnell New Member

    Ratings:
    +0 / 0 / -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.
     
  4. Dave312

    Dave312 Censored for your safe viewing

    Ratings:
    +269 / 0 / -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.
     
  5. ryanradnell

    ryanradnell New Member

    Ratings:
    +0 / 0 / -0
    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.
     
  6. X-maul

    X-maul AKA: Demtrod

    Ratings:
    +200 / 0 / -0
    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 ;)
     

Share This Page