• 🏆 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!

Weird MUI problem.

Status
Not open for further replies.
Level 14
Joined
Aug 8, 2010
Messages
1,022
Yo! I have a spell here with Hanky's Dynamic Indexing system. And i have trouble with lightnings - they are not MUI. The problem is this : i have 1 instance of the spell and then another instance is casted. The problem is that the second instance finishes first, while the first instance never ends. The spell even makes the game crash upon multiple casts in short amount of time. Help me, please. I will post the triggers below, as well as uploading the map.
  • Chain Shock Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Electric Field silence
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • EleFID2 Equal to 0
        • Then - Actions
          • Trigger - Turn on Chain Shock Loop <gen>
        • Else - Actions
      • Set EleFID2 = (EleFID2 + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • EleFID2 Greater than EleFIDMax
        • Then - Actions
          • Set EleFID[EleFID2] = EleFID2
          • Set EleFIDMax = EleFID2
        • Else - Actions
      • Set EleFArray = EleFID[EleFID2]
      • Set EleFCaster[EleFArray] = (Triggering unit)
      • Set EleFAbilityLevel[EleFArray] = (Level of Electric Field silence for (Triggering unit))
      • Set EleFPoint[EleFArray] = (Target point of ability being cast)
      • Set EleFAreaOfEffect[EleFArray] = (200.00 + (50.00 x (Real(EleFAbilityLevel[EleFArray]))))
      • Set EleFIntegerAMax[EleFArray] = (((Integer(EleFAreaOfEffect[EleFArray])) / 50) x 2)
      • Set EleFLightAlpha[EleFArray] = 0.00
      • Set EleFBoolean[EleFArray] = False
      • Set EleFDuration[EleFArray] = 3.00
  • Chain Shock Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer EleFLoop) from 1 to EleFID2, do (Actions)
        • Loop - Actions
          • Set EleFArray = EleFID[EleFLoop]
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • EleFBoolean[EleFArray] Equal to False
            • Then - Actions
              • For each (Integer EleFIntegerA[EleFArray]) from 1 to EleFIntegerAMax[EleFArray], do (Actions)
                • Loop - Actions
                  • Set EleFLightSource[EleFIntegerAMax[EleFArray]] = (EleFPoint[EleFArray] offset by EleFAreaOfEffect[EleFArray] towards ((360.00 / (Real(EleFIntegerAMax[EleFArray]))) x (Real(EleFIntegerA[EleFArray]))) degrees)
                  • Set EleFLightTarget[EleFIntegerAMax[EleFArray]] = (EleFPoint[EleFArray] offset by EleFAreaOfEffect[EleFArray] towards ((360.00 / (Real(EleFIntegerAMax[EleFArray]))) x ((Real(EleFIntegerA[EleFArray])) + 1.00)) degrees)
                  • Lightning - Create a Chain Lightning - Secondary lightning effect from source EleFLightSource[EleFIntegerAMax[EleFArray]] to target EleFLightTarget[EleFIntegerAMax[EleFArray]]
                  • Set EleFLightnings[EleFIntegerA[EleFArray]] = (Last created lightning effect)
                  • Custom script: call RemoveLocation(udg_EleFLightSource[udg_EleFIntegerAMax[udg_EleFArray]])
                  • Custom script: call RemoveLocation(udg_EleFLightTarget[udg_EleFIntegerAMax[udg_EleFArray]])
              • Set EleFBoolean[EleFArray] = True
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • EleFLightAlpha[EleFArray] Less than 1.00
            • Then - Actions
              • For each (Integer EleFIntegerA[EleFArray]) from 1 to EleFIntegerAMax[EleFArray], do (Actions)
                • Loop - Actions
                  • Lightning - Change color of EleFLightnings[EleFIntegerA[EleFArray]] to (1.00 1.00 1.00) with EleFLightAlpha[EleFArray] alpha
            • Else - Actions
          • Set EleFDuration[EleFArray] = (EleFDuration[EleFArray] - 0.03)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • EleFLightAlpha[EleFArray] Less than 1.00
            • Then - Actions
              • Set EleFLightAlpha[EleFArray] = (EleFLightAlpha[EleFArray] + 0.05)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • EleFDuration[EleFArray] Less than or equal to 0.00
            • Then - Actions
              • For each (Integer EleFIntegerA[EleFArray]) from 1 to EleFIntegerAMax[EleFArray], do (Actions)
                • Loop - Actions
                  • Lightning - Destroy EleFLightnings[EleFIntegerA[EleFArray]]
              • Set EleFID[EleFLoop] = EleFID[EleFID2]
              • Set EleFID[EleFID2] = EleFArray
              • Set EleFID2 = (EleFID2 - 1)
              • Set EleFLoop = (EleFLoop - 1)
            • Else - Actions
