HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Why do these simple triggers bug?

07-30-2006, 02:00 AM#1
Karawasa
Here are a few triggers that SHOULD be working normally. One casts locust swarm, another Death and Decay and finally the last casts Stampede.

The problem with stampede and death and decay is that the channeling isn't maintained for the duration I set for the spell. 30 on Stampede and 10 for Death and Decay.

Locust swarm lasts as long as it should, but the locusts themselves simply bunch up right upon being created and do not move around AT ALL.

Important Note: For testing purposes I made the dummy at and made it cast at the center of the map, rather then random location. Bug didn't appear there for any of the spells.

Here is the code:

Locust:

Trigger:
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Chaos Equal to 16
Collapse Then - Actions
Set Temp_Point = (Random point in (Playable map area))
Unit - Create 1 Dummy for Neutral Hostile at Temp_Point facing Default building facing degrees
Unit - Add a 30.00 second Generic expiration timer to (Last created unit)
Unit - Add Voodoo Spirits to (Last created unit)
Unit - Order (Last created unit) to Undead Crypt Lord - Locust Swarm
Custom script: call RemoveLocation(udg_Temp_Point)
Game - Display to (All players) the text: |c00FFAA00Chaos: Gh...
Else - Actions

Stampede:

Trigger:
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Chaos Equal to 13
Collapse Then - Actions
Set Temp_Point = (Random point in (Playable map area))
Unit - Create 1 Dummy for Neutral Hostile at Temp_Point facing Default building facing degrees
Unit - Add a 30.00 second Generic expiration timer to (Last created unit)
Unit - Add Stampede to (Last created unit)
Unit - Order (Last created unit) to Neutral Beastmaster - Stampede Temp_Point
Custom script: call RemoveLocation(udg_Temp_Point)
Game - Display to (All players) the text: |c00FFAA00Chaos: St...
Else - Actions

Death and Decay:

Trigger:
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Chaos Equal to 18
Collapse Then - Actions
Set Temp_Point = (Random point in (Playable map area))
Unit - Create 1 Dummy for Neutral Hostile at Temp_Point facing Default building facing degrees
Unit - Add a 15.00 second Generic expiration timer to (Last created unit)
Unit - Add Death And Decay (Neutral Hostile) (Neutral Hostile) to (Last created unit)
Unit - Order (Last created unit) to Undead Lich - Death And Decay Temp_Point
Custom script: call RemoveLocation(udg_Temp_Point)
Game - Display to (All players) the text: |c00FFAA00Chaos: De...
Else - Actions

At first I thoguht it might be channeling spells gone wrong for some reason. However, Cluster Rockets works just fine. Here is that code:

Cluster

Trigger:
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Chaos Equal to 14
Collapse Then - Actions
Collapse For each (Integer A) from 1 to 5, do (Actions)
Collapse Loop - Actions
Set Temp_Point = (Center of (Playable map area))
Unit - Create 1 Dummy for Neutral Hostile at Temp_Point facing Default building facing degrees
Custom script: call RemoveLocation(udg_Temp_Point)
Unit - Add a 10.00 second Generic expiration timer to (Last created unit)
Unit - Add Cluster Rockets to (Last created unit)
Set Temp_Point = (Random point in (Playable map area))
Special Effect - Create a special effect at Temp_Point using Abilities\Spells\Items\AIda\AIdaCaster.mdl
Special Effect - Destroy (Last created special effect)
Unit - Order (Last created unit) to Neutral Tinker - Cluster Rockets Temp_Point
Custom script: call RemoveLocation(udg_Temp_Point)
Game - Display to (All players) the text: |c00FFAA00Chaos: Nu...
Else - Actions

And for those curious enough, here is the whole damn trigger!

