• 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] How do I make this work

Status
Not open for further replies.
Level 2
Joined
May 7, 2010
Messages
21
  • GloriousCharge
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Glorious Charge
    • Actions
      • Set GC_caster = (Casting unit)
      • Hashtable - Save Handle OfGC_caster as 1 of (Key (Casting unit)) in GC_hash
      • Unit - Pause GC_caster
      • Custom script: call UnitAddAbility( udg_GC_caster, 'Aloc' )
      • Selection - Clear selection for (Owner of GC_caster)
      • Unit - Turn collision for GC_caster Off
      • Animation - Change GC_caster turn speed to 1.00
      • Special Effect - Create a special effect attached to the chest of GC_caster using Abilities\Spells\Orc\Voodoo\VoodooAuraTarget.mdl
      • Set GC_Shield = (Last created special effect)
      • Hashtable - Save Handle OfGC_Shield as 2 of (Key (Casting unit)) in GC_hash
      • Unit - Unpause GC_caster
      • Unit - Order GC_caster to Move To ((Position of GC_caster) offset by 1000.00 towards (Facing of GC_caster) degrees)
      • Sound - Play StampedeCaster1 <gen> at 100.00% volume, attached to GC_caster
      • Unit Group - Add GC_caster to GC_casterG
      • Trigger - Turn on GCDamage <gen>
      • Wait 3.00 seconds
      • Set GC_caster = (Load 1 of (Key (Casting unit)) in GC_hash)
      • Unit - Order GC_caster to Move To ((Position of GC_caster) offset by 1000.00 towards ((Facing of GC_caster) + 180.00) degrees)
      • Sound - Play StampedeCaster1 <gen> at 100.00% volume, attached to GC_caster
      • Wait 3.00 seconds
      • Trigger - Turn off GCDamage <gen>
      • Set GC_caster = (Load 1 of (Key (Casting unit)) in GC_hash)
      • Set GC_Shield = (Load 2 of (Key (Casting unit)) in GC_hash)
      • Special Effect - Destroy GC_Shield
      • Animation - Change GC_caster turn speed to 0.50
      • Unit - Turn collision for GC_caster On
      • Custom script: call UnitRemoveAbility( udg_GC_caster, 'Aloc' )
      • Selection - Add GC_caster to selection for (Owner of GC_caster)

  • GCDamage
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in GC_casterG and do (Actions)
        • Loop - Actions
          • Set GC_caster = (Load 1 of (Key (Picked unit)) in GC_hash)
          • Unit Group - Pick every unit in (Units within 100.00 of (Position of GC_caster) matching (((Matching unit) belongs to an enemy of (Owner of GC_caster)) Equal to True)) and do (Actions)
            • Loop - Actions
              • Unit - Cause GC_caster to damage (Picked unit), dealing ((Real((Strength of GC_caster (Include bonuses)))) x 15.00) damage of attack type Spells and damage type Force
              • Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl
              • Special Effect - Destroy (Last created special effect)

Spell idea :
caster charges in his facing direction, then back to his starting position...he deals damage to enemies in his way

what doesnt work :
1. the locust abillity doesnt get removed after the second wait

2. it doesnt seem to be MUI, why ?

I fear I forgot/didnt know about something which needs to be done with hashtables to store the caster variable right and/or the waits are a wrong way to do this spell
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
1) To remove locust, you must first hide the unit, then remove locust, then unhide the unit.
It should look like this:
  • Unit - Hide Unit
  • Custom script: call UnitRemoveAbility( Unit, 'Aloc')
  • Unit - Unhide Unit
2) Because it's a weird trigger? :D
If you want stuff to happen after a certain perdiod of time, why not put it in the periodic trigger?
Save the time in the hashtable, then add +1 to that every time the variable runs. If it is 3 (do stuff), if it is 6 (do stuff).
Did you initialize the hashtable?

Tip 1: don't use "Casting Unit", use "Triggering Unit" instead.
Tip 2: Remove memory leaks (you leak 2 locations, maybe something else I missed).
 
Level 2
Joined
May 7, 2010
Messages
21
1)


If you want stuff to happen after a certain perdiod of time, why not put it in the periodic trigger?
Save the time in the hashtable, then add +1 to that every time the variable runs. If it is 3 (do stuff), if it is 6 (do stuff).
Did you initialize the hashtable?

.

