• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] How do you removed a buff?

Status
Not open for further replies.
Level 10
Joined
Feb 19, 2006
Messages
237
I want to use remove a specific buff (invisibility) from a unit using triggers.

I have tried "Remove invisibility buff from picked unit" however it does not work...i know the rest of my trigger worked because the "picked unit" IS detected however this action does not remove the invisibility buff from him...
 
Level 10
Joined
Feb 19, 2006
Messages
237
Camoflauge Remove
Events
Time - Every 0.50 seconds of game time
Conditions
Actions
Unit Group - Pick every unit in (Units in (Playable map area) matching (((Matching unit) has buff Invisibility) Equal to True)) and do (Actions)
Loop - Actions
Game - Display to (All players) the text: Unit picked...
Destructible - Pick every destructible within 200.00 of (Position of (Picked unit)) and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Destructible-type of (Picked destructible)) Not equal to Ashenvale Tree Wall
Then - Actions
Unit - Remove All buffs from Bandit Woodsman 0003 <gen>
Game - Display to (All players) the text: Invisibility remove...
Else - Actions
Game - Display to (All players) the text: Destructables detec...



I even tried to change it to "remove ALL buffs from picked unit" but even THAT doesn't remove the invisibility buff...and i changed "picked unit" to a specific unit and it still does not work...
 
Level 10
Joined
Feb 19, 2006
Messages
237
Is "invisibility removed" popping up? Or is the other message showing?

the "unit picked" messege always shows...the "destructable detected" messge shows when my unit is within 200 of a tree...when i move him furthur the "unit picked" still continues to show however the "destructable detected does not" which is how its supposed to be

to answer your question..no the "invisibility removed" messege does not show...
 
Level 3
Joined
Apr 20, 2010
Messages
46
What if you try swapping "Not Equal to" to "Equal to" and swap the Then/Else actions.

watermelon_1234 brings up a Very good point.
 
Last edited:
Level 18
Joined
Jan 21, 2006
Messages
2,552
The "stupid blizzard BJ functions" call the natives, so eliminating the middle-man from the equation will not change the result. You've only said what everybody else has already, and from the information given in the 3rd post he says he even tried removing every buff.

The function itself, however, works completely fine (and always has). I set up a test that removed invisibility from a unit 3 seconds after it was cast on the unit. It seemed to work as expected, so I'm thinking the problem lies elsewhere.

GhostThruster said:
Honestly, the reason is so bloody obvious! It is a freakin ability that is PASSIVE(which means a buff is generated constantly. So, like Anachron wrote, you must remove the ability, and then re-add it later on.
GUI action is Unit - Remove Permanent Invisibility

Anachron suggested the function by which both abilities and buffs are removed, but he clearly states in his post that he's referring to removing buffs. I also doubt the author is talking about permanent invisibility, he makes it pretty clear that he's concerned about the Invisibility buff specifically.
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
Anachron said:
They can be treated like abilities in every way.

No, they cannot be added as abilities are. They also are only either level 1 or level 0, indicating whether the unit has the buff or not (but not what level the buff is).

Anachron said:
Then, if BJ work so well, tell me why SetUnitPos bugs a lot, such as some other BJs like IssueOrder and so? Natives work fine.

Well give me an example of these functions not working.
 
SetUnitPos also pauses the unit and does not work when the unit is moving.
IssueOrderCommands in GUI are awful because of the convertion, which sometimes fails, we had a discussion on wc3c.net some time ago.

No, they cannot be added as abilities are. They also are only either level 1 or level 0, indicating whether the unit has the buff or not (but not what level the buff is).
Well, have you tried it?
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
It pauses the unit, sure, but that isn't a bug --that always happens. Also, it works perfectly normal when the unit is moving, though it will interrupt the order due to the small pause that it inflicted on the unit.

Anachron said:
Well, have you tried it?

Yes, and that is one of the major reasons for requiring a library like ABuff.
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
It still works properly, and that's the point. It only takes a couple of seconds to set up a test map and determine whether or not there is a problem with the function in any case, and it works fine. It even removes the buff Invisibility, so there is nothing special about the buff that disallows it from being removed.

Post a map that includes the problem you are referring to, because in a blank map removing the buff Invisibility from a Footman that has the buff (inflicted from a Sorceress in my test-map) works properly.
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
Why? Invisibility has no problems being removed in-game, the problem lies somewhere within his map I'm guessing (or in his description of the problem) but there is no reason why the Invisibility buff shouldn't be removed if you removing the buffs.
 
Level 8
Joined
Apr 30, 2009
Messages
338
Your trigger is totally wrong.

You are picking every destructable in range, and you only remove the buff if a destructable that isn't a tree is detected. So if you moved near a rock, it would remove it. If you move near no destructables, it does nothing. You have to count the number of trees in 200 range and remove the buff if the number is 0.

this works, tried it on my map. You have to change the values to your map of course.

  • Untitled Trigger 001
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (INVIS_GROUP is empty) Equal to False
        • Then - Actions
          • Unit Group - Pick every unit in INVIS_GROUP and do (Actions)
            • Loop - Actions
              • Set temp_integer = 0
              • Set temp_point = (Position of (Picked unit))
              • Destructible - Pick every destructible within 300.00 of temp_point and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Destructible-type of (Picked destructible)) Equal to Summer Tree Wall
                    • Then - Actions
                      • Set temp_integer = (temp_integer + 1)
                    • Else - Actions
              • Game - Display to (All players) the text: ((String(temp_integer)) + trees detected in range.)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • temp_integer Equal to 0
                • Then - Actions
                  • Unit - Remove Invisibility buff from (Picked unit)
                  • Unit Group - Remove (Picked unit) from INVIS_GROUP
                  • Game - Display to (All players) the text: (Invisibility removed from + ((Name of (Picked unit)) + .))
                • Else - Actions
              • Custom script: call RemoveLocation(udg_temp_point)
        • Else - Actions
          • Trigger - Turn off (This trigger)
