SC2Mapster Forums

Development > Data

Energy Movement (need help) SOLVED.Thanks! :D

This thread has been locked by tdhsst.

I have locked this becuase it is solved and it works great. read on if you want to see the outcome. :D

  • 15 posts
    #1 Dec 30, 2012 at 00:08 UTC - 0 likes

    I am tring to make an ability that requires you to have energy to move. i use to have it but i can not remember what i did before (LOL). currently i have an ability/behavior/affect for this, and all i need to do is figure out where the "cost" energy goes. suggestions. i have behavior set as Buff, Effect as Apply Buff, Ability as Effect Instant. maybe these need to change as well, idk. Thanks or any feed back.

    Last edited Jan 06, 2013 by tdhsst

    (yes i am nots good at this english part, LOL)

    #2 Dec 30, 2012 at 00:44 UTC - 0 likes

    So, what you want is an ability that allows a unit to move but causes a gradual energy loss, like a ghost's cloak? If so all you need is a Behavior ability that activates a behavior that enables a Move ability and adds an energy loss.

    Assistant Team Leader of "Generic Code" and User of the All-Mighty Data Editor.

    My Amazing Cutscenes

    #3 Dec 30, 2012 at 01:13 UTC - 0 likes

    @Spoolofwhool: Go

    Thanks i will try that out. :D

    #4 Dec 30, 2012 at 01:18 UTC - 0 likes

    @tdhsst: Go

    Field Ghost - Cloak Unit: Vital Regeneration Bonus + (0|0|-1.4765)

    going to apply this to my behavior to see if it works, lol.

    Edit: i did apply this and it does work ,but the problem is how do i only get it to fire when the unit is moving only. i added a behavior to the unit but it runs constantly not when only moving.. suggestions?

    Last edited Dec 30, 2012 by tdhsst
    #5 Dec 30, 2012 at 02:01 UTC - 0 likes

    Okay, I thought you wanted it to be a togglable ability like cloak but I'm guessing its more like a thing where all the time, if the unit doesn't have energy it can't move and while it is moving, it's energy lowers.

    Take copy the ghost cloak behaviour and remove the cloak part, if you haven't done something similar already. Then make a Unit Compare Order Queue or Unit Compare Order validator (I'm not sure what the differences between them is, but I know one of them works.) and set the Validator - Ability field to move and the Validator - Value field to 1 and the Validator - Unit - Value to caster. Finally add your validator to the Validator - Disable field of your behaviour and it should work. If it doesn't, or it works oppositely, then try messing with the values.

    #6 Dec 30, 2012 at 02:10 UTC - 0 likes

    @Spoolofwhool: Go

    Thanks! btw nice name, lol. going to try that out. :D

    #7 Dec 30, 2012 at 09:24 UTC - 0 likes

    you can just make an behavior that lower your energy regen and set a valdiator to the behavior so that the behavior would just work when the unit use move ability

    #8 Dec 30, 2012 at 10:10 UTC - 0 likes

    You will also need a Combine validator to check for patrol (move index 2) and the attack ability.

    #9 Jan 06, 2013 at 07:36 UTC - 0 likes

    @Darkillusion95: Go

    @DrSuperEvil: Go

    Thanks guys it works perfectly to drain energy while moving and such... now the only issue is that i need the unit to STOP when it has 0 energy.

    ideas?

    #10 Jan 06, 2013 at 09:44 UTC - 0 likes

    Have another Buff that disables the Move ability which is disabled if the unit has energy.

    #11 Jan 06, 2013 at 14:39 UTC - 0 likes

    @DrSuperEvil: Go

    Ability: Abilities Disabled + (Attack|Move)

    Behavior: Validators (Disable) - (Caster Has Energy)

    i have this set and its constantly on... which is confusing because it says "If one of these Validators returns false, the behvior will be disabled"

    Last edited Jan 06, 2013 by tdhsst
    #12 Jan 06, 2013 at 15:22 UTC - 0 likes

    You want the bahavior which disables the abilities to be ON when unit has energy returns false

    #13 Jan 06, 2013 at 18:17 UTC - 0 likes

    You are using a validator that returns true if the caster has energy. As you are using an equivalent double negation you want it to return true when the caster has 0 no energy.

    #14 Jan 06, 2013 at 23:29 UTC - 0 likes

    @DrSuperEvil: Go

    Thank you very much for your help, i have it worked out now, just going to adjust numbers to suit how i want it..

    The end results are: Apply Behavior to drain energy while attacking/moving/pathing. Then i had to make an Instant Ability Autocast to self/Effect:apply Buff, Buff/Disable Move&Attack abilities when energy is 0. The reason i had to put it in an ability is because using it in a straight Behavior attached to the unit it would only work when the unit is stationary, meaning the energy would drain to 0 but it would not stop the unit till the attack/patrol/move was done, then it would apply. With the Ability on autocast as soon as the unit hits 0 energy it casts and applies the brakes, removing the attack/move ablity. Keep an eye out in the future on the 'new map' forum for the map i am putting together. Thanks again. :D.

    #15 Jan 07, 2013 at 00:41 UTC - 0 likes

    Reminds me of this this thread.

    http://www.sc2mapster.com/forums/development/data/31698-solved-modifying-an-attribute-behavior-stat-while-moving/#p8

    You just need two buffs. The first drains energy via nega regen or a periodic Modify Unit effect and is disabled when the unit is not using move/attack. The second buff disables move and requires =0 energy to be enabled.

  • 15 posts