• 🏆 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] Bug with Unit Group

Status
Not open for further replies.
Level 5
Joined
May 17, 2007
Messages
106
Bug with Unit Group Variable

Hi there

I want to ask you guys, my ability Blazing Helberd is DoT passive by trigger
but when playing trigger won't work somehow

from my thought it's come from 1 of my unit (other DoT work except this hero)

*Note*
Blazing Helberd base on Slow Poison, stackable Attack speed (well, it's won't stacking too even checked in Stack Flag)
-------------

  • Blazing Helberd Effect
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Blazing Helberd
    • Actions
      • Unit - Add Blazing Helberd Effect to SamNogard
      • Trigger - Turn on Blazing Helberd Start <gen>
      • Trigger - Turn on Blazing Helberd Damage <gen>
      • Trigger - Turn off (This trigger)
-------------

  • Blazing Helberd Start
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Attacking unit) Equal to SamNogard
      • (Level of Blazing Helberd for SamNogard) Greater than 0
    • Actions
      • Unit Group - Add (Attacked unit) to ZAUnitGroup18
------------

  • Blazing Helberd Damage
    • Events
      • Time - Every 0.90 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in ZAUnitGroup18 and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • ((Picked unit) has buff Blazing Helberd (Stacking)) Equal to True
                  • ((Picked unit) has buff Blazing Helberd (Non-stacking)) Equal to True
            • Then - Actions
              • Unit - Cause SamNogard to damage (Picked unit), dealing ((6.25 x (Real((Level of Blazing Helberd for SamNogard)))) + (((Real((Strength of SamNogard (Include bonuses)))) x (Random real number between 0.30 and 0.50)) x ((Real((Level of Blazing Helberd for SamNogard))) x 0.10))) damage of attack type Hero and damage type Normal
            • Else - Actions
I've try to firgue out for a week now
when select this hero it's almost ruin all Unit Group Variable

  • Dracomancer Guardian
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • (Unit-type of (Sold unit)) Equal to |cffFFCC00Dracomancer Guardian|r
    • Actions
      • Set SamNogard = (Sold unit)
      • Camera - Set the camera bounds for (Owner of (Buying unit)) to (Playable map area)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Owner of (Buying unit)) Equal to Player 1 (Red)
              • (Owner of (Buying unit)) Equal to Player 2 (Blue)
              • (Owner of (Buying unit)) Equal to Player 4 (Purple)
              • (Owner of (Buying unit)) Equal to Player 5 (Yellow)
        • Then - Actions
          • Set ABTempRevivePoint = (Random point in Hero Spawn T1 <gen>)
          • Unit - Move (Buying unit) instantly to ABTempRevivePoint
          • Unit - Move (Sold unit) instantly to ABTempRevivePoint, facing Default building facing degrees
          • Unit - Create 1 |cff00ff00Faerie Dragon for (Owner of SamNogard) at ABTempRevivePoint facing Default building facing degrees
          • Set DracomancerSummon = (Last created unit)
          • Hero - Add 2600 experience to DracomancerSummon, Hide level-up graphics
          • Unit - Hide DracomancerSummon
          • Hero - Disable experience gain for DracomancerSummon
        • Else - Actions
      • Trigger - Add to Mysterious Random Aura Buff <gen> the event (Time - Every (25.00 - ((Real((Level of Mysterious Random Aura for DracomancerSummon))) x 0.50)) seconds of game time)
      • Set ABTempRevivePoint = (Position of (Sold unit))
      • Unit Group - Add SamNogard to ItemPickerGroup
      • Unit Group - Add DracomancerSummon to ItemPickerGroup
      • Camera - Pan camera for (Owner of (Buying unit)) to ABTempRevivePoint over 0.00 seconds
      • Selection - Select (Sold unit) for (Owner of (Buying unit))
      • Custom script: call RemoveLocation(udg_ABTempRevivePoint)
      • Trigger - Turn on Destinal died <gen>
anyone know?

or anyone know that custom scripts can make Unit Group Variable become buggy? or something that make it bug..

thank you very very much
 
Last edited:
Level 4
Joined
Jul 12, 2007
Messages
116
It seems like everything is right, but i recommend you to check that the units in ZAUnitGroup18 really have the buff Blazing Helberd


  • ((Picked unit) has buff Blazing Helberd (Stacking)) Equal to True
 
Level 5
Joined
May 17, 2007
Messages
106
I've checked and that unit have Blazing Helberd Buff
so I try to add some TEXT too check but
it's ignore Pick unit in ZAUnitGroup18, I really don't get it, why?
*changed from Helberd to Halberd
  • Blazing Halberd Start
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Attacking unit) Equal to SamNogard
      • (Level of Blazing Halberd for SamNogard) Greater than 0
    • Actions
      • Game - Display to (All players) for 0.50 seconds the text: Attacked
      • Unit Group - Add (Attacked unit) to ZAUnitGroup18