all the people above me are morons
 

Attachments

  • terr.w3x
    46.5 KB · Views: 58
Last edited:
Level 18
Joined
Jan 21, 2006
Messages
2,552
I didn't even notice he said that. What's funny is that he uses moron-o-matic GUI triggers.

Let me closely exam what he wrote:
  • Actions
    • Unit Group - Pick every unit in (Units in (Playable map area) matching (((Matching unit) has buff Invisibility) Equal to True)) and do (Actions)
      • Loop - Actions
        • Game - Display to (All players) the text: Unit picked...
    • Destructible - Pick every destructible within 200.00 of (Position of (Picked unit)) and do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Destructible-type of (Picked destructible)) Not equal to Ashenvale Tree Wall
          • Then - Actions
            • Unit - Remove All buffs from Bandit Woodsman 0003 <gen>
            • Game - Display to (All players) the text: Invisibility remove...
          • Else - Actions
            • Game - Display to (All players) the text: Destructables detec...
The author of this thread should have noticed that the improper message was being displayed; I'm going to rule this off as a pretty poorly posed problem. If any effort had really been put into solving this problem on the author's part (including the extremely small amount of work it takes to properly ask a question, rather than just spewing down thoughts in a post). If the GUI trigger tags had been used it would have been pretty obvious.

As for tml616, your comment just makes you look like an idiot. I doubt anybody is really offended by some arrogant dip-stick who's only been here for a year, especially since everyone you're referring to predates you by quite a bit.
 
Level 10
Joined
Feb 19, 2006
Messages
237
I didn't even notice he said that. What's funny is that he uses moron-o-matic GUI triggers.

Let me closely exam what he wrote:
  • Actions
    • Unit Group - Pick every unit in (Units in (Playable map area) matching (((Matching unit) has buff Invisibility) Equal to True)) and do (Actions)
      • Loop - Actions
        • Game - Display to (All players) the text: Unit picked...
    • Destructible - Pick every destructible within 200.00 of (Position of (Picked unit)) and do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Destructible-type of (Picked destructible)) Not equal to Ashenvale Tree Wall
          • Then - Actions
            • Unit - Remove All buffs from Bandit Woodsman 0003 <gen>
            • Game - Display to (All players) the text: Invisibility remove...
          • Else - Actions
            • Game - Display to (All players) the text: Destructables detec...
The author of this thread should have noticed that the improper message was being displayed; I'm going to rule this off as a pretty poorly posed problem. If any effort had really been put into solving this problem on the author's part (including the extremely small amount of work it takes to properly ask a question, rather than just spewing down thoughts in a post). If the GUI trigger tags had been used it would have been pretty obvious.

As for tml616, your comment just makes you look like an idiot. I doubt anybody is really offended by some arrogant dip-stick who's only been here for a year, especially since everyone you're referring to predates you by quite a bit.

Why do you keep on blaming people...I put all the effort i was able to into solving this problem...I came to ask here because I was out of options...you need to get laid my friend.

And tml616 thank you so much, your trigger works perfectly and its very easy to understand. Thanks a lot bro
 
Level 8
Joined
Apr 30, 2009
Messages
338
yeah I need to learn to conduct myself.

while all you guys started some random pissing contest about if buffs are hidden abilities, I answered the actual question with a working solution.
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
It had nothing to do with "if buffs are hidden abilities". That's right, you answered the question --good for you. That doesn't give you the privilege of calling others stupid just because you answered a question, especially when you don't even really know what they're talking about.
 
Status
Not open for further replies.
Top