• 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.

Really dumb error with MuI script.

Status
Not open for further replies.
Level 3
Joined
May 21, 2011
Messages
31
Well I tried to recreate one of my spells for a spell pack, and for some reason it just didn't work. Everything is exactly the same 'in theory', but it the original one works and the new one doesn't. Here are the triggers.

Charge
  • Charge
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Charge
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • C_Skip Equal to 0
        • Then - Actions
          • Trigger - Turn on Charge Loop <gen>
        • Else - Actions
      • Set C_Times = (C_Times + 1)
      • Set C_Skip = (C_Skip + 1)
      • Set C_Off[C_Times] = True
      • Set C_Hero[C_Times] = (Casting unit)
      • Set C_Point[0] = (Position of C_Hero[C_Times])
      • Set C_Point[1] = (Target point of ability being cast)
      • Set C_Distance[C_Times] = (Distance between C_Point[0] and C_Point[1])
      • Set C_Angle[C_Times] = (Angle from C_Point[C_Times] to C_Point[C_Times])
      • Set C_Speed[C_Times] = 30.00
      • Set C_Spam[C_Times] = 0
      • Unit - Turn collision for C_Hero[C_Times] Off
      • Custom script: call RemoveLocation(udg_C_Point[0])
      • Custom script: call RemoveLocation(udg_C_Point[1])
Charge Loop
  • Charge Loop
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • For each (Integer FD) from 1 to C_Times, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • C_Off[C] Equal to False
            • Then - Actions
              • Game - Display to (All players) the text: Off Works
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • C_Distance[C] Less than or equal to 0.00
                • Then - Actions
                  • Game - Display to (All players) the text: Distance is Zero
                  • Set C_Skip = (C_Skip - 1)
                  • Set C_Off[C] = False
                  • Unit - Turn collision for C_Hero[C] On
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • C_Skip Equal to 0
                    • Then - Actions
                      • Set C_Times = 0
                      • Trigger - Turn off Charge Loop <gen>
                    • Else - Actions
                • Else - Actions
                  • Game - Display to (All players) the text: Distance Works
                  • Set C_Distance[C] = (C_Distance[C] - C_Speed[C])
                  • Set C_Point[2] = (Position of C_Hero[C])
                  • Set C_Point[3] = ((Position of C_Hero[C]) offset by C_Speed[C] towards C_Angle[C] degrees)
                  • Unit - Move C_Hero[C] instantly to C_Point[3]
                  • Destructible - Pick every destructible within 150.00 of C_Point[3] and do (Destructible - Kill (Picked destructible))
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • C_Spam[C] Equal to 4
                    • Then - Actions
                      • Set C_Spam[C] = 0
                      • Special Effect - Create a special effect at FD_Point[2] using Objects\Spawnmodels\Human\HCancelDeath\HCancelDeath.mdl
                      • Special Effect - Destroy (Last created special effect)
                    • Else - Actions
                      • Set C_Spam[C] = (C_Spam[C] + 1)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Terrain pathing at C_Point[3] of type Walkability is off) Equal to True
                    • Then - Actions
                      • Set C_Distance[C] = 0.00
                    • Else - Actions
                  • Custom script: call RemoveLocation(udg_C_Point[2])
                  • Custom script: call RemoveLocation(udg_C_Point[3])
            • Else - Actions
Fire Path
  • Fire Path
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Charge TWO
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • FD_Skip Equal to 0
        • Then - Actions
          • Trigger - Turn on Fire Path Loop <gen>
        • Else - Actions
      • Set FD_Times = (FD_Times + 1)
      • Set FD_Skip = (FD_Skip + 1)
      • Set FD_Off[FD_Times] = True
      • Set FD_Hero[FD_Times] = (Casting unit)
      • Set FD_Point[0] = (Position of FD_Hero[FD_Times])
      • Set FD_Point[1] = (Target point of ability being cast)
      • Set FD_Distance[FD_Times] = (Distance between FD_Point[0] and FD_Point[1])
      • Set FD_Angle[FD_Times] = (Angle from FD_Point[0] to FD_Point[1])
      • Set FD_Speed[FD_Times] = 30.00
      • Set FD_Spam[FD_Times] = 0
      • Unit - Turn collision for FD_Hero[FD_Times] Off
      • Custom script: call RemoveLocation(udg_FD_Point[0])
      • Custom script: call RemoveLocation(udg_FD_Point[1])
Fire Path Loop
  • Fire Path Loop
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • For each (Integer FD) from 1 to FD_Times, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • FD_Off[FD] Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • FD_Distance[FD] Less than or equal to 0.00
                • Then - Actions
                  • Set FD_Skip = (FD_Skip - 1)
                  • Set FD_Off[FD] = False
                  • Unit - Turn collision for FD_Hero[FD] On
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • FD_Skip Equal to 0
                    • Then - Actions
                      • Set FD_Times = 0
                      • Trigger - Turn off Fire Path Loop <gen>
                    • Else - Actions
                • Else - Actions
                  • Set FD_Distance[FD] = (FD_Distance[FD] - FD_Speed[FD])
                  • Set FD_Point[2] = (Position of FD_Hero[FD])
                  • Set FD_Point[3] = (FD_Point[2] offset by FD_Speed[FD] towards FD_Angle[FD] degrees)
                  • Unit - Move FD_Hero[FD] instantly to FD_Point[3]
                  • Destructible - Pick every destructible within 150.00 of FD_Point[2] and do (Destructible - Kill (Picked destructible))
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • FD_Spam[FD] Equal to 4
                    • Then - Actions
                      • Set FD_Spam[FD] = 0
                      • Special Effect - Create a special effect at FD_Point[2] using Objects\Spawnmodels\Human\HCancelDeath\HCancelDeath.mdl
                      • Special Effect - Destroy (Last created special effect)
                    • Else - Actions
                      • Set FD_Spam[FD] = (FD_Spam[FD] + 1)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Terrain pathing at FD_Point[3] of type Walkability is off) Equal to True
                    • Then - Actions
                      • Set FD_Distance[FD] = 0.00
                    • Else - Actions
                  • Custom script: call RemoveLocation(udg_FD_Point[2])
                  • Custom script: call RemoveLocation(udg_FD_Point[3])
            • Else - Actions
As you can see both trigger sets are exactly the same but the variables are different. Each variable is a copy of the other variable, they are used in the same instance too. The only difference is the names, which shouldn't affect anything if they are assigned properly. If anyone knows what is going on please help so I can get this done, thanks in advance :)
 
Level 3
Joined
May 21, 2011
Messages
31
Actually yes, it does need to be an array. Why? Because if it is not, it will set that point is the point of whatever caster just casted, so it wouldn't work. If it is an array, it will be ALL the casters who casted.

Lol, I checked over the spell a million times before coming here, I don't know how I didn't catch that it was FD, not C.

The boolean checking is the same on both spells, but one of them works, the other doesn't.

You fixed the problem though, thanks for the help :D
 
Status
Not open for further replies.
Top