Moridin
Snow Leopard
- Reaction score
- 144
Okay. A small problem I'm having. Some of you might be intimidated by the wall of GUI code, but I promise you my problem will probably NOT include you reading through all my code. Firstly: Here are the two triggers:
Now my problem is that this piece of code:
....in the second trigger somehow loops it back to the first trigger. I have no idea why it does this...and I need it to stop. No where in the either trigger have I used the actions:
Trigger - Run trigger (Checking conditions)/(ignoring conditions)
Edit: also how do you hide stuff with spoilers ? :S
Trigger:
- Spell
- Events
- Unit - A unit Starts the effect of an ability
- Conditions
- (Ability being cast) Equal to Static Lightning
- Actions
- Set Count = 1
- Unit Group - Pick every unit in (Units within ((300.00 + (100.00 x (Real((Level of Static Lightning for (Triggering unit)))))) / 2.00) of (Target point of ability being cast) matching ((((Triggering player) is an enemy of (Owner of (Matching unit))) Equal to True) and (((Matching unit) is and do (Actions)
- Loop - Actions
- Set Count = (Count + 1)
- Unit Group - Add (Picked unit) to Units_chosen
- Unit - Pause (Picked unit)
- Unit - Set the custom value of (Picked unit) to 0
- Hashtable - Save Handle Of(Picked unit) as (Key (Triggering unit)) of Count in Spell
- Hashtable - Save 500 as ((Key (Triggering unit)) + 1) of Count in Spell
- Special Effect - Create a special effect attached to the overhead of (Picked unit) using Abilities\Spells\Other\Drain\DrainTarget.mdl
- Hashtable - Save Handle Of(Last created special effect) as ((Key (Triggering unit)) + 2) of Count in Spell
- Lightning - Create a Chain Lightning - Primary lightning effect from source (Position of (Triggering unit)) to target (Position of (Picked unit))
- Hashtable - Save Handle Of(Last created lightning effect) as ((Key (Triggering unit)) + 3) of Count in Spell
- Loop - Actions
- Hashtable - Save Count as ((Key (Triggering unit)) + 1) of 1 in Spell
- Game - Display to (All players) the text: ((String(Count)) + = Count)
- Unit Group - Add (Triggering unit) to Units_casting
- Unit - Pause (Triggering unit)
- Animation - Play (Triggering unit)'s channel animation
- Events
Trigger:
- Drag
- Events
- Time - Every 0.03 seconds of game time
- Conditions
- Actions
- Unit Group - Pick every unit in Units_casting and do (Actions)
- Loop - Actions
- Set Stopper = 1
- For each (Integer Drag_V_1) from 2 to (Load ((Key (Picked unit)) + 1) of 1 from Spell), do (Actions)
- Loop - Actions
- Set current_unit = (Load (Key (Picked unit)) of Drag_V_1 in Spell)
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (current_unit is in Units_chosen) Equal to False
- Then - Actions
- Set Stopper = (Stopper + 1)
- Game - Display to (All players) the text: ((String(Stopper)) + = Stopper)
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- Stopper Equal to (Load ((Key (Picked unit)) + 1) of 1 from Spell)
- Then - Actions
- Game - Display to (All players) the text: ((String(Stopper)) + = Stopper)
- Game - Display to (All players) the text: Stopping from main ...
- Unit Group - Remove (Picked unit) from Units_casting
- Unit - Unpause (Picked unit)
- Hashtable - Clear all child hashtables of child (Key (Picked unit)) in Spell
- Else - Actions
- If - Conditions
- Else - Actions
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (current_unit is dead) Equal to True
- Then - Actions
- Unit Group - Remove current_unit from Units_chosen
- Unit - Set the custom value of current_unit to 2
- Unit - Unpause current_unit
- Unit - Turn collision for current_unit On
- Special Effect - Destroy (Load ((Key (Picked unit)) + 2) of Drag_V_1 in Spell)
- Else - Actions
- Unit - Turn collision for current_unit Off
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Distance between (Position of current_unit) and (Position of (Picked unit))) Less than or equal to 150.00
- Then - Actions
- Unit - Set the custom value of current_unit to 1
- Else - Actions
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Load ((Key (Picked unit)) + 1) of Drag_V_1 from Spell) Less than or equal to 0
- Then - Actions
- Unit Group - Remove current_unit from Units_chosen
- Unit - Set the custom value of current_unit to 2
- Unit - Unpause current_unit
- Unit - Turn collision for current_unit On
- Else - Actions
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Custom value of current_unit) Equal to 0
- Then - Actions
- Lightning - Move (Load ((Key (Picked unit)) + 3) of Drag_V_1 in Spell) to source (Position of (Picked unit)) and target (Position of current_unit)
- Unit - Move current_unit instantly to ((Position of current_unit) offset by 1.00 towards (Angle from (Position of current_unit) to (Position of (Picked unit))) degrees)
- Unit - Cause (Picked unit) to damage current_unit, dealing ((40.00 x 0.03) x (Real((Level of Static Lightning for (Picked unit))))) damage of attack type Spells and damage type Normal
- Else - Actions
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Custom value of current_unit) Equal to 1
- Then - Actions
- Lightning - Destroy (Load ((Key (Picked unit)) + 3) of Drag_V_1 in Spell)
- Special Effect - Destroy (Load ((Key (Picked unit)) + 2) of Drag_V_1 in Spell)
- Special Effect - Create a special effect at (Position of current_unit) using Objects\Spawnmodels\Undead\ImpaleTargetDust\ImpaleTargetDust.mdl
- Unit - Move current_unit instantly to ((Position of current_unit) offset by 20.00 towards (Angle from (Position of (Picked unit)) to (Position of current_unit)) degrees)
- Unit - Cause (Picked unit) to damage current_unit, dealing ((40.00 x (20.00 / 500.00)) x (Real((Level of Static Lightning for (Picked unit))))) damage of attack type Spells and damage type Normal
- Hashtable - Save ((Load ((Key (Picked unit)) + 1) of Drag_V_1 from Spell) - 20) as ((Key (Picked unit)) + 1) of Drag_V_1 in Spell
- Special Effect - Destroy (Last created special effect)
- Else - Actions
- If - Conditions
- If - Conditions
- Loop - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Load ((Key (Picked unit)) + 1) of 1 from Spell) Less than 2
- ((Picked unit) is paused) Equal to True
- Then - Actions
- Game - Display to (All players) the text: Stopping from side ...
- Unit Group - Remove (Picked unit) from Units_casting
- Unit - Unpause (Picked unit)
- Else - Actions
- If - Conditions
- Loop - Actions
- Unit Group - Pick every unit in Units_casting and do (Actions)
- Events
Now my problem is that this piece of code:
Trigger:
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- Stopper Equal to (Load ((Key (Picked unit)) + 1) of 1 from Spell)
- Then - Actions
- Game - Display to (All players) the text: ((String(Stopper)) + = Stopper)
- Game - Display to (All players) the text: Stopping from main ...
- Unit Group - Remove (Picked unit) from Units_casting
- Unit - Unpause (Picked unit)
- Hashtable - Clear all child hashtables of child (Key (Picked unit)) in Spell
- Else - Actions
- If - Conditions
....in the second trigger somehow loops it back to the first trigger. I have no idea why it does this...and I need it to stop. No where in the either trigger have I used the actions:
Trigger - Run trigger (Checking conditions)/(ignoring conditions)
Edit: also how do you hide stuff with spoilers ? :S