• 🏆 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 - add the event" problem (GUI)

Status
Not open for further replies.
Level 4
Joined
Jun 19, 2010
Messages
113
  • Trigger - Add to DamageHeal <gen> the event (Unit - (Triggering unit) Takes damage)
at begining trigger looks like this:
trigger
event
condition
action
<actions>

later

trigger
event
unit recieve damage
condition
action
<actions>
(runs 1 time)

later

trigger
event
unit recieve damage
unit recieve damage
unit recieve damage
unit recieve damage
unit recieve damage
unit recieve damage
unit recieve damage
condition
action
<actions>
(runs freaking many times)

and so on.


i need action that would clear trigger from those events.
for rep ofc
 
Level 11
Joined
Jan 25, 2009
Messages
572
Well you can prevent from adding the same unit over and over again to the event.
Just going to open WE. Just a sec =)

Here you have it =)

  • Trigger 1
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) is in Eventgroup) Equal to False
        • Then - Actions
          • Trigger - Add to Trigger 2 <gen> the event (Unit - (Triggering unit) Takes damage)
          • Unit Group - Add (Triggering unit) to Eventgroup
        • Else - Actions
 
Level 4
Joined
Jun 19, 2010
Messages
113
yeah, i tryed some thing like this
this prevent trigger to spam events with same unit

but main problem not gone. it s not 10, or 100 units in map, there is much more :D

and... 100+ events in one trigger, that runs on every attack... dunno, will it cause lag or not, but it sounds very... ugly.

anyway, it's does not matter, i already found a workaround
thank to ya, guys.
 
Level 11
Joined
Jan 25, 2009
Messages
572
Nope it wont cause lagg because it checks throught the list of the event until it finds the right one. It WILL cause lag after a while, or maybe bug/crash, because you add meaby like 20 events of the same unit. It may heal 20 times over or something if you use this for an heal stuff.
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,468
Yes, trigger destruction is terrible if you have any trigger actions assigned to it.

The most ingenious way to use dynamic triggers these days is to not create one single trigger/event per unit but a bunch of events on one trigger and destroy the trigger every so often and only re-add the events for units that are still alive ;)
 
Status
Not open for further replies.
Top