Help will be appreciated with a +rep. Thanks in advance!
 

Attachments

  • Electric Field Pt. 2.w3x
    22.1 KB · Views: 19
Level 14
Joined
Aug 8, 2010
Messages
1,022
Can you explain a little bit what this line of code does? I don't say that it doesn't work, but i want to know what it does.

And btw - when i set that variable to this value, how i need to delete the lightnings? Again with Integer A and loop actions? Tell me what i need to do to delete the lightnings after i create them, please.
 
Level 14
Joined
Aug 8, 2010
Messages
1,022
It works now! As always, thanks, Maker! You're the best! Honestly! :]

EDIT : Why it doesn't work now?
  • Chain Shock Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer EleFLoop) from 1 to EleFID2, do (Actions)
        • Loop - Actions
          • Set EleFArray = EleFID[EleFLoop]
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • EleFBoolean[EleFArray] Equal to False
            • Then - Actions
              • For each (Integer EleFIntegerA[EleFArray]) from 1 to EleFIntegerAMax[EleFArray], do (Actions)
                • Loop - Actions
                  • Set EleFLightSource[EleFIntegerAMax[EleFArray]] = (EleFPoint[EleFArray] offset by EleFAreaOfEffect[EleFArray] towards ((360.00 / (Real(EleFIntegerAMax[EleFArray]))) x (Real(EleFIntegerA[EleFArray]))) degrees)
                  • Set EleFLightTarget[EleFIntegerAMax[EleFArray]] = (EleFPoint[EleFArray] offset by EleFAreaOfEffect[EleFArray] towards ((360.00 / (Real(EleFIntegerAMax[EleFArray]))) x ((Real(EleFIntegerA[EleFArray])) + 1.00)) degrees)
                  • Lightning - Create a Chain Lightning - Secondary lightning effect from source EleFLightSource[EleFIntegerAMax[EleFArray]] to target EleFLightTarget[EleFIntegerAMax[EleFArray]]
                  • Set EleFLightArray = ((20 x EleFArray) + EleFIntegerA[EleFArray])
                  • Set EleFLightnings[EleFLightArray] = (Last created lightning effect)
                  • Custom script: call RemoveLocation(udg_EleFLightSource[udg_EleFIntegerAMax[udg_EleFArray]])
                  • Custom script: call RemoveLocation(udg_EleFLightTarget[udg_EleFIntegerAMax[udg_EleFArray]])
              • Set EleFBoolean[EleFArray] = True
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • EleFLightAlpha[EleFArray] Less than 1.00
            • Then - Actions
              • For each (Integer EleFIntegerA[EleFArray]) from 1 to EleFIntegerAMax[EleFArray], do (Actions)
                • Loop - Actions
                  • Lightning - Change color of EleFLightnings[EleFLightArray] to (1.00 1.00 1.00) with EleFLightAlpha[EleFArray] alpha
            • Else - Actions
          • Set EleFDuration[EleFArray] = (EleFDuration[EleFArray] - 0.03)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • EleFLightAlpha[EleFArray] Less than 1.00
            • Then - Actions
              • Set EleFLightAlpha[EleFArray] = (EleFLightAlpha[EleFArray] + 0.05)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • EleFDuration[EleFArray] Less than or equal to 0.00
            • Then - Actions
              • For each (Integer EleFIntegerA[EleFArray]) from 1 to EleFIntegerAMax[EleFArray], do (Actions)
                • Loop - Actions
                  • Lightning - Destroy EleFLightnings[EleFLightArray]
              • Set EleFID[EleFLoop] = EleFID[EleFID2]
              • Set EleFID[EleFID2] = EleFArray
              • Set EleFID2 = (EleFID2 - 1)
              • Set EleFLoop = (EleFLoop - 1)
            • Else - Actions
I just wanted to put that huge array into a variable, so i can set the actions easily... but what happens is a non-mui spell, in which only one of the lightning effects destroys.
 
Status
Not open for further replies.
Top