Yes I initialized the hashtable.
Regarding the periodic trigger : my problem is that if I use a periodic trigger the only way to move the unit smoothly would be to use the action move instantly to pos. of unit + 15, but with this the unit is only in stand animation...Id like to have the move animation on the unit, so it looks like a charge ( the hero has Lord Garithos model ) ..any suggestions on this ?
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Yes I initialized the hashtable.
Regarding the periodic trigger : my problem is that if I use a periodic trigger the only way to move the unit smoothly would be to use the action move instantly to pos. of unit + 15, but with this the unit is only in stand animation...Id like to have the move animation on the unit, so it looks like a charge ( the hero has Lord Garithos model ) ..any suggestions on this ?
I don't think you completely understood me.

At the start of the cast, save the integer '6' in the hashtable for that unit.
In the periodic trigger, do it -1 the entire time.
If it reaches 3, then you should do these actions:
  • Unit - Order (Picked unit) to move to TempLoc2
  • Sound - Play StampedeCaster1 <gen> at 100.00% volume, attached to (Picked unit)
Of course, TempLoc2 = TempLoc1 offset by 1000 towards blabla (and TempLoc1 is the position of picked unit).

If it reaches 0, do these actions:
  • Special Effect - Destroy (Load 2 of (Key (Casting unit)) in GC_hash)
  • Animation - Change (Picked unit) turn speed to 0.50
  • Unit - Turn collision for (Picked unit) On
  • Hide (Picked unit)
  • Custom script: call UnitRemoveAbility( GetEnumUnit(), 'Aloc' )
  • Unide (Picked unit)
  • Selection - Add (Picked unit) to selection for (Owner of (Picked unit))
This will remove all the waits.


Another important thing is this: create an integer variable (name it "GCCount" or something) and set it +1 every time an ability is cast.
Set it -1 every time an ability is over (the timer in the hashtable reaches 0).
In the cast trigger: GCCount = 0 --> turn on periodic trigger.
In the periodic trigger: GCCount = 0 --> turn off periodic trigger.
 