Trigger:
Chaos
Collapse Events
Time - Every (Random real number between 4.00 and 16.00) seconds of game time
Conditions
Collapse Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Chaos Equal to 1
Collapse Then - Actions
Set Temp_Group = (Units owned by (Random player from (All allies of Player 1 (Red))) matching ((((Matching unit) is A structure) Equal to False) and (((Unit-type of (Matching unit)) Not equal to Spirit) and (((Matching unit) is an illusion) Equal to False))))
Collapse Unit Group - Pick every unit in Temp_Group and do (Actions)
Collapse Loop - Actions
Unit - Kill (Picked unit)
Game - Display to (All players) the text: |c00FFAA00Chaos: De...
Custom script: call DestroyGroup(udg_Temp_Group)
Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Chaos Equal to 2
Collapse Then - Actions
Set Temp_Group = (Units owned by (Random player from (All enemies of Player 1 (Red))) matching (((Matching unit) is A Hero) Equal to True))
Collapse Unit Group - Pick every unit in Temp_Group and do (Actions)
Collapse Loop - Actions
Unit - Kill (Picked unit)
Game - Display to (All players) the text: |c00FFAA00Chaos: De...
Custom script: call DestroyGroup(udg_Temp_Group)
Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Chaos Equal to 3
Collapse Then - Actions
Set Temp_Group = (Units owned by (Random player from (All allies of Player 1 (Red))) matching ((((Matching unit) is A structure) Equal to False) and (((Unit-type of (Matching unit)) Not equal to Spirit) and (((Matching unit) is an illusion) Equal to False))))
Collapse Unit Group - Pick every unit in Temp_Group and do (Actions)
Collapse Loop - Actions
Set Temp_Point = (Random point in (Playable map area))
Unit - Move (Picked unit) instantly to Temp_Point
Camera - Pan camera for (Owner of (Picked unit)) to (Position of (Picked unit)) over 0.00 seconds
Custom script: call RemoveLocation(udg_Temp_Point)
Game - Display to (All players) the text: |c00FFAA00Chaos: Te...
Custom script: call DestroyGroup(udg_Temp_Group)
Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Chaos Equal to 4
Collapse Then - Actions
Set Temp_Group = (Units owned by (Random player from (All enemies of Player 1 (Red))) matching (((Matching unit) is A Hero) Equal to True))
Collapse Unit Group - Pick every unit in Temp_Group and do (Actions)
Collapse Loop - Actions
Set Temp_Point = (Random point in (Playable map area))
Unit - Move (Picked unit) instantly to Temp_Point
Camera - Pan camera for (Owner of (Picked unit)) to (Position of (Picked unit)) over 0.00 seconds
Custom script: call RemoveLocation(udg_Temp_Point)
Game - Display to (All players) the text: |c00FFAA00Chaos: Te...
Custom script: call DestroyGroup(udg_Temp_Group)
Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Chaos Equal to 5
Collapse Then - Actions
Set Temp_Group = (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to Spirit))
Collapse Unit Group - Pick every unit in Temp_Group and do (Actions)
Collapse Loop - Actions
Unit - Kill (Picked unit)
Game - Display to (All players) the text: |c00FFAA00Chaos: Ja...
Custom script: call DestroyGroup(udg_Temp_Group)
Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Chaos Equal to 6
Collapse Then - Actions
Set Temp_Group = (Units owned by (Random player from (All allies of Player 1 (Red))) matching (((Matching unit) is A structure) Equal to True))
Collapse Unit Group - Pick every unit in Temp_Group and do (Actions)
Collapse Loop - Actions
Unit - Kill (Picked unit)
Game - Display to (All players) the text: |c00FFAA00Chaos: Ra...
Custom script: call DestroyGroup(udg_Temp_Group)
Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Chaos Equal to 7
Collapse Then - Actions
Collapse Player Group - Pick every player in (Player group((Random player from (All players)))) and do (Actions)
Collapse Loop - Actions
Set Temp_Int = ((Picked player) Current gold)
Set Real = ((Real(Temp_Int)) x 1.00)
Player - Add (Integer(Real)) to (Picked player) Current gold
Game - Display to (All players) the text: |c00FFAA00Chaos: Ca...
Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Chaos Equal to 8
Collapse Then - Actions
Collapse Player Group - Pick every player in (Player group((Random player from (All players)))) and do (Actions)
Collapse Loop - Actions
Set Temp_Int = ((Picked player) Current gold)
Set Real = ((Real(Temp_Int)) x -0.50)
Player - Add (Integer(Real)) to (Picked player) Current gold
Game - Display to (All players) the text: |c00FFAA00Chaos: Lo...
Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Chaos Equal to 9
Collapse Then - Actions
Set Temp_Group = (Units owned by (Random player from (All allies of Player 1 (Red))) matching ((((Matching unit) is A structure) Equal to False) and (((Unit-type of (Matching unit)) Not equal to Spirit) and (((Matching unit) is an illusion) Equal to False))))
Collapse Unit Group - Pick every unit in Temp_Group and do (Actions)
Collapse Loop - Actions
Special Effect - Create a special effect attached to the origin of (Picked unit) using Objects\Spawnmodels\Human\HCancelDeath\HCancelDeath.mdl
Special Effect - Destroy (Last created special effect)
Unit - Add a 30.00 second Generic expiration timer to (Picked unit)
Unit - Make (Picked unit) Explode on death
Unit - Add AOE damage upon death (Sapper) to (Picked unit)
Game - Display to (All players) the text: |c00FFAA00Chaos: Bo...
Custom script: call DestroyGroup(udg_Temp_Group)
Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Chaos Equal to 10
Collapse Then - Actions
Set Temp_Group = (Units owned by (Random player from (All allies of Player 1 (Red))) matching ((((Matching unit) is A structure) Equal to False) and (((Unit-type of (Matching unit)) Not equal to Spirit) and (((Matching unit) is an illusion) Equal to False))))
Collapse Unit Group - Pick every unit in Temp_Group and do (Actions)
Collapse Loop - Actions
Set Temp_Point = (Position of (Picked unit))
Unit - Create 1 Caster Dummy for (Owner of (Picked unit)) at Temp_Point facing Default building facing degrees
Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
Unit - Add Divine Shield (Dummy) to (Last created unit)
Unit - Order (Last created unit) to Human Sorceress - Invisibility (Picked unit)
Custom script: call RemoveLocation(udg_Temp_Point)
Game - Display to (All players) the text: |c00FFAA00Chaos: Go...
Custom script: call DestroyGroup(udg_Temp_Group)
Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Chaos Equal to 11
Collapse Then - Actions
Collapse For each (Integer A) from 1 to 3, do (Actions)
Collapse Loop - Actions
Set Temp_Point = (Random point in (Playable map area))
Unit - Create 1 Tornado for Neutral Hostile at Temp_Point facing Default building facing degrees
Unit - Add a 30.00 second Generic expiration timer to (Last created unit)
Custom script: call RemoveLocation(udg_Temp_Point)
Game - Display to (All players) the text: |c00FFAA00Chaos: To...
Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Chaos Equal to 12
Collapse Then - Actions
Set Temp_Point = (Random point in (Playable map area))
Unit - Create 1 Dummy for Neutral Hostile at Temp_Point facing Default building facing degrees
Unit - Add a 30.00 second Generic expiration timer to (Last created unit)
Unit - Add Monsoon (Dummy) to (Last created unit)
Unit - Order (Last created unit) to Neutral - Monsoon Temp_Point
Custom script: call RemoveLocation(udg_Temp_Point)
Game - Display to (All players) the text: |c00FFAA00Chaos: Mo...
Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Chaos Equal to 13
Collapse Then - Actions
Set Temp_Point = (Random point in (Playable map area))
Unit - Create 1 Dummy for Neutral Hostile at Temp_Point facing Default building facing degrees
Unit - Add a 30.00 second Generic expiration timer to (Last created unit)
Unit - Add Stampede to (Last created unit)
Unit - Order (Last created unit) to Neutral Beastmaster - Stampede Temp_Point
Custom script: call RemoveLocation(udg_Temp_Point)
Game - Display to (All players) the text: |c00FFAA00Chaos: St...
Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Chaos Equal to 14
Collapse Then - Actions
Collapse For each (Integer A) from 1 to 5, do (Actions)
Collapse Loop - Actions
Set Temp_Point = (Center of (Playable map area))
Unit - Create 1 Dummy for Neutral Hostile at Temp_Point facing Default building facing degrees
Custom script: call RemoveLocation(udg_Temp_Point)
Unit - Add a 10.00 second Generic expiration timer to (Last created unit)
Unit - Add Cluster Rockets to (Last created unit)
Set Temp_Point = (Random point in (Playable map area))
Special Effect - Create a special effect at Temp_Point using Abilities\Spells\Items\AIda\AIdaCaster.mdl
Special Effect - Destroy (Last created special effect)
Unit - Order (Last created unit) to Neutral Tinker - Cluster Rockets Temp_Point
Custom script: call RemoveLocation(udg_Temp_Point)
Game - Display to (All players) the text: |c00FFAA00Chaos: Nu...
Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Chaos Equal to 15
Collapse Then - Actions
Set Temp_Point = (Random point in (Playable map area))
Unit - Create 1 Dummy for Neutral Hostile at Temp_Point facing Default building facing degrees
Custom script: call RemoveLocation(udg_Temp_Point)
Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
Unit - Add Thunder Clap to (Last created unit)
Unit - Order (Last created unit) to Human Mountain King - Thunder Clap
Game - Display to (All players) the text: |c00FFAA00Chaos: Sl...
Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Chaos Equal to 16
Collapse Then - Actions
Set Temp_Point = (Random point in (Playable map area))
Unit - Create 1 Dummy for Neutral Hostile at Temp_Point facing Default building facing degrees
Unit - Add a 30.00 second Generic expiration timer to (Last created unit)
Unit - Add Voodoo Spirits to (Last created unit)
Unit - Order (Last created unit) to Undead Crypt Lord - Locust Swarm
Custom script: call RemoveLocation(udg_Temp_Point)
Game - Display to (All players) the text: |c00FFAA00Chaos: Gh...
Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Chaos Equal to 17
Collapse Then - Actions
Set Temp_Point = (Center of (Playable map area))
Unit - Create 1 Dummy for Neutral Hostile at Temp_Point facing Default building facing degrees
Custom script: call RemoveLocation(udg_Temp_Point)
Unit - Add a 10.00 second Generic expiration timer to (Last created unit)
Unit - Add Inferno to (Last created unit)
Collapse For each (Integer A) from 1 to 10, do (Actions)
Collapse Loop - Actions
Set Temp_Point = (Random point in (Playable map area))
Unit - Order (Last created unit) to Undead Dreadlord - Inferno Temp_Point
Custom script: call RemoveLocation(udg_Temp_Point)
Game - Display to (All players) the text: |c00FFAA00Chaos: Ra...
Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Chaos Equal to 18
Collapse Then - Actions
Set Temp_Point = (Random point in (Playable map area))
Unit - Create 1 Dummy for Neutral Hostile at Temp_Point facing Default building facing degrees
Unit - Add a 15.00 second Generic expiration timer to (Last created unit)
Unit - Add Death And Decay (Neutral Hostile) (Neutral Hostile) to (Last created unit)
Unit - Order (Last created unit) to Undead Lich - Death And Decay Temp_Point
Custom script: call RemoveLocation(udg_Temp_Point)
Game - Display to (All players) the text: |c00FFAA00Chaos: De...
Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Chaos Equal to 19
Collapse Then - Actions
Collapse For each (Integer A) from 1 to 10, do (Actions)
Collapse Loop - Actions
Set Temp_Point = (Random point in (Playable map area))
Unit - Create 1 Doom Guard for Neutral Hostile at Temp_Point facing Default building facing degrees
Unit - Add a 30.00 second Generic expiration timer to (Last created unit)
Custom script: call RemoveLocation(udg_Temp_Point)
Game - Display to (All players) the text: |c00FFAA00Chaos: Ga...
Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Chaos Equal to 20
Collapse Then - Actions
Set Temp_Point = (Center of (Playable map area))
Unit - Create 1 Dummy for Neutral Hostile at Temp_Point facing Default building facing degrees
Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
Unit - Add Silence to (Last created unit)
Unit - Order (Last created unit) to Neutral Dark Ranger - Silence Temp_Point
Custom script: call RemoveLocation(udg_Temp_Point)
Game - Display to (All players) the text: |c00FFAA00Chaos: Mo...
Else - Actions
07-30-2006, 08:14 AM#2
Karawasa
Update:

I fixed Locust Swarm. Apparently it was a small field value problem.

Now the problem goes back to channeling spells. Stampede and Death & Decay do not channel for the full duration I set for them. Sometimes Stampede will produce more then one wave of lizards but it never lasts the full 30 seconds. Death and Decay goes for a few seconds but never the 10 I set it at.

Whats going on?
07-30-2006, 10:09 AM#3
Captain Griffen
Try doing it with a different player for testing purposes.
07-30-2006, 10:29 AM#4
Wyvernoid
Wondering if it is the event that caused the problem... You wrote "Every 4~16 sec. of game", does it mean that every 4~16 sec. of game a new spell would be cast? If so... 'guess you know how to correct it.

But if not, (I only took a slight look at your trigger) I only want to point out that the "Random integer 4~16" is a fixed integer, not a actively changing one ^_^ ('guess you already know)
07-30-2006, 10:33 AM#5
Captain Griffen
Also, the randomness for events is determined at start up, NOT each time. So the gap would be the same the whole game.
07-30-2006, 05:50 PM#6
Karawasa
Captain hit the nail on the head. Using Neutral Hostile was the problem!