• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Trigger] Need someone to help me make this trigger leakless!

Status
Not open for further replies.
Level 6
Joined
Jun 23, 2005
Messages
195
EVENT:
Time - Every 3.00 seconds of game time

ACTION
Unit Group - Pick every unit in (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to Freezing Field)) and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Then - Actions
Unit Group - Pick every unit in (Random 1 units from (Units within 500.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
((Picked unit) has buff freez ) Equal to True
Then - Actions
Set FreezingFieldFreeze = (Picked unit)
Else - Actions
Skip remaining actions
Unit - Order (Picked unit) to Night Elf Keeper Of The Grove - Entangling Roots FreezingFieldFreeze
Else - Actions
Do nothing


I used so much effort to come up with this trigger that actually works but its too complicated to mee to make it leakless. Also couldnt figure how to only pick random unit with the buff, so it doesnt work 100% like i want it to work
 
Level 21
Joined
Aug 21, 2005
Messages
3,699
ehm...

There's no point in having an if/then/else action if you're not using any conditions.
The trigger itself is rather simplistic, but here's the leakless one anyway:
  • Actions
    • Custom script: set bj_wantDestroyGroup = true
    • Unit Group - Pick every unit in (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to Freezing Field)) and do
      • Loop - Actions
        • Set TempPoint = position of picked unit
        • Set TempUnitGroup = Units within 500.00 of (Position of (Picked unit)))
        • Set TempUnit = Random 1 units from (TempUnitGroup)
        • Unit - Order TempUnit to Night Elf Keeper Of The Grove - Entangling Roots FreezingFieldFreeze
        • set TempUnit = no unit
        • Custom script: call DestroyGroup(udg_TempUnitGroup)
        • Custom script: call RemoveLocation(udg_TempPoint)
 
Level 6
Joined
Jun 23, 2005
Messages
195
ehm...

There's no point in having an if/then/else action if you're not using any conditions.
The trigger itself is rather simplistic, but here's the leakless one anyway:
  • Actions
    • Custom script: set bj_wantDestroyGroup = true
    • Unit Group - Pick every unit in (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to Freezing Field)) and do
      • Loop - Actions
        • Set TempPoint = position of picked unit
        • Set TempUnitGroup = Units within 500.00 of (Position of (Picked unit)))
        • Set TempUnit = Random 1 units from (TempUnitGroup)
        • Unit - Order TempUnit to Night Elf Keeper Of The Grove - Entangling Roots FreezingFieldFreeze
        • set TempUnit = no unit
        • Custom script: call DestroyGroup(udg_TempUnitGroup)
        • Custom script: call RemoveLocation(udg_TempPoint)

OK thx. I modified the trigger a bit after i posted this but i quess i can make it with this alone.

*edit* this is what i got im gona test it later

  • Custom script: set bj_wantDestroyGroup = true
  • Unit Group - Pick every unit in (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to Freezing Field)) and do (Actions)
    • Loop - Actions
      • Set FF_point = (Position of (Picked unit))
      • Set FF_group = (Units within 500.00 of FF_point)
      • Unit Group - Pick every unit in (Random 1 units from (Units within 500.00 of FF_point matching (((Triggering unit) has buff Freezing Aura ) Equal to True))) and do (Actions)
        • Loop - Actions
          • Set FF_unit = (Picked unit)
      • Unit - Order (Picked unit) to Night Elf Tree Of Life - Entangle FF_unit
      • Set FF_unit = No unit
      • Custom script: call DestroyGroup(udg_FF_group)
      • Custom script: call RemoveLocation(udg_FF_point)
*2nd Edit*
Yeah i noticed that I had one useless trigger there, but mate your trigger aint even close what im trying to do so I gotta go back to modifying my first trigger since it worked the best.
 
Last edited:
Status
Not open for further replies.
Top