SC2Mapster Forums

Development > Data

Changing Owner problem

  • 7 posts
    #1 Dec 02, 2012 at 08:12 UTC - 0 likes

    I have a trigger setup so when a neutral unit is attacked change owner to hostile.

    When this change happens, for some reason the changed unit loses all energy and heals up to full, negating the initial attack damage.

    I ran the trigger debugger thinking maybe a trigger was firing causing this, but that's not the case.

    I created a new blank map to test this and it worked fine there, so it's something on my map.

    I also tried making it so after the unit changes owner, deal the attackers weapon damage on the unit, but this causes it to deal double damage. So your unit attacks, the enemy unit heals, then it deals the damage from the effect, then your unit hits again. This really shouldn't be double damage and technically should work, but it doesn't. I know this because the lv 1 unit has 5 life and you deal 1 damage and on the first attack it kills the enemy unit... The trigger isn't firing more than 1 time.

    I don't know if this is a trigger issue or data. I have tried everything I can think of and am bashing my head into a wall at this point.

    Last edited Dec 02, 2012 by Zero0018
    #2 Dec 02, 2012 at 09:43 UTC - 0 likes

    I would use a damage response on the defender using a buff that applies a Modify Unit effect that changes ownership to hostile and heals (like transfusion).

    #3 Dec 02, 2012 at 17:21 UTC - 0 likes
    Quote from DrSuperEvil: Go

    I would use a damage response on the defender using a buff that applies a Modify Unit effect that changes ownership to hostile and heals (like transfusion).

    I can't get this to work. The impact is source right? Also what player # is hostile in this setup?

    #4 Dec 02, 2012 at 19:10 UTC - 0 likes

    Caster should also work. Heard they fixed the bug with the player transfer of the modify unit effect. Else you will need a neural parasite like buff to make it go hostile.

    #5 Dec 02, 2012 at 19:56 UTC - 0 likes

    I couldn't get that working, but this trigger below seems to do the trick. I still don't understand why they are being healed and losing energy upon change.

    Neutral Unit Attacked
        Events
            Unit - Any Unit takes Non-Fatal Any damage (from Any effects)
        Local Variables
        Conditions
            (Owner of (Triggering unit)) == 0
        Actions
            Unit - Change ownership of (Triggering unit) to player 14 and Retain Color
            Environment - Deal damage using Dummy on (Triggering unit) from (Damaging unit) with (Triggering damage amount) extra damage
            Unit - Set (Triggering unit) Energy (Percent) to 100.0
            Unit - Order (Triggering unit) to ( Attack targeting (Damaging unit)) (Replace Existing Orders)
    
    Last edited Dec 02, 2012 by Zero0018
    #6 Dec 02, 2012 at 22:43 UTC - 0 likes

    Maybe the 100% energy is the base value and you have someting added?

    #7 Dec 03, 2012 at 04:41 UTC - 0 likes

    @DrSuperEvil: Go

    no that's not it. I removed that part to test and it still did the same as before.

  • 7 posts

You must login to post a comment. Don't have an account? Register to get one!