• 🏆 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!

[Spell] Removing ability (item) from a unit.

Status
Not open for further replies.
Level 5
Joined
Oct 16, 2015
Messages
132
Ok, so my problem is, I made a AoE spell that decreases armor of enemy units nearby, so I made a dummy spell based on the bonus armor in item category and added it to nearby enemy units. But the problem is... I cant remove them. Why??
 
Level 6
Joined
Jun 4, 2017
Messages
172
I can create an example trigger for you, but first I want to be sure if I understood completely, you need a spell which enemies units gain if your hero is close and this ability will be removed if your hero goes away am I right?
 
Level 6
Joined
Jun 4, 2017
Messages
172
Sorry for the really really late reply, also sorry for the misinformation, the skill can be activated which decreases armor of nearby units.
In my map you will find what you are searching for except that the ability is passive and it's every time active, but however I don't think it will be hard to make it actionable, just make an ability that activate the trigger in my map and after some time it will disabled it.
post

triggers

you have made a mistake which we can't identify unless you post triggers
Sorry I'm new to this site so I don't know how to post the entire trigger but if you want I can write it there.

P.S. Sorry for bad English.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,199
Sorry I'm new to this site so I don't know how to post the entire trigger but if you want I can write it there.
To copy a GUI trigger into a forum post.
  1. Select trigger root. This is usually above Events and is the element with the trigger name.
  2. Right click trigger root.
  3. Select the option to copy trigger as text.
  4. Change forum post area to "Use BB Code Editor" instead of the default Rich editor. This prevents the trigger text being automatically mangled.
  5. Paste the trigger text in-between trigger tags [TRIGGER]Trigger Text Here[/TRIGGER].
 
Level 6
Joined
Jun 4, 2017
Messages
172
To copy a GUI trigger into a forum post.
  1. Select trigger root. This is usually above Events and is the element with the trigger name.
  2. Right click trigger root.
  3. Select the option to copy trigger as text.
  4. Change forum post area to "Use BB Code Editor" instead of the default Rich editor. This prevents the trigger text being automatically mangled.
  5. Paste the trigger text in-between trigger tags [TRIGGER]Trigger Text Here[/TRIGGER].
Oh ok i see, thank you Dr Super Good, I will try that immediately with the triggers which are in the test that I sent.

Ok my triggers requires 3 variables: one is a unit group where you should put every units who can be targeted by the ability of decreasing armor, the other variable is a unit variable and is your hero unit, the last variable is a point variable for check enemies units in range of your hero.

  • map initialization
    • Eventi
      • Map initialization
    • Condizioni
    • Azioni
      • Visibilità - Create an initially Attivo visibility modifier for Giocatore (Rosso) emitting Visibilità across (Playable map area)
      • Set bad_guys = (Units owned by Giocatore 2 (Blu))
  • range check
    • Eventi
      • Tempo - Every 1.00 seconds of game time
    • Condizioni
    • Azioni
      • Gruppo di unità - Pick every unit in bad_guys and do (Actions)
        • Giro - Azioni
          • Set good_guy_position = (Position of Fante 0001 <gen>)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • Se - Condizioni
              • ((Picked unit) is in (Units within 500.00 of good_guy_position)) Uguale a TRUE
            • Allora - Azioni
              • Unità - Add Decrease Armor (+10) to (Picked unit)
            • Altrimenti - Azioni
              • Unità - Remove Decrease Armor (+10) from (Picked unit)
          • Custom script: call RemoveLocation(udg_good_guy_position)
These 2 triggers will do all the work.

PS My editor is in Italian so if you don't understand something just tell me and I'm going to explain :)
 
Last edited:

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,199
RG00 your trigger leaks a group for every "bad_guys" unit every second. The group leak is located in the if then else condition. It also does not seem very MUI friendly, which might be a requirement.

There is an Edit button. I recommend editing your post rather than multi posting.
 
Level 6
Joined
Jun 4, 2017
Messages
172
RG00 your trigger leaks a group for every "bad_guys" unit every second. The group leak is located in the if then else condition.
I'm not an expert with triggers leak but the group should every time be replaced because it should store the group in the variable I think.
It also does not seem very MUI friendly, which might be a requirement.
I tested it and it works even if you have 100 enemy units in your map, however it works only if you have only your hero who is using this ability.
There is an Edit button. I recommend editing your post rather than multi posting.
Yes, I know sorry, That was my first time pasting a trigger in the message and I thought it may be necessary to make a post for each trigger. That is not going to happen again I promise.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,199
I'm not an expert with triggers leak but the group should every time be replaced because it should store the group in the variable I think.
I am referring to this leak...
((Picked unit) is in (Units within 500.00 of good_guy_position)) Uguale a TRUE
You create a new unit group "Units within 500.00 of good_guy_position" but never destroy it.
tested it and it works even if you have 100 enemy units in your map, however it works only if you have only your hero who is using this ability.
He might need multiple heroes to support the ability. Depends on requirements.
 
Level 6
Joined
Jun 4, 2017
Messages
172
I am referring to this leak...
You create a new unit group "Units within 500.00 of good_guy_position" but never destroy it.
Sorry I didn't see it thanks for the information I'm going to fix that immediately.
He might need multiple heroes to support the ability. Depends on requirements.
Sorry but I didn't managed to make a MUI trigger with all of those units groups which I have to create. Too hard for me I think.
 
Last edited:
Level 8
Joined
Jan 28, 2016
Messages
486
@SSJ7107 If you want to create a negative armour aura, you can use a custom Devotion Aura with a negative value (shift+enter or shift+clicking on the field in the Object Editor). You can then use a trigger to add the custom aura to the unit and then using indexing, to check every X seconds if the duration of the aura is over and if so, remove it.
 
Status
Not open for further replies.
Top