Level 2
Joined
May 7, 2010
Messages
21
Im sorry if it starts getting annoying but I tried to follow your instruction, heres what Ive done, and the spell works fine if I cast it once, something in the recycling/refreshing part of the spell seems to be wrong.

  • GloriousChargeNoWait
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Glorious Charge
    • Actions
      • Set GC_count = 0
      • Set GC_caster = (Triggering unit)
      • Hashtable - Save Handle OfGC_caster as 1 of (Key (Triggering unit)) in GC_hash
      • Set GC_MovCounter = 6
      • Hashtable - Save GC_MovCounter as 2 of (Key (Triggering unit)) in GC_hash
      • Set GC_TempLoc1 = (Position of GC_caster)
      • Hashtable - Save Handle OfGC_TempLoc1 as 4 of (Key (Triggering unit)) in GC_hash
      • Set GC_TempLoc2 = (GC_TempLoc1 offset by 1000.00 towards (Facing of GC_caster) degrees)
      • Hashtable - Save Handle OfGC_TempLoc2 as 5 of (Key (Triggering unit)) in GC_hash
      • Special Effect - Create a special effect attached to the chest of GC_caster using Abilities\Spells\Orc\Voodoo\VoodooAuraTarget.mdl
      • Set GC_Shield = (Last created special effect)
      • Hashtable - Save Handle OfGC_Shield as 3 of (Key (Triggering unit)) in GR_hash
      • Unit Group - Add GC_caster to GC_casterG
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • GC_count Equal to 0
        • Then - Actions
          • Set GC_count = (GC_count + 1)
          • Trigger - Turn on GCPeriodic <gen>
          • Trigger - Turn on GCDamage <gen>
        • Else - Actions
  • GCDamage
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in GC_casterG and do (Actions)
        • Loop - Actions
          • Set GC_caster = (Load 1 of (Key (Picked unit)) in GC_hash)
          • Unit Group - Pick every unit in (Units within 100.00 of (Position of GC_caster) matching (((Matching unit) belongs to an enemy of (Owner of GC_caster)) Equal to True)) and do (Actions)
            • Loop - Actions
              • Unit - Cause GC_caster to damage (Picked unit), dealing ((Real((Strength of GC_caster (Include bonuses)))) x 15.00) damage of attack type Spells and damage type Force
              • Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl
              • Special Effect - Destroy (Last created special effect)
  • GCPeriodic
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in GC_casterG and do (Actions)
        • Loop - Actions
          • Set GC_MovCounter = (Load 2 of (Key (Picked unit)) from GC_hash)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • GC_MovCounter Equal to 6
        • Then - Actions
          • Unit Group - Pick every unit in GC_casterG and do (Actions)
            • Loop - Actions
              • Set GC_caster = (Load 1 of (Key (Picked unit)) in GC_hash)
              • Selection - Clear selection for (Owner of DAT_caster)
              • Unit - Hide GC_caster
              • Custom script: call UnitAddAbility( GetEnumUnit(), 'Aloc' )
              • Unit - Unhide GC_caster
              • Unit - Turn collision for GC_caster Off
              • Animation - Change GC_caster turn speed to 1.00
              • Hashtable - Save Handle OfGC_Shield as 3 of (Key (Picked unit)) in GC_hash
              • Unit - Order (Picked unit) to Move To GC_TempLoc2
              • Sound - Play StampedeCaster1 <gen> at 100.00% volume, attached to (Picked unit)
        • Else - Actions
      • Unit Group - Pick every unit in GC_casterG and do (Actions)
        • Loop - Actions
          • Hashtable - Save (GC_MovCounter - 1) as 2 of (Key (Picked unit)) in GC_hash
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • GC_MovCounter Equal to 3
        • Then - Actions
          • Unit Group - Pick every unit in GC_casterG and do (Actions)
            • Loop - Actions
              • Unit - Order (Picked unit) to Move To GC_TempLoc1
              • Sound - Play StampedeCaster1 <gen> at 100.00% volume, attached to (Picked unit)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • GC_MovCounter Equal to 0
        • Then - Actions
          • Unit Group - Pick every unit in GC_casterG and do (Actions)
            • Loop - Actions
              • Trigger - Turn off GCDamage <gen>
              • Set GC_caster = (Load 1 of (Key (Picked unit)) in GC_hash)
              • Set GC_Shield = (Load 3 of (Key (Picked unit)) in GC_hash)
              • Special Effect - Destroy GC_Shield
              • Animation - Change GC_caster turn speed to 0.50
              • Unit - Turn collision for GC_caster On
              • Unit - Hide GC_caster
              • Custom script: call UnitRemoveAbility( GetEnumUnit(), 'Aloc' )
              • Unit - Unhide GC_caster
              • Selection - Add GC_caster to selection for (Owner of (Picked unit))
              • Unit Group - Remove GR_caster from GC_casterG
              • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in GC_hash
              • Hashtable - Clear all child hashtables of child (Key (Triggering unit)) in GC_hash
              • Set GC_count = (GC_count - 1)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • GC_count Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
 
