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

[Trigger] Spell : MUI Glitch

Status
Not open for further replies.
Level 10
Joined
Feb 20, 2008
Messages
448
i can execute the spell 2 timeone at a time by any caster, but soon i cast it twice the the loop that make the ball move gets stuck and the ball stop moving ......, o_O, iits giving me headach ,any help is welcome

Bug : caster 1 & caster 2 cast spell at same time, caster 2 spell get interrupt and effect never get destroyed & caster 1 is pause and cant unpause but trigger goes on and the ball diseappear ...... so result, some vars getting overwrite or idk what do i miss ?

edit : i added new stuff i miss in trigger but its even worst ....... why ?


  • Katon MUI
    • Katon MUI
      • Events
        • Unit - A unit Starts the effect of an ability
      • Conditions
        • (Ability being cast) Equal to Katon Goukakyuu
      • Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • KALoop[1] Equal to 0
          • Then - Actions
            • Trigger - Turn on Katon MUI Act <gen>
          • Else - Actions
        • Set KALoop[1] = (KALoop[1] + 1)
        • Set HS_index_selected = False
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • KADyn_Index Less than HS_index[2]
            • KA_index_is_empty[KADyn_Index] Equal to True
            • KADyn_Index Not equal to 0
          • Then - Actions
            • Set KA_index_selected = True
          • Else - Actions
            • For each (Integer KALoop[0]) from 1 to KALoop[2], do (Actions)
              • Loop - Actions
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • KA_index_selected Equal to False
                    • KA_index_is_empty[KALoop[0]] Equal to True
                  • Then - Actions
                    • Set KADyn_Index = KALoop[0]
                    • Set KA_index_selected = True
                  • Else - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • KA_index_selected Equal to False
              • Then - Actions
                • Set KALoop[2] = (KALoop[2] + 1)
                • Set KADyn_Index = KALoop[2]
              • Else - Actions
        • Set KACaster[KADyn_Index] = (Triggering unit)
        • Set KADmg[KADyn_Index] = (2.00 x ((Real((Level of (Ability being cast) for KACaster[KADyn_Index]))) x (Real((Strength of KACaster[KADyn_Index] (Exclude bonuses))))))
        • Set KATarget[2] = (Target point of ability being cast)
        • Set KAPoint[2] = (Position of KACaster[KALoop[2]])
        • Set KAAngle[KADyn_Index] = (Angle from KAPoint[2] to KATarget[2])
        • Set KAPoint[3] = (KAPoint[2] offset by 50.00 towards KAAngle[KADyn_Index] degrees)
        • Set KACheck[KADyn_Index] = 40
        • For each (Integer KALoop[3]) from 1 to KALoop[2], do (Actions)
          • Loop - Actions
            • Animation - Play KACaster[KALoop[3]]'s spell one animation
            • Unit - Pause KACaster[KALoop[3]]
            • Unit - Create 1 Effect for (Owner of KACaster[KALoop[3]]) at KAPoint[3] facing KAAngle[KALoop[3]] degrees
            • Unit Group - Add (Last created unit) to KAGroup2[KALoop[3]]
            • Unit - Create 1 Katon for (Owner of KACaster[KALoop[3]]) at KAPoint[3] facing KAAngle[KALoop[3]] degrees
            • Unit Group - Add (Last created unit) to KAGroup2[KALoop[3]]
        • Custom script: call RemoveLocation(udg_KAPoint[2])
        • Custom script: call RemoveLocation(udg_KAPoint[3])
        • Custom script: call RemoveLocation(udg_KATarget[2])
  • Katon MUI Act
  • Katon MUI Act
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • For each (Integer KALoop[3]) from 1 to KALoop[2], do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • KACheck[KALoop[3]] Greater than 0
            • Then - Actions
              • Set KACheck[KALoop[3]] = (KACheck[KALoop[3]] - 1)
              • Set KAPoint[4] = (Position of KAUnit1[KALoop[3]])
              • Set KAPoint[5] = (KAPoint[4] offset by 50.00 towards KAAngle[KALoop[3]] degrees)
              • Set KAPoint[8] = (Position of KACaster[KALoop[3]])
              • Set KA_index_is_empty[KALoop[3]] = True
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • KACheck[KALoop[3]] Less than or equal to 35
                • Then - Actions
                  • Set KAGroup[KALoop[3]] = (Units within 300.00 of KAPoint[4] matching (((Matching unit) belongs to an ally of (Owner of KACaster[KALoop[3]])) Equal to False))
                  • Destructible - Pick every destructible within 100.00 of KAPoint[4] and do (Actions)
                    • Loop - Actions
                      • Destructible - Kill (Picked destructible)
                  • Unit - Move KAUnit1[KALoop[3]] instantly to KAPoint[5]
                  • -------- DAMAGE --------
                  • Unit Group - Pick every unit in KAGroup[KALoop[3]] and do (Unit - Cause KAUnit1[KALoop[3]] to damage (Picked unit), dealing KADmg[KALoop[3]] damage of attack type Spells and damage type Shadow Strike)
                  • Special Effect - Create a special effect at KAPoint[4] using Objects\Spawnmodels\Other\NeutralBuildingExplosion\NeutralBuildingExplosion.mdl
                  • Special Effect - Destroy (Last created special effect)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • KACheck[KALoop[3]] Equal to 36
                    • Then - Actions
                      • Unit - Unpause KACaster[KALoop[3]]
                      • Unit Group - Pick every unit in KAGroup2[KALoop[3]] and do (Unit - Remove (Picked unit) from the game)
                      • Unit - Create 1 Katon Ball for (Owner of KACaster[KALoop[3]]) at KAPoint[8] facing KAAngle[KALoop[3]] degrees
                      • Set KAUnit1[KALoop[3]] = (Last created unit)
                      • -------- loop ball run for 1.5 sec --------
                    • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • KACheck[KALoop[3]] Less than or equal to 0
                • Then - Actions
                  • Unit - Remove KAUnit1[KALoop[3]] from the game
                  • Set KALoop[1] = (KALoop[1] - 1)
                  • -------- we reduce the index[1] variable cause one spell instance has ended --------
                  • -------- --- --------
                  • Set KA_index_is_empty[KALoop[3]] = True
                  • -------- This spell instance has finished it's effect and we "free" the array using this variable --------
                  • -------- --- --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • KA_index_selected Equal to False
                    • Then - Actions
                      • Set KADyn_Index = KALoop[3]
                      • -------- We set the HS_dyn_index to an value of this index so the next time when the spell is cast it has an value of an array that is not taken --------
                      • -------- --- --------
                      • Set KA_index_selected = True
                      • -------- We have just set an value for HS_dyn_index so we have selected the index we are going to use the next time a spell using this indexing is cast --------
                    • Else - Actions
                  • -------- --- --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • KALoop[1] Not equal to 0
                      • KALoop[3] Equal to KALoop[2]
                    • Then - Actions
                      • Set KALoop[2] = (KALoop[2] - 1)
                      • Game - Display to (All players) the text: Debug Message: Loop...
                    • Else - Actions
                  • -------- If this is the spell instance which uses the highest value of HS_index[2] we can reduce the HS_index[2] value to shorten the loop process --------
                  • -------- --- --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • KALoop[1] Equal to 0
                    • Then - Actions
                      • Set KALoop[2] = 0
                      • -------- we reset the index[2] to 0 cause there aren't any active spells running --------
                      • -------- --- --------
                      • Set KADyn_Index = 0
                      • -------- We also reset the HS_dyn_index to 0 --------
                      • -------- --- --------
                      • Trigger - Turn off (This trigger)
                      • -------- we turn off this trigger, it is pointless for it to run if there isn't any spell for it to affect --------
                      • -------- --- --------
                      • Game - Display to (All players) the text: off
                      • -------- we can display a "debug" message to check will the trigger turn off when there aren't any other active spell --------
                    • Else - Actions
                  • -------- if the index[1] is 0 there are no active spell and we do actions --------
                • Else - Actions
              • Custom script: call RemoveLocation(udg_KAPoint[4])
              • Custom script: call RemoveLocation(udg_KAPoint[5])
              • Custom script: call RemoveLocation(udg_KAPoint[8])
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • KALoop[1] Not equal to 0
                  • KALoop[3] Equal to KALoop[2]
                • Then - Actions
                  • Set KALoop[2] = (KALoop[2] - 1)
                  • Game - Display to (All players) the text: Debug Message: Loop...
                  • Trigger - Turn off (This trigger)
                • Else - Actions
 
Last edited:
Level 6
Joined
Mar 26, 2008
Messages
239
Well,for now I can only say that it happens because of variables,because when you use it once, variables are set for 1 use, but when you use it twice,then variables change at 2 time,and 1 use can use variables no more.
May be later I'll post how to fix that (I mean the code)
For now I can only say that using hashtables instead of variables could fix the problem.
 
Level 10
Joined
Feb 20, 2008
Messages
448
i wont use hashtable, some of these crash inside we or lag when its shouldnt >.> result i hate hashtable

the bug is probly made like hell gate said

@ hell Gate do you have msn ? ill send it to you, add some comment so i know whats was my error,
but if its 2 much i guess i can figure out how u did

becuz in the tutorial the name index are way 2 long o_O the trigger really confusing

edit : i read the tutorial again and i follow the way as it should but it mess up even worst -_-,
the spell cannot be cast another time, and the ball doesnt get destroy 2 and its still mess sigh... i updated the code in main post
 
Last edited:
Status
Not open for further replies.
Top