• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Buffs and Debuffs Mui trigger help!

Status
Not open for further replies.
Level 1
Joined
Jun 13, 2008
Messages
132
Hi there, I am developing my map and I need to do a trigger to remove the buffs-debuffs of the units (they are actually abilities).
When one hero ability is used I add an invisible ability to it (like devotion aura with negative values hidden in a book), and at the same time, I create a dummy unit with that ability and I add a timer to it, when this dummy unit dies I remove the ability for all the units that have that ability, so, I remove the buff-debuff, and, what I need is, a better way to do this, hope you understand what I need. Thanks in advance.
 
Level 5
Joined
Jan 17, 2014
Messages
131
Hi there, I am developing my map and I need to do a trigger to remove the buffs-debuffs of the units (they are actually abilities).
When one hero ability is used I add an invisible ability to it (like devotion aura with negative values hidden in a book), and at the same time, I create a dummy unit with that ability and I add a timer to it, when this dummy unit dies I remove the ability for all the units that have that ability, so, I remove the buff-debuff, and, what I need is, a better way to do this, hope you understand what I need. Thanks in advance.

If I understand correctly, you don't need a dummy unit. Just add a wait action.

Example:
  • Trigger
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to "Your Hero Ability"
    • Actions
      • Unit - Add "Your Hidden Ability" to (Triggering unit)
      • Wait "X" seconds (X = a number of your choosing)
      • Unit - Remove "Your Hidden Ability" from (Triggering unit)
Correct me if I misunderstood you.
 
Last edited:
Level 1
Joined
Jun 13, 2008
Messages
132
If I understand correctly, you don't need a dummy unit. Just add a wait action.

Example:

  • Trigger
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to "Your Hero Ability"
    • Actions
      • Unit - Add "Your Hidden Ability" to (Triggering unit)
      • Wait "X" seconds (X = a number of your choosing)
      • Unit - Remove "Your Hidden Ability" from (Triggering unit)
Correct me if I misunderstood you.

That is correct but it is not Mui, so multiple units cannot work with it.
 
Level 5
Joined
Jan 17, 2014
Messages
131
That is correct but it is not Mui, so multiple units cannot work with it.

Oh, sorry. I missed the part about you wanting it done on MUI. What kind of ability exactly do you mean? Is it a mass buff-debuff like "Howl of Terror"?
 
Level 5
Joined
Jan 27, 2014
Messages
164
The trigger is in fact MUI.
'Triggering unit' can survive past through waits.
Then again, if that same unit cast the ability more than once within X seconds, then it will get weird. A workaround for this is to add cooldown for the ability so that the same unit cannot double cast within set time limit.

Alternatively, you can spawn a dummy to cast a buffing spell to your hero.
Then again, this depends on what you want.
 
Level 5
Joined
Jan 17, 2014
Messages
131
If you want it to be something like "Howl of Terror", how about this:

Trigger 1:
  • Trigger 1
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to "Your Hero Ability"
    • Actions
      • Unit Group - Pick every unit in (Units within 512.00 of (Position of (Triggering unit)) matching (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Triggering unit)) Equal to Player 1 (Red)
            • Then - Actions
              • Unit Group - Add (Picked unit) to "Player 1 Group"
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Owner of (Triggering unit)) Equal to Player 2 (Red)
                • Then - Actions
                  • Unit Group - Add (Picked unit) to "Player 2 Group"
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Owner of (Triggering unit)) Equal to Player 3 (Red)
                    • Then - Actions
                      • Unit Group - Add (Picked unit) to "Player 3 Group"
                    • Else - Actions