Last edited:
Level 37
Joined
Mar 6, 2006
Messages
9,243
The indenting sucks here, but it should look something like this:

  • GCPeriodic
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in GC_casterG and do (Actions)
        • Loop - Actions
          • Set GC_MovCounter = (Load 2 of (Key (Picked unit)) from
        • If - Conditions
          • GC_MovCounter Equal to 6
        • Then - Actions
          • Set GC_caster =picked unit
          • Selection - Clear selection for (Owner of DAT_caster)
          • Unit - Hide GC_caster
          • Custom script: call UnitAddAbility( GetEnumUnit(), 'Aloc' )
          • Unit - Unhide GC_caster
          • Unit - Turn collision for GC_caster Off
          • Animation - Change GC_caster turn speed to 1.00
          • Hashtable - Save Handle OfGC_Shield as 3 of (Key (Picked unit)) in GC_hash
          • Unit - Order (Picked unit) to Move To GC_TempLoc2
          • Sound - Play StampedeCaster1 <gen> at 100.00% volume, attached to (Picked unit)
        • Else - Actions
          • Hashtable - Save (GC_MovCounter - 1) as 2 of (Key (Picked unit)) in GC_hash
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • GC_MovCounter Equal to 3
        • Then - Actions
          • Unit - Order (Picked unit) to Move To GC_TempLoc1
          • Sound - Play StampedeCaster1 <gen> at 100.00% volume, attached to (Picked unit)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • GC_MovCounter Equal to 0
        • Then - Actions
          • Trigger - Turn off GCDamage <gen>
          • Set GC_caster = (Load 1 of (Key (Picked unit)) in GC_hash)
          • Set GC_Shield = (Load 3 of (Key (Picked unit)) in GC_hash)
          • Special Effect - Destroy GC_Shield
          • Animation - Change GC_caster turn speed to 0.50
          • Unit - Turn collision for GC_caster On
          • Unit - Hide GC_caster
          • Custom script: call UnitRemoveAbility( GetEnumUnit(), 'Aloc' )
          • Unit - Unhide GC_caster
          • Selection - Add GC_caster to selection for (Owner of (Picked unit))
          • Unit Group - Remove GR_caster from GC_casterG
          • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in GC_hash
          • Hashtable - Clear all child hashtables of child (Key (Triggering unit)) in GC_hash
          • Set GC_count = (GC_count - 1)
        • Else - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • GC_count Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
 
Level 2
Joined
May 7, 2010
Messages
21
Hmm, but doesnt the counter in your version do (counter-1) only if counter is not 6 ? And if it doesnt reduce it stays 6 all the time ergo it doesnt get past the first part of the trigger.
 
Level 2
Joined
May 7, 2010
Messages
21
So ive adjusted the triggers, the following is the final form but I still cant figure out where the problem is. Now the locust abillity is not added to the casting unit, also the special effect isnt removed and it seems its not completely MUI - everything works fine except when a second instance is cast (and the first is still running ) the second units gets the locust abillity. weird, does anyone now how to fix this ?
at least the triggers look cleaner now..

  • GloriousChargeNoWait
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Glorious Charge
    • Actions
      • Set GC_count = 0
      • Set GC_caster = (Triggering unit)
      • Hashtable - Save Handle OfGC_caster as 1 of (Key (Triggering unit)) in GC_hash
      • Set GC_MovCounter = 6
      • Hashtable - Save GC_MovCounter as 2 of (Key (Triggering unit)) in GC_hash
      • Set GC_TempLoc1 = (Position of GC_caster)
      • Hashtable - Save Handle OfGC_TempLoc1 as 4 of (Key (Triggering unit)) in GC_hash
      • Set GC_TempLoc2 = (GC_TempLoc1 offset by 1000.00 towards (Facing of GC_caster) degrees)
      • Hashtable - Save Handle OfGC_TempLoc2 as 5 of (Key (Triggering unit)) in GC_hash
      • Special Effect - Create a special effect attached to the chest of GC_caster using Abilities\Spells\Orc\Voodoo\VoodooAuraTarget.mdl
      • Set GC_Shield = (Last created special effect)
      • Hashtable - Save Handle OfGC_Shield as 3 of (Key (Triggering unit)) in GR_hash
      • Unit Group - Add GC_caster to GC_casterG
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • GC_count Equal to 0
        • Then - Actions
          • Set GC_count = (GC_count + 1)
          • Trigger - Turn on GCPeriodic <gen>
          • Trigger - Turn on GCDamage <gen>
        • Else - Actions
  • GCPeriodic
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • GC_count Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
      • Unit Group - Pick every unit in GC_casterG and do (Actions)
        • Loop - Actions
          • Set GC_caster = (Load 1 of (Key (Picked unit)) in GC_hash)
          • Set GC_MovCounter = (Load 2 of (Key (Picked unit)) from GC_hash)
          • Set GC_TempLoc1 = (Load 4 of (Key (Picked unit)) in GC_hash)
          • Set GC_TempLoc2 = (Load 5 of (Key (Picked unit)) in GC_hash)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • GC_MovCounter Equal to 6
            • Then - Actions
              • Unit - Hide GC_caster
              • Selection - Clear selection for (Owner of GC_caster)
              • Custom script: call UnitAddAbility( GetEnumUnit(), 'Aloc' )
              • Unit - Unhide GC_caster
              • Unit - Turn collision for GC_caster Off
              • Animation - Change GC_caster turn speed to 1.00
              • Unit - Order (Picked unit) to Move To GC_TempLoc2
              • Sound - Play StampedeCaster1 <gen> at 100.00% volume, attached to (Picked unit)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • GC_MovCounter Equal to 3
                • Then - Actions
                  • Unit - Order (Picked unit) to Move To GC_TempLoc1
                  • Sound - Play StampedeCaster1 <gen> at 100.00% volume, attached to (Picked unit)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • GC_MovCounter Equal to 0
                    • Then - Actions
                      • Trigger - Turn off GCDamage <gen>
                      • Set GC_Shield = (Load 3 of (Key (Picked unit)) in GC_hash)
                      • Special Effect - Destroy GC_Shield
                      • Animation - Change GC_caster turn speed to 0.50
                      • Unit - Turn collision for GC_caster On
                      • Unit - Hide GC_caster
                      • Custom script: call UnitRemoveAbility( GetEnumUnit(), 'Aloc' )
                      • Unit - Unhide GC_caster
                      • Selection - Add GC_caster to selection for (Owner of (Picked unit))
                      • Unit Group - Remove GR_caster from GC_casterG
                      • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in GC_hash
                      • Hashtable - Clear all child hashtables of child (Key (Triggering unit)) in GC_hash
                      • Set GC_count = (GC_count - 1)
                    • Else - Actions
          • Hashtable - Save (GC_MovCounter - 1) as 2 of (Key (Picked unit)) in GC_hash
 
Level 2
Joined
May 7, 2010
Messages
21
OMG, looks like Ill never be able to complete that spell. This time everything works fine, but only if 2 instances are cast simultaneously or the one which was cast as first. The second instance gets stuck on counter 6, and moves on only after the caster who cast the spell first casts it again. Maybe the movcounter reference is somehow static. I have no clue, I double chcecked everything and compared it to spells shown in hashtable tutorials but I still couldnt find anything.

  • GloriousChargeNoWait
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Glorious Charge
    • Actions
      • Hashtable - Save GC_count as 0 of (Key (Triggering unit)) in GC_hash
      • Set GC_caster = (Triggering unit)
      • Hashtable - Save Handle OfGC_caster as 1 of (Key (Triggering unit)) in GC_hash
      • Set GC_MovCounter = 6
      • Hashtable - Save GC_MovCounter as 2 of (Key (Triggering unit)) in GC_hash
      • Set GC_TempLoc1 = (Position of GC_caster)
      • Hashtable - Save Handle OfGC_TempLoc1 as 4 of (Key (Triggering unit)) in GC_hash
      • Special Effect - Create a special effect attached to the chest of GC_caster using Abilities\Spells\Orc\Voodoo\VoodooAuraTarget.mdl
      • Set GC_Shield = (Last created special effect)
      • Hashtable - Save Handle OfGC_Shield as 3 of (Key (Triggering unit)) in GC_hash
      • Unit Group - Add GC_caster to GC_casterG
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • GC_count Equal to 0
        • Then - Actions
          • Hashtable - Save (GC_count + 1) as 0 of (Key (Triggering unit)) in GC_hash
          • Set GC_count = (Load 0 of (Key (Triggering unit)) from GC_hash)
          • Trigger - Turn on GCPeriodic <gen>
          • Trigger - Turn on GCDamage <gen>
        • Else - Actions
  • GCPeriodic
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • GC_count Equal to 0
        • Then - Actions
          • Custom script: call RemoveLocation (udg_GC_TempLoc1)
          • Custom script: call RemoveLocation (udg_GC_TempLoc2)
          • Trigger - Turn off (This trigger)
        • Else - Actions
      • Unit Group - Pick every unit in GC_casterG and do (Actions)
        • Loop - Actions
          • Set GC_caster = (Picked unit)
          • Set GC_MovCounter = (Load 2 of (Key (Picked unit)) from GC_hash)
          • Set GC_Shield = (Load 3 of (Key (Picked unit)) in GC_hash)
          • Set GC_TempLoc1 = (Load 4 of (Key (Picked unit)) in GC_hash)
          • Set GC_TempLoc2 = ((Position of GC_caster) offset by 1000.00 towards (Facing of GC_caster) degrees)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • GC_MovCounter Equal to 6
            • Then - Actions
              • Selection - Clear selection for (Owner of GC_caster)
              • Custom script: call UnitAddAbility( GetEnumUnit(), 'Aloc' )
              • Unit - Turn collision for GC_caster Off
              • Animation - Change GC_caster turn speed to 1.00
              • Unit - Order GC_caster to Move To GC_TempLoc2
              • Sound - Play StampedeCaster1 <gen> at 100.00% volume, attached to GC_caster
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • GC_MovCounter Equal to 3
                • Then - Actions
                  • Sound - Play StampedeCaster1 <gen> at 100.00% volume, attached to GC_caster
                  • Unit - Order GC_caster to Move To GC_TempLoc1
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • GC_MovCounter Equal to 0
                    • Then - Actions
                      • Trigger - Turn off GCDamage <gen>
                      • Special Effect - Destroy GC_Shield
                      • Animation - Change GC_caster turn speed to 0.50
                      • Unit - Turn collision for GC_caster On
                      • Unit - Hide GC_caster
                      • Custom script: call UnitRemoveAbility( GetEnumUnit(), 'Aloc' )
                      • Unit - Unhide GC_caster
                      • Selection - Add GC_caster to selection for (Owner of GC_caster)
                      • Unit Group - Remove GR_caster from GC_casterG
                      • Hashtable - Save (GC_count - 1) as 0 of (Key (Picked unit)) in GC_hash
                      • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in GC_hash
                    • Else - Actions
          • Set GC_count = (Load 0 of (Key (Picked unit)) from GC_hash)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • GC_MovCounter Greater than 0
            • Then - Actions
              • Hashtable - Save (GC_MovCounter - 1) as 2 of (Key (Picked unit)) in GC_hash
            • Else - Actions

Anyone got a clue ?
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
  • GloriousChargeNoWait
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Glorious Charge
    • Actions
      • Set GC_caster = (Triggering unit)
      • Hashtable - Save Handle OfGC_caster as 1 of (Key (Triggering unit)) in GC_hash
      • Set GC_MovCounter = 6
      • Hashtable - Save GC_MovCounter as 2 of (Key (Triggering unit)) in GC_hash
      • Set GC_TempLoc1 = (Position of GC_caster)
      • Hashtable - Save Handle OfGC_TempLoc1 as 4 of (Key (Triggering unit)) in GC_hash
      • Special Effect - Create a special effect attached to the chest of GC_caster using Abilities\Spells\Orc\Voodoo\VoodooAuraTarget.mdl
      • Set GC_Shield = (Last created special effect)
      • Hashtable - Save Handle OfGC_Shield as 3 of (Key (Triggering unit)) in GC_hash
      • Unit Group - Add GC_caster to GC_casterG
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • number of units in GC_casterG Equal to 1
        • Then - Actions
          • Trigger - Turn on GCPeriodic <gen>
          • Trigger - Turn on GCDamage <gen>
        • Else - Actions
  • GCPeriodic
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in GC_casterG and do (Actions)
        • Loop - Actions
          • Set GC_caster = (Picked unit)
          • Set GC_MovCounter = (Load 2 of (Key (Picked unit)) from GC_hash)
          • Set GC_Shield = (Load 3 of (Key (Picked unit)) in GC_hash)
          • Set GC_TempLoc1 = (Load 4 of (Key (Picked unit)) in GC_hash)
          • Set GC_TempLoc2 = ((Position of GC_caster) offset by 1000.00 towards (Facing of GC_caster) degrees)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • GC_MovCounter Equal to 6
            • Then - Actions
              • Selection - Clear selection for (Owner of GC_caster)
              • Custom script: call UnitAddAbility( GetEnumUnit(), 'Aloc' )
              • Unit - Turn collision for GC_caster Off
              • Animation - Change GC_caster turn speed to 1.00
              • Unit - Order GC_caster to Move To GC_TempLoc2
              • Sound - Play StampedeCaster1 <gen> at 100.00% volume, attached to GC_caster
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • GC_MovCounter Equal to 3
                • Then - Actions
                  • Sound - Play StampedeCaster1 <gen> at 100.00% volume, attached to GC_caster
                  • Unit - Order GC_caster to Move To GC_TempLoc1
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • GC_MovCounter Equal to 0
                    • Then - Actions
                      • Trigger - Turn off GCDamage <gen>
                      • Special Effect - Destroy GC_Shield
                      • Animation - Change GC_caster turn speed to 0.50
                      • Unit - Turn collision for GC_caster On
                      • Unit - Hide GC_caster
                      • Custom script: call UnitRemoveAbility( GetEnumUnit(), 'Aloc' )
                      • Unit - Unhide GC_caster
                      • Selection - Add GC_caster to selection for (Owner of GC_caster)
                      • Unit Group - Remove GR_caster from GC_casterG
                      • Remove locations from hashtable
                      • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in GC_hash
                      • if GC_casterG is empty then
                        • turn off this trigger
                    • Else - Actions
    • Hashtable - Save (GC_MovCounter - 1) as 2 of (Key (Picked unit)) in GC_hash


You should first check if the number is 0. If it is not then do the other check and subtract 1 from it at the end.

u = picked unit
i = LoadInteger
if i == 0 then
--remove unit from group and stuff
else
--if i == 6 then
---do things
--else if i == 3 then
---do things
--endif
--save i - 1
endif

Use [trigger=Text][/trigger] tags.
 
Status
Not open for further replies.
Top