--------
  • Blazing Halberd Damage
    • Events
      • Time - Every 0.90 seconds of game time
    • Conditions
    • Actions
      • Game - Display to (All players) for 0.30 seconds the text: Checking
      • Unit Group - Pick every unit in ZAUnitGroup18 and do (Actions)
        • Loop - Actions
          • Game - Display to (All players) for 0.30 seconds the text: check buff
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) has buff Blazing Halberd (Stacking)) Equal to True
            • Then - Actions
              • Game - Display to (All players) for 0.30 seconds the text: deal damage
              • Unit - Cause SamNogard to damage (Picked unit), dealing ((6.25 x (Real((Level of Blazing Halberd for SamNogard)))) + (((Real((Strength of SamNogard (Include bonuses)))) x (Random real number between 0.30 and 0.50)) x ((Real((Level of Blazing Halberd for SamNogard))) x 0.10))) damage of attack type Hero and damage type Normal
            • Else - Actions
              • Game - Display to (All players) for 0.30 seconds the text: buff bug
it's appear "Attacked" then "Checking" but not appear "check buff"

is it possible from anti-group leaks from other trigger?
  • Custom script: set bj_wantDestroyGroup = true
 
Last edited:
Level 6
Joined
Mar 2, 2006
Messages
306
2 bobo: no, the group should contain attacked units;

2 sam: when do you remove the unit from the group? do that, it is very important.

is it possible from anti-group leaks from other trigger?
Custom script: set bj_wantDestroyGroup = true
you can not use a group that you have destroyed (add units to it etc.)
you have to recreate it (with set action) and then use it.
so if you put that custom script in front of an action that used ZAUnitGroup18, it made it unusable (at least; you may cause game to crash that way) until the next "Set ZAUnitGroup18 = something" action...
 
Level 6
Joined
Feb 2, 2005
Messages
205
  • Blazing Halberd Start
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • And - Any (Conditions) are true
        • (Unit-type of (Attaking unit)) Equal to |cffFFCC00Dracomancer Guardian|r
        • (Level of Blazing Halberd for (Attacking unit)) Greater than 0
    • Actions
      • Game - Display to (All players) for 0.50 seconds the text: Attacked
      • Unit Group - Add (Triggering unit) to ZAUnitGroup18
You should use the AND condition so you can go sure it takes both Conditions. You will run into trouble with only on Unit-Type Variable, you should use an array instead, the Variable will be overwritten as soon as another player buys that Unit. So you will have to use an array or compare always for the unit type in the conditions.
 
Level 5
Joined
May 17, 2007
Messages
106
Well, I think it's bugged from
  • Unit Group - Add (Attacked unit) to ZAUnitGroup18
because everything else in Blazing Halberd Start Trigger is working
I've change pick unit in ZAUnitGroup18 to
  • Custom script: set bj_wantDestroyGroup = true
  • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
it's work but it's cause lag even with leak removed
so...
I've use this instead
  • Blazing Helberd Damage
    • Events
      • Time - Every 0.90 seconds of game time
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in (Playable map area) matching (((Matching unit) has buff Blazing Halberd (Stacking)) Equal to True)) and do (Actions)
        • Loop - Actions
          • Unit - Cause SamNogard to damage (Picked unit), dealing ((6.25 x (Real((Level of Blazing Halberd for SamNogard)))) + (((Real((Strength of SamNogard (Include bonuses)))) x (Random real number between 0.30 and 0.50)) x ((Real((Level of Blazing Halberd for SamNogard))) x 0.10))) damage of attack type Hero and damage type Normal
it's also work and not lag same above does (but I guess it's more than Group one)
Thanks everyone for trying to help, I'll use this for a moment
 
Last edited:
Level 5
Joined
Jan 15, 2007
Messages
199
you can not use a group that you have destroyed (add units to it etc.)
you have to recreate it (with set action) and then use it.
so if you put that custom script in front of an action that used ZAUnitGroup18, it made it unusable (at least; you may cause game to crash that way) until the next "Set ZAUnitGroup18 = something" action...
GUI functions that use unit groups suchs as pick every unit in 'group' and do actions will automatically recreate the group on use

EDIT - Added because of accidental double post
2 bobo: no, the group should contain attacked units;
umm, when "SamNogard" is attacked, it adds him to the group, not the attacker
Quote:
Trigger:
Unit Group - Add (Attacked unit) to ZAUnitGroup18
chagne that to
Trigger:
Unit Group - Add (Attacking unit) to ZAUnitGroup18
when i said that i am pretty sure that he changed this
  • (Attaced unit) Equal to SamNogard
to this
  • (Attacking unit) Equal to SamNogard
 
Status
Not open for further replies.
Top