Trigger 2:
  • Trigger 2
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in "Player 1 Group" and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) has buff "The Buff from Your Hero Ability") Equal to True
              • (Level of "Your Hidden Ability" for (Picked unit)) Less than 1
            • Then - Actions
              • Unit - Add "Your Hidden Ability" to (Picked unit)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) has buff "The Buff from Your Hero Ability") Equal to False
                • Then - Actions
                  • Unit - Remove "Your Hidden Ability" from (Picked unit)
                  • Unit Group - Remove (Picked unit) from "Player 1 Group"
                • Else - Actions
      • Unit Group - Pick every unit in "Player 2 Group" and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) has buff "The Buff from Your Hero Ability") Equal to True
              • (Level of "Your Hidden Ability" for (Picked unit)) Less than 1
            • Then - Actions
              • Unit - Add "Your Hidden Ability" to (Picked unit)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) has buff "The Buff from Your Hero Ability") Equal to False
                • Then - Actions
                  • Unit - Remove "Your Hidden Ability" from (Picked unit)
                  • Unit Group - Remove (Picked unit) from "Player 2 Group"
                • Else - Actions
      • Unit Group - Pick every unit in "Player 3 Group" and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) has buff "The Buff from Your Hero Ability") Equal to True
              • (Level of "Your Hidden Ability" for (Picked unit)) Less than 1
            • Then - Actions
              • Unit - Add "Your Hidden Ability" to (Picked unit)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) has buff "The Buff from Your Hero Ability") Equal to False
                • Then - Actions
                  • Unit - Remove "Your Hidden Ability" from (Picked unit)
                  • Unit Group - Remove (Picked unit) from "Player 3 Group"
                • Else - Actions
But you'll have to do it for all players, I just did it for 3 as an example and it may cause lag.
 
Last edited:
Level 1
Joined
Jun 13, 2008
Messages
132
You should use loops, for each A to B do actions, and set TempPoint to clear it for leaks, custom script: "call RemoveLocation (udg_TempPoint)", the same with groups, set TempGroup to clear it for leaks, then custom script: "call DestroyGroup (udg_TempGroup)", also in conditions there should be "unit is alive" a boolean condition, in your idea I have to create several abilities in order to detect the debuff, but the trigger will run every 1 second, and, think if the trigger had run then in less than 0.3 second the unit casted the ability, this means that the debuff will last 2.7 seconds (if it lasts 3 ticks), but if the unit casts the ability exactly when the trigger occurs, it will last exactly 3 seconds. To solve this I could make the interval between each tick from 1 second to 0.1 seconds, but then I will need to create at least 31 abilities to manage the buff, and what if the buff lasts 12 seconds?, then I would need 121 abilities? I don't think It will work well...
 
Level 5
Joined
Jan 17, 2014
Messages
131
If you want it to be something like "Howl of Terror", how about this:

Trigger 1:
  • Trigger 1
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to "Your Hero Ability"
    • Actions
      • Unit Group - Pick every unit in (Units within 512.00 of (Position of (Triggering unit)) matching (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Triggering unit)) Equal to Player 1 (Red)
            • Then - Actions
              • Unit Group - Add (Picked unit) to "Player 1 Group"
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Owner of (Triggering unit)) Equal to Player 2 (Red)
                • Then - Actions
                  • Unit Group - Add (Picked unit) to "Player 2 Group"
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Owner of (Triggering unit)) Equal to Player 3 (Red)
                    • Then - Actions
                      • Unit Group - Add (Picked unit) to "Player 3 Group"
                    • Else - Actions
Trigger 2:
  • Trigger 2
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in "Player 1 Group" and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) has buff "The Buff from Your Hero Ability") Equal to True
              • (Level of "Your Hidden Ability" for (Picked unit)) Less than 1
            • Then - Actions
              • Unit - Add "Your Hidden Ability" to (Picked unit)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) has buff "The Buff from Your Hero Ability") Equal to False
                • Then - Actions
                  • Unit - Remove "Your Hidden Ability" from (Picked unit)
                  • Unit Group - Remove (Picked unit) from "Player 1 Group"
                • Else - Actions
      • Unit Group - Pick every unit in "Player 2 Group" and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) has buff "The Buff from Your Hero Ability") Equal to True
              • (Level of "Your Hidden Ability" for (Picked unit)) Less than 1
            • Then - Actions
              • Unit - Add "Your Hidden Ability" to (Picked unit)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) has buff "The Buff from Your Hero Ability") Equal to False
                • Then - Actions
                  • Unit - Remove "Your Hidden Ability" from (Picked unit)
                  • Unit Group - Remove (Picked unit) from "Player 2 Group"
                • Else - Actions
      • Unit Group - Pick every unit in "Player 3 Group" and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) has buff "The Buff from Your Hero Ability") Equal to True
              • (Level of "Your Hidden Ability" for (Picked unit)) Less than 1
            • Then - Actions
              • Unit - Add "Your Hidden Ability" to (Picked unit)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) has buff "The Buff from Your Hero Ability") Equal to False
                • Then - Actions
                  • Unit - Remove "Your Hidden Ability" from (Picked unit)
                  • Unit Group - Remove (Picked unit) from "Player 3 Group"
                • Else - Actions
