Unlearning Upgrades

Dmshu

New Member
Reaction score
9
So I have this spell based on immolation and if their life is above 50% they are stronger and in under 50% they get regeneration bonuses.

Code:
Mana Empowered Group
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Mana Empowerment 
    Actions
        Game - Display to (All players) the text: added to group
        Unit Group - Add (Triggering unit) to ManaEmpowered
Code:
Mana Empowerment
    Events
        Time - Every 1.00 seconds of game time
    Conditions
        (Number of units in ManaEmpowered) Greater than 0
    Actions
        Unit Group - Pick every unit in ManaEmpowered and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Picked unit) has buff Mana Empowerment ) Equal to False
                    Then - Actions
                        Game - Display to (All players) the text: not in group
                        Player - Set the current research level of Mana Empowerment Offensive  to 0 for (Owner of (Picked unit))
                        Player - Set the current research level of Mana Empowerment Defense  to 0 for (Owner of (Picked unit))
                        Unit Group - Remove (Picked unit) from ManaEmpowered
                    Else - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                (Percentage life of (Picked unit)) Greater than or equal to 50.00
                            Then - Actions
                                Game - Display to (All players) the text: offensive buff
                                Player - Set the current research level of Mana Empowerment Offensive  to (Level of Mana Empowerment  for (Picked unit)) for (Owner of (Picked unit))
                                Player - Set the current research level of Mana Empowerment Defense  to 0 for (Owner of (Picked unit))
                            Else - Actions
                                Game - Display to (All players) the text: defensive buff
                                Player - Set the current research level of Mana Empowerment Defense  to (Level of Mana Empowerment  for (Picked unit)) for (Owner of (Picked unit))
                                Player - Set the current research level of Mana Empowerment Offensive  to 0 for (Owner of (Picked unit))

So it works well and good for giving them the bonuses, but the problem is that setting the upgrade level to 0 via triggers doesn't unlearn the upgrade.

Anyone know how to unlearn/nulify an upgrade or have another idea of how to do this spell without using dummy units to cast buffs every second?
 

Squishy

You can change this now in User CP.
Reaction score
127
You can't unlearn upgrades. Can't you use passive abilities to get the offensive and defensive boosts you want? Or you could make another upgrade that cancels out the effects of the first one, and increase the level of that one.
 

Dmshu

New Member
Reaction score
9
Well I was trying to stick to upgrades as I think it would impact performace less then adding/setting level/removing the passive abilities every second.

So I tried to null the upgrades by applying upgrades that decrease base attack speed by the same % and regen by the same 0% but then the unit is stuck at it's normal regen and attack speed...

So unless you had a different idea of nullifying upgrades I think I am stuck to adding/removing/setting level of a passive ability in their spellbook...
 

Squishy

You can change this now in User CP.
Reaction score
127
Well the only method to cancel out upgrades is to make a negative upgrade. If that doesn't work for you the the only option is abilities.
 

verdr3t

New Member
Reaction score
8
Sry for the question but...

So I tried to null the upgrades by applying upgrades that decrease base attack speed by the same % and regen by the same 0% but then the unit is stuck at it's normal regen and attack speed...

Isn't that exactly what you want or am I not getting something here?


Cheers
 

Dmshu

New Member
Reaction score
9
Sry for the question but...



Isn't that exactly what you want or am I not getting something here?


Cheers

It is and it isn't. It was canceling out the previous upgrade but then when I reactivate the ability they get no bonus because it have already been upgraded and I would have to make another different upgrade to give the bonus again but then I'd have to make another to null that and it wouldn't end. So I think unless I'm going at it the wrong way I am going to go with 3 more abilities: a spell book, an offensive passive, and a defensive passive and have a trigger add, level, and remove them accordingly.
 

verdr3t

New Member
Reaction score
8
Hm, ok I get your point. Well I'd also stick with abilities rather than upgrades. More flexible.

Sry that we couldn't help...


Cheers
 
General chit-chat
Help Users

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top