• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Trigger leaks?

Status
Not open for further replies.
Level 15
Joined
Aug 11, 2009
Messages
1,606
I'm using the following trigger in my map,but i have a strange error/bug.Every 3 sec(my Wait-game time action) my whole screen turns to black for a very short ammount of time.I mean that since i made this trigger every 3 sec my whole screen turns black(like a problem with camera or something) for 0,5 sec and then to normal again.Here is the trigger....
  • UseSpell
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacked unit)) Equal to Blood Elf Priest
      • (Owner of (Attacked unit)) Equal to Player 1 (Red)
    • Actions
      • Unit Group - Pick every unit in (Units of type Blood Elf Priest) and do (Unit - Order (Attacked unit) to Orc Far Seer - Chain Lightning (Random unit from (Units in (Current camera bounds) owned by Player 8 (Pink))))
      • Wait 3.00 seconds
      • Unit Group - Order (Units of type Blood Elf Priest) to Attack-Move To (Player 8 (Pink) start location)
      • Unit Group - Order (Units of type Blood Elf Priest) to Attack-Move To (Center of Creep Attack1 <gen>)
Is there anything wrong with it?
 
Level 4
Joined
Apr 16, 2009
Messages
85
first of all i would change this

  • UseSpell
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacked unit)) Equal to Blood Elf Priest
      • (Owner of (Attacked unit)) Equal to Player 1 (Red)
    • Actions
      • Unit Group - Pick every unit in (Units of type Blood Elf Priest) and do (Unit - Order (Attacked unit) to Orc Far Seer - Chain Lightning (Random unit from (Units in (Current camera bounds) owned by Player 8 (Pink))))
      • Wait 3.00 seconds
      • Unit Group - Order (Units of type Blood Elf Priest) to Attack-Move To (Player 8 (Pink) start location)
      • Unit Group - Order (Units of type Blood Elf Priest) to Attack-Move To (Center of Creep Attack1 <gen>)

to:

  • UseSpell
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacked unit)) Equal to Blood Elf Priest
      • (Owner of (Attacked unit)) Equal to Player 1 (Red)
    • Actions
      • Unit - Order (Attacked unit) to Orc Far Seer - Chain Lightning (Random unit from (Units in (Current camera bounds) owned by Player 8 (Pink)))
      • Wait 3.00 seconds
      • Unit Group - Order (Units of type Blood Elf Priest) to Attack-Move To (Player 8 (Pink) start location)
      • Unit Group - Order (Units of type Blood Elf Priest) to Attack-Move To (Center of Creep Attack1 <gen>)
 
Level 4
Joined
Apr 16, 2009
Messages
85
back to your question about leaks: you use GUI functions and they do leak - they shouldn't make the game freeze though (at least not when run the first time)

(to be precise the version you posted leaked at least: 2 Groups 1 Rect and 2 Locations)

and the lag is most likely because the game creates 1 Group (and fills it), creates 1 Rect and gives one order to the Attacked Blood Elf Priest for Every Blood Elf Priest on the map (don't know how many you have but if you have a lot of them this could really be a problem)
 
Level 10
Joined
Sep 21, 2007
Messages
517
before unit group - order bla bla bla create a custom script action and type in "set bj_wantDestroyGroup = true" each time you do shit with a group, you put in that, what it does is destroy the group after its been used... sometimes when you want to use the group for alot of time (sorry for newbish descrptior lmao) you just set a group variable = units of type, or w/e basically any group, then after its been used destroy the variable whenever youd like. Kapish? ;P
 
Level 22
Joined
Nov 14, 2008
Messages
3,256
set unitgroup[1] = units of type blood priest
set unitgroup[2] = random units in current camera bounds
set point = center of creep
pick all units in unitgroup[1] and order units to cast lightning to a random unit in unitgroup[2]
pick all units in unitgroup[1] and order units to attack move point

call removeloaction(udg_point)
call destroygroup(udg_unitgroup[1])
call destroygroup(udg_unitgroup[2])
 
Level 15
Joined
Aug 11, 2009
Messages
1,606
I will make the trigger later,if i have any problem i will edit this post.Thx to the 3 of you that helped me and ofc +rep :)

Ok here is the trigger,is this ok?
  • UseSpell
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacked unit)) Equal to Blood Elf Priest
      • (Owner of (Attacked unit)) Equal to Player 1 (Red)
    • Actions
      • Set BloodElfPriestGroup = (Units owned by Player 1 (Red) of type Blood Elf Priest)
      • Set RandomCameraGroup = (Units in (Current camera bounds) matching ((Owner of (Triggering unit)) Equal to Player 8 (Pink)))
      • Unit Group - Pick every unit in BloodElfPriestGroup and do (Unit - Order (Attacked unit) to Orc Far Seer - Chain Lightning (Random unit from RandomCameraGroup))
      • Wait 3.00 seconds
      • Unit Group - Order BloodElfPriestGroup to Attack-Move To (Player 1 (Red) start location)
      • Unit Group - Order BloodElfPriestGroup to Attack-Move To (Center of Creep Attack2 <gen>)
      • Custom script: call DestroyGroup(udg_BloodElfPriestGroup)
      • Custom script: call DestroyGroup(udg_RandomCameraGroup)
 
Last edited:
Level 12
Joined
Aug 22, 2008
Messages
911
Ye be needin' to remove those point leaks, ye scurvydog! Fer each location ye blast this into yar trigger:
  • Set point = (Yer Point)
  • Unit Group - Order BloodElfPriestGroup to Attack-Move to point
  • Custom script: call RemoveLocation(udg_point)
Ye can use the same bleedin' variable fer both these scurvy points.
 
Level 15
Joined
Aug 11, 2009
Messages
1,606
I guess now i have to fix other stuff too in my map,cause i use the same Move-Attack commands for my Creeps Spawn trigger...Working on them now,i will post the trigger later.
  • UseSpell
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacked unit)) Equal to Blood Elf Priest
      • (Owner of (Attacked unit)) Equal to Player 1 (Red)
    • Actions
      • Set BloodElfPriestGroup = (Units owned by Player 1 (Red) of type Blood Elf Priest)
      • Set RandomCameraGroup = (Units in (Current camera bounds) matching ((Owner of (Triggering unit)) Equal to Player 8 (Pink)))
      • Set AttackPoint = (Center of Creep Attack1 <gen>)
      • Unit Group - Pick every unit in BloodElfPriestGroup and do (Unit - Order (Attacked unit) to Orc Far Seer - Chain Lightning (Random unit from RandomCameraGroup))
      • Wait 3.00 seconds
      • Unit Group - Order BloodElfPriestGroup to Attack-Move To AttackPoint
      • Custom script: call DestroyGroup(udg_BloodElfPriestGroup)
      • Custom script: call DestroyGroup(udg_RandomCameraGroup)
      • Custom script: call RemoveLocation(udg_AttackPoint)
 
Status
Not open for further replies.
Top