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

I'm lost and need help with a simple trigger

Status
Not open for further replies.
Level 1
Joined
Apr 14, 2019
Messages
2
Sorry if this is a very basic question but I can't really find anything on this and I've spent several days looking.

Hello I'm pretty okay at triggering in GUI. I know all about loops, destroying locations, and avoiding leaks. But I don't know how to remove a buff 10 seconds later using a trigger.


For example lets say if a Hero casts an ability, then give ability +10 weapon damage to triggering unit. but I don't really know where to go from there other than creating a dummy unit that casts chain lightning on trigger_unit(spell_times) that removes ability +10 weapon damage. This doesn't work because if the Hero dies with the ability then he keeps it.

1. How do I make a super simple trigger that counts up from 0-10 and then removes +10 weapon damage ability from units in unit group that casted the ability or buff when the integer reaches 10? (or if the Hero dies)

Thanks :]





2. Also does the trigger: Display to (Playergroup((Owner of Triggering Unit)))) the text: "Does playergroup leak?"

Should I use Playergroup((Owner of Triggering Unit)))) instead of setting it as set_player[0] Owner of Triggering Unit instead? Or is it less efficient?



3. Is it true that having one master Event trigger that turns on spell triggers is better than having 20 different Event triggers for spells? How much of a difference does this make? Does this cause a lot of strain by having to check 30 conditions every time you cast a spell?

4. Also also does making "A Unit is Attacked" event trigger slow down the map in any way? Because then the map would have to check every single attack to see if the conditions are true. I made a trigger so that if you attack an ally it would unally you and the target but I'm not sure how much strain this adds on the map so I'm hesitant if I should use it.





Thanks :] x2
 
Last edited:
Level 39
Joined
Feb 27, 2007
Messages
5,019
I have no idea what you're saying about chain lightning since it has nothing to do with damage increases or buffs...?

1. Counting to X seconds and removing a buff is not an easy thing to do properly in GUI without access to timers. The Wait function progresses even while the game is lagging or paused, and Wait (Game-time) leaks a reference so it shouldn't be used. It would be best if the buff removed itself by expiring after 10 seconds, and to that end it would be easiest to just modify a base wc3 spell instead of using a trigger. Is there some reason you can't use a dummy to cast Roar in the right area? You could also use Cripple or Soul Burn with negative damage reduction values but they would have to be individually cast on every unit in the AoE.

2. Yes, using Playergroup like that leaks the player group. I don't understand what you're saying about set_player[0] or what you mean about it being efficient.

3. No it's not better to do one master spell trigger; because of the way GUI structures conditions checking long if trees is way worse than checking conditions for each spell firing. It makes little difference, but triggerconditions are specifically extremely fast to evaluate.

4. This will not cause system strain, but be aware that the attacked even actually runs when a unit begins its attack (before the attack is actually confirmed/projectile launched). Test it by ordering a unit to attack something and then quickly pressing S (stop) before the attack connects/launches and you will see how it works. If you want to detect damaging allies then you should use a damage detection system (of which there are many in the resources section).
 
Level 15
Joined
Jul 9, 2008
Messages
1,552
1.you will need to get into dynamic indexing triggers to do those kind of spells with gui
Visualize: Dynamic Indexing

2.yes player groups leak

3. no it wont make much of a difference. i believe it will actually be worse to do a master event that checks through all the spells.

4.i suggest u use Damage Engine 3.8.0.0 for any "unit is attacked" because using that players can abuse it by spaming stop because the trigger will fire every time the unit tries to attack and not when the unit actually attacks.
 
Status
Not open for further replies.
Top