• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Spell Problems

Status
Not open for further replies.
Level 5
Joined
Apr 26, 2009
Messages
92
Hey guys! This is my first time triggering a MUI spell. The first time I tested it i was like "Yes! It works!" but when i tried it again it didn't work. Also the MUI part didn't really work either. If you could help me fix up this spell please!

  • my other spell
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Lightning Ring
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • A_Index[1] Equal to 0
        • Then - Actions
          • Trigger - Turn on Spell Loop <gen>
        • Else - Actions
      • Set A_Index[1] = (A_Index[1] + 1)
      • Set A_Index[2] = (A_Index[2] + 1)
      • Set Nova_Caster[A_Index[2]] = (Triggering unit)
      • Set Nova_Point[A_Index[2]] = (Position of Nova_Caster[A_Index[2]])
      • Set Nova_Distance[A_Index[2]] = 100.00
      • Set Nova_Angle[A_Index[2]] = 0.00
      • Set timecheck[A_Index[2]] = 0.00
      • Set Done[A_Index[2]] = False
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Unit - Create 1 Dummy ball for (Owner of Nova_Caster[A_Index[2]]) at (Nova_Point[A_Index[2]] offset by Nova_Distance[A_Index[2]] towards Nova_Angle[A_Index[2]] degrees) facing Default building facing degrees
          • Unit Group - Add (Last created unit) to DummyGroup[A_Index[2]]
          • Set Nova_Angle[A_Index[2]] = (Nova_Angle[A_Index[2]] + 30.00)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Lightning Ring for Nova_Caster[A_Index[2]]) Equal to 1
            • Then - Actions
              • Unit - Add Permanent Immolation (1) to (Last created unit)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Lightning Ring for Nova_Caster[A_Index[2]]) Equal to 2
                • Then - Actions
                  • Unit - Add Permanent Immolation (2) to (Last created unit)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Level of Lightning Ring for Nova_Caster[A_Index[2]]) Equal to 3
                    • Then - Actions
                      • Unit - Add Permanent Immolation (3) to (Last created unit)
                    • Else - Actions
  • Spell Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A_Index[3]) from 1 to A_Index[2], do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Done[A_Index[3]] Equal to False
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • timecheck[A_Index[3]] Less than or equal to 30.00
                • Then - Actions
                  • Set timecheck[A_Index[3]] = (timecheck[A_Index[3]] + 0.03)
                  • Unit Group - Pick every unit in DummyGroup[A_Index[3]] and do (Actions)
                    • Loop - Actions
                      • Set temppoint = (Position of (Picked unit))
                      • Unit - Move (Picked unit) instantly to (temppoint offset by 10.00 towards ((Angle from Nova_Point[A_Index[3]] to temppoint) - 90.00) degrees)
                      • Custom script: call RemoveLocation(udg_temppoint)
                • Else - Actions
                  • Set Done[A_Index[3]] = True
            • Else - Actions
              • Custom script: call RemoveLocation(udg_Nova_Point[udg_A_Index[3]])
              • Unit Group - Pick every unit in DummyGroup[A_Index[3]] and do (Actions)
                • Loop - Actions
                  • Unit - Add a 0.03 second Generic expiration timer to (Picked unit)
              • Custom script: call DestroyGroup(udg_DummyGroup[udg_A_Index[3]])
              • Set Nova_Caster[A_Index[3]] = No unit
              • Set A_Index[1] = (A_Index[1] - 1)
              • Set Done[A_Index[3]] = False
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • A_Index[1] Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
          • Set A_Index[2] = 0
        • Else - Actions
 
Level 25
Joined
Jun 5, 2008
Messages
2,572
Group arrays aren't initialized properly in GUI.

Only Group[0] is created for the rest you need to add this to your Spell Init trigger just before you use the group:
  • Custom script: if udg_DummyGroup[udg_A_Index[2]]==null then
  • Custom script: set udg_DummyGroup[udg_A_Index[2]]=CreateGroup()
  • Custom script: endif
Also for the loop add another condition:

Nova_Caster[A_Index[3]] Not Equal No unit

Try now, should fix the spell imo.
 
Level 5
Joined
Apr 26, 2009
Messages
92
thanks so much! +rep

EDIT:

wait where do i put that condition? its not working anymore :x
 
Last edited:
Status
Not open for further replies.
Top