• 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] Spell Trouble

Status
Not open for further replies.
Level 3
Joined
Jun 9, 2010
Messages
33
I've recently been trying to recreate some of the weapons used by Alice in American McGee's Alice.

My current spell, Deadtime Watch, is having a few problems, and I can't tell what the problem is.

Currently I can cast the spell once, then if I want to keep casting I have to keep the spells looped together, or the looping part of the spell won't work. I've checked everything I can think of, and there doesn't seem to be anything wrong. If someone could check and see if they spot the problem I'd really appreciate it.

  • Deadtime Watch Init
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Deadtime Watch
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DW_Index[1] Equal to 0
        • Then - Actions
          • Trigger - Turn on Deadtime Watch Loop <gen>
        • Else - Actions
      • Set DW_Index[1] = (DW_Index[1] + 1)
      • Set DW_Index[2] = (DW_Index[2] + 1)
      • Set DW_Boolean[DW_Index[2]] = True
      • Set DW_CentrePoint[DW_Index[2]] = (Position of (Triggering unit))
      • Set DW_CircleSpeed[DW_Index[2]] = 10.00
      • Set DW_HaltedTargets[DW_Index[2]] = (Units within 400.00 of DW_CentrePoint[DW_Index[2]] matching (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True))
      • Unit Group - Pick every unit in DW_HaltedTargets[DW_Index[2]] and do (Actions)
        • Loop - Actions
          • Animation - Change (Picked unit)'s animation speed to 0.00% of its original speed
          • Unit - Pause (Picked unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of (Ability being cast) for (Triggering unit)) Equal to 5
        • Then - Actions
          • Set DW_HaltTime[DW_Index[2]] = 10.00
        • Else - Actions
          • Set DW_HaltTime[DW_Index[2]] = ((Real((Level of (Ability being cast) for (Triggering unit)))) + 4.00)
      • Set DW_HandSpeed[DW_Index[2]] = (360.00 / (25.00 x DW_HaltTime[DW_Index[2]]))
      • For each (Integer A) from 1 to 18, do (Actions)
        • Loop - Actions
          • Set A_Temp_Loc = (DW_CentrePoint[DW_Index[2]] offset by 400.00 towards ((Real((Integer A))) x 20.00) degrees)
          • Unit - Create 1 Ghost Dummy for (Owner of (Triggering unit)) at A_Temp_Loc facing Default building facing degrees
          • Unit Group - Add (Last created unit) to DW_CircleDummies[DW_Index[2]]
          • Custom script: call RemoveLocation(udg_A_Temp_Loc)
      • For each (Integer A) from 1 to 18, do (Actions)
        • Loop - Actions
          • Set A_Temp_Loc = (DW_CentrePoint[DW_Index[2]] offset by 400.00 towards (10.00 + ((Real((Integer A))) x 20.00)) degrees)
          • Unit - Create 1 Dark thingy Dummy for (Owner of (Triggering unit)) at A_Temp_Loc facing Default building facing degrees
          • Unit Group - Add (Last created unit) to DW_CircleDummies[DW_Index[2]]
          • Custom script: call RemoveLocation(udg_A_Temp_Loc)
      • For each (Integer A) from 1 to 3, do (Actions)
        • Loop - Actions
          • Set A_Temp_Loc = (DW_CentrePoint[DW_Index[2]] offset by ((Real((Integer A))) x 80.00) towards 90.00 degrees)
          • Unit - Create 1 Short Hand for (Owner of (Triggering unit)) at A_Temp_Loc facing Default building facing degrees
          • Animation - Change (Last created unit)'s size to (75.00%, 75.00%, 75.00%) of its original size
          • Unit Group - Add (Last created unit) to DW_ShortHandDummies[DW_Index[2]]
          • Custom script: call RemoveLocation(udg_A_Temp_Loc)
      • For each (Integer A) from 1 to 3, do (Actions)
        • Loop - Actions
          • Set A_Temp_Loc = (DW_CentrePoint[DW_Index[2]] offset by (((Real((Integer A))) x 80.00) - 40.00) towards 90.00 degrees)
          • Unit - Create 1 Short Hand for (Owner of (Triggering unit)) at A_Temp_Loc facing Default building facing degrees
          • Animation - Change (Last created unit)'s size to (75.00%, 75.00%, 75.00%) of its original size
          • Unit Group - Add (Last created unit) to DW_ShortHandDummies[DW_Index[2]]
          • Custom script: call RemoveLocation(udg_A_Temp_Loc)
      • For each (Integer A) from 1 to 8, do (Actions)
        • Loop - Actions
          • Set A_Temp_Loc = (DW_CentrePoint[DW_Index[2]] offset by (((Real((Integer A))) x 50.00) - 25.00) towards 90.00 degrees)
          • Unit - Create 1 Dark thingy Dummy for (Owner of (Triggering unit)) at A_Temp_Loc facing Default building facing degrees
          • Animation - Change (Last created unit)'s size to (75.00%, 75.00%, 75.00%) of its original size
          • Unit Group - Add (Last created unit) to DW_LongHandDummies[DW_Index[2]]
          • Custom script: call RemoveLocation(udg_A_Temp_Loc)
      • For each (Integer A) from 1 to 8, do (Actions)
        • Loop - Actions
          • Set A_Temp_Loc = (DW_CentrePoint[DW_Index[2]] offset by ((Real((Integer A))) x 50.00) towards 90.00 degrees)
          • Unit - Create 1 Ghost Dummy for (Owner of (Triggering unit)) at A_Temp_Loc facing Default building facing degrees
          • Animation - Change (Last created unit)'s size to (75.00%, 75.00%, 75.00%) of its original size
          • Unit Group - Add (Last created unit) to DW_LongHandDummies[DW_Index[2]]
          • Custom script: call RemoveLocation(udg_A_Temp_Loc)
      • Unit - Create 1 Clock Background for Player 1 (Red) at DW_CentrePoint[DW_Index[2]] facing Default building facing degrees
      • Unit Group - Add (Last created unit) to DW_ShortHandDummies[DW_Index[2]]
      • Countdown Timer - Start DW_Timer[DW_Index[2]] as a One-shot timer that will expire in DW_HaltTime[DW_Index[2]] seconds
  • Deadtime Watch Loop
    • Events
      • Time - Every 0.04 seconds of game time
    • Conditions
    • Actions
      • For each (Integer DW_Index[3]) from 1 to DW_Index[2], do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • DW_Boolean[DW_Index[3]] Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Remaining time for DW_Timer[DW_Index[3]]) Greater than 0.00
                • Then - Actions
                  • Unit Group - Pick every unit in DW_CircleDummies[DW_Index[3]] and do (Actions)
                    • Loop - Actions
                      • Set A_Temp_Loc = (Position of (Picked unit))
                      • Set TempReal = ((Angle from DW_CentrePoint[DW_Index[3]] to A_Temp_Loc) + DW_CircleSpeed[DW_Index[3]])
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • TempReal Greater than or equal to 360.00
                        • Then - Actions
                          • Set TempReal = (TempReal - 360.00)
                        • Else - Actions
                      • Set A_Temp_Loc2 = (DW_CentrePoint[DW_Index[3]] offset by 400.00 towards TempReal degrees)
                      • Unit - Move (Picked unit) instantly to A_Temp_Loc2, facing (TempReal + 90.00) degrees
                      • Custom script: call RemoveLocation(udg_A_Temp_Loc)
                      • Custom script: call RemoveLocation(udg_A_Temp_Loc)
                  • Unit Group - Pick every unit in DW_LongHandDummies[DW_Index[3]] and do (Actions)
                    • Loop - Actions
                      • Set A_Temp_Loc = (Position of (Picked unit))
                      • Set TempReal = ((Angle from DW_CentrePoint[DW_Index[3]] to A_Temp_Loc) - DW_HandSpeed[DW_Index[3]])
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • TempReal Less than 0.00
                        • Then - Actions
                          • Set TempReal = (TempReal + 360.00)
                        • Else - Actions
                      • Set A_Temp_Loc2 = (DW_CentrePoint[DW_Index[3]] offset by (Distance between DW_CentrePoint[DW_Index[3]] and A_Temp_Loc) towards TempReal degrees)
                      • Unit - Move (Picked unit) instantly to A_Temp_Loc2, facing (TempReal + 90.00) degrees
                      • Custom script: call RemoveLocation(udg_A_Temp_Loc)
                      • Custom script: call RemoveLocation(udg_A_Temp_Loc2)
                • Else - Actions
                  • Unit Group - Pick every unit in DW_CircleDummies[DW_Index[3]] and do (Actions)
                    • Loop - Actions
                      • Set A_Temp_Loc = (Position of (Picked unit))
                      • Unit - Remove (Picked unit) from the game
                      • Special Effect - Create a special effect at A_Temp_Loc using Objects\Spawnmodels\Undead\UndeadDissipate\UndeadDissipate.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • Custom script: call RemoveLocation(udg_A_Temp_Loc)
                  • Unit Group - Pick every unit in DW_LongHandDummies[DW_Index[3]] and do (Actions)
                    • Loop - Actions
                      • Set A_Temp_Loc = (Position of (Picked unit))
                      • Unit - Remove (Picked unit) from the game
                      • Special Effect - Create a special effect at A_Temp_Loc using Objects\Spawnmodels\Undead\UndeadDissipate\UndeadDissipate.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • Custom script: call RemoveLocation(udg_A_Temp_Loc)
                  • Unit Group - Pick every unit in DW_ShortHandDummies[DW_Index[3]] and do (Actions)
                    • Loop - Actions
                      • Set A_Temp_Loc = (Position of (Picked unit))
                      • Unit - Remove (Picked unit) from the game
                      • Custom script: call RemoveLocation(udg_A_Temp_Loc)
                  • Unit Group - Pick every unit in DW_HaltedTargets[DW_Index[3]] and do (Actions)
                    • Loop - Actions
                      • Animation - Change (Picked unit)'s animation speed to 100.00% of its original speed
                      • Unit - Unpause (Picked unit)
                  • Custom script: call RemoveLocation(udg_DW_CentrePoint[udg_DW_Index[3]])
                  • Custom script: call DestroyGroup(udg_DW_CircleDummies[udg_DW_Index[3]])
                  • Custom script: call DestroyGroup(udg_DW_ShortHandDummies[udg_DW_Index[3]])
                  • Custom script: call DestroyGroup(udg_DW_LongHandDummies[udg_DW_Index[3]])
                  • Set DW_Boolean[DW_Index[3]] = False
                  • Set DW_Index[1] = (DW_Index[1] - 1)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • DW_Index[1] Equal to 0
                    • Then - Actions
                      • Set DW_Index[2] = 0
                      • Trigger - Turn off (This trigger)
                    • Else - Actions
            • Else - Actions
Thanks in advance to any and all suggestions etc.
 
Status
Not open for further replies.
Top