But you'll have to do it for all players, I just did it for 3 as an example and it may cause lag.

Ops, I goofed. You need only 1 group. Sorry about that. It should look like this:

Trigger 1:
  • Trigger 1
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to "Your Hero Ability"
    • Actions
      • Unit Group - Pick every unit in (Units within 512.00 of (Position of (Triggering unit)) and do (Actions)
        • Loop - Actions
          • Unit Group - Add (Picked unit) to "Your Unit Group"
Trigger 2:
  • Trigger 2
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in "Your Unit Group" and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) has buff "The Buff from Your Hero Ability") Equal to True
              • (Level of "Your Hidden Ability" for (Picked unit)) Less than 1
            • Then - Actions
              • Unit - Add "Your Hidden Ability" to (Picked unit)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) has buff "The Buff from Your Hero Ability") Equal to False
                • Then - Actions
                  • Unit - Remove "Your Hidden Ability" from (Picked unit)
                  • Unit Group - Remove (Picked unit) from "Your Unit Group"
 
Last edited:
Level 7
Joined
Mar 6, 2006
Messages
282
You're using a dummy unit with an expiration timer, to wait a certain amount of time. You can take the unit out of the trigger, and just use a countdown timer; it would be the same thing. Also, using a wait like with, with triggeringunit WOULD work, but as someone said, yes, the unit can't cast it twice before the first wait was over. Also, if someone is lagging or the game is paused, the wait still runs. A countdown timer is highly suggested.
 
Level 5
Joined
Jan 17, 2014
Messages
131
wut? it's so simple so that if you submit it into spell section, you will got rejected



you are crazy. it's a lot more complicated :| but a lot better than mine of course

Well, I have to admit, half of your trigger looks like chicken scratch to me. I mostly didn't understand it, but if you say that mine is more complicated, OK. But still 1 part of it should be changed. Instead of picking only enemy units in range, it should pick all units in range. After that the "Buff Checker" trigger will sort them out.
 

Kazeon

Hosted Project: EC
Level 34
Joined
Oct 12, 2011
Messages
3,449
first, it's not yours, if it's yours, logically you could understand mine which is the simple form of the buff system you attached above. don't admit other people's as yours :) it's funny

wut? it's so simple so that if you submit it into spell section, you will got rejected



you are crazy. it's a lot more complicated :| but a lot better than mine of course

hey, I'm sorry for that post. I opened the wrong file (not yours) named "Buff System v1.7" so I call mine is the simpler form of that buff system

I know mine looks like a chicken stratch for you but it's a standart of spell making, a proper way to make MUI system or spell, or another way you could use hashtable. :)
 

Attachments

  • Buff System v1.7.w3x
    54.8 KB · Views: 40
Level 5
Joined
Jan 17, 2014
Messages
131
first, it's not yours, if it's yours, logically you could understand mine which is the simple form of the buff system you attached above. don't admit other people's as yours :) it's funny



hey, I'm sorry for that post. I opened the wrong file (not yours) named "Buff System v1.7" so I call mine is the simpler form of that buff system

I know mine looks like a chicken stratch for you but it's a standart of spell making, a proper way to make MUI system or spell, or another way you could use hashtable. :)

Right now I'm at work and I can't have a look that map. I also don't have full understanding of the trigger editor and it's possibilities and limits. I'm not a pro, I don't know how to do a lot of things, but I still think that my trigger is very simple to make. I also think that although simple, the trigger is efficient.
Thank you for your time. :)
 
Level 5
Joined
Jan 17, 2014
Messages
131
okay, good luck, keep learning :)
but keep this in mind: using waits is bad ;)

Not necessarily, if you use them to make something primitive, you can afford to use waits, but I know that waits aren't flexible or bendable. Thanks for the tip though.
 
Status
Not open for further replies.
Top