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

Help me make this Spell MUI

Status
Not open for further replies.
Level 7
Joined
Apr 18, 2010
Messages
102
The skills is like an omnislash, the user picks a target and dashes to it many times. If the target dies while there are still remaining slashes, the user chooses another target within a certain aoe. Im in the process of beautifying the spell but when i used another unit in conjuction with it, the spell bugs like it is not MUI.. Here are the triggers


  • Ult
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Ulti
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • MUI_Index[1] Equal to 0
        • Then - Actions
          • Trigger - Turn on Ult Loop <gen>
        • Else - Actions
      • Set MUI_Index[1] = (MUI_Index[1] + 1)
      • Set MUI_Index[2] = (MUI_Index[2] + 1)
      • Set Caster[MUI_Index[2]] = (Triggering unit)
      • Set Target[MUI_Index[2]] = (Target unit of ability being cast)
      • Set Level[MUI_Index[2]] = (Level of Ulti for Caster[MUI_Index[2]])
      • Set Count[MUI_Index[2]] = 6
      • Set Boolean[MUI_Index[2]] = True
      • Unit - Make Caster[MUI_Index[2]] Invulnerable
      • Custom script: call SetUnitTurnSpeed(udg_Caster[udg_MUI_Index[2]], 999999)
      • Set Offset[MUI_Index[2]] = 60.00
      • Animation - Change Caster[MUI_Index[2]]'s animation speed to 250.00% of its original speed
      • Unit - Turn collision for Caster[MUI_Index[2]] Off
      • Set Wait[MUI_Index[2]] = 0
  • Ult Loop
    • Events
      • Time - Every 0.04 seconds of game time
    • Conditions
    • Actions
      • For each (Integer MUI_Index[3]) from 1 to MUI_Index[2], do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Boolean[MUI_Index[3]] Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Count[MUI_Index[3]] Greater than 0
                  • (Caster[MUI_Index[3]] is alive) Equal to True
                  • (Target[MUI_Index[3]] is visible to (Owner of Caster[MUI_Index[3]])) Equal to True
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Wait[MUI_Index[3]] Equal to 0
                    • Then - Actions
                      • Set CasterLoc = (Position of Caster[MUI_Index[3]])
                      • Set TargetLoc = (Position of Target[MUI_Index[3]])
                      • Set Angle[MUI_Index[3]] = (Angle from CasterLoc to TargetLoc)
                      • Set TargetLoc2 = (TargetLoc offset by 210.00 towards (Angle[MUI_Index[3]] + Real[MUI_Index[3]]) degrees)
                      • Set Distance[MUI_Index[3]] = (Distance between CasterLoc and TargetLoc)
                      • Custom script: call RemoveLocation(udg_TargetLoc)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • Distance[MUI_Index[3]] Less than or equal to 375.00
                        • Then - Actions
                          • Custom script: call SetUnitAnimationByIndex(udg_Caster[udg_MUI_Index[3]],2)
                          • Animation - Change Caster[MUI_Index[3]]'s animation speed to 275.00% of its original speed
                          • Set Offset[MUI_Index[3]] = 30.00
                        • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • Distance[MUI_Index[3]] Less than or equal to 200.00
                        • Then - Actions
                          • Animation - Change Caster[MUI_Index[3]]'s animation speed to 700.00% of its original speed
                        • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • Distance[MUI_Index[3]] Greater than 75.00
                        • Then - Actions
                          • Set TargetLoc = (CasterLoc offset by Offset[MUI_Index[3]] towards Angle[MUI_Index[3]] degrees)
                          • Custom script: call SetUnitX(udg_Caster[udg_MUI_Index[3]],GetLocationX(udg_TargetLoc))
                          • Custom script: call SetUnitY(udg_Caster[udg_MUI_Index[3]],GetLocationY(udg_TargetLoc))
                        • Else - Actions
                          • Set Wait[MUI_Index[3]] = 12
                          • Set Damage[MUI_Index[3]] = ((75.00 + (25.00 x (Real(Level[MUI_Index[3]])))) + ((Random real number between 25.00 and 31.00) + (Real((Agility of Caster[MUI_Index[3]] (Include bonuses))))))
                          • Custom script: call SetUnitX(udg_Caster[udg_MUI_Index[3]],GetLocationX(udg_TargetLoc2))
                          • Custom script: call SetUnitY(udg_Caster[udg_MUI_Index[3]],GetLocationY(udg_TargetLoc2))
                          • Unit - Cause Caster[MUI_Index[3]] to damage Target[MUI_Index[3]], dealing Damage[MUI_Index[3]] damage of attack type Hero and damage type Normal
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Target[MUI_Index[3]] is dead) Equal to True
                            • Then - Actions
                              • Set Group = (Units within 500.00 of CasterLoc matching ((((Matching unit) is A structure) Not equal to True) and ((((Matching unit) is visible to (Owner of Caster[MUI_Index[3]])) Equal to True) and ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is A H
                              • Set Target[MUI_Index[3]] = (Random unit from Group)
                              • Custom script: call DestroyGroup(udg_Group)
                            • Else - Actions
                      • Custom script: call RemoveLocation(udg_CasterLoc)
                      • Custom script: call RemoveLocation(udg_TargetLoc)
                      • Custom script: call RemoveLocation(udg_TargetLoc2)
                      • Set Distance[MUI_Index[3]] = 0.00
                      • Set Angle[MUI_Index[3]] = 0.00
                    • Else - Actions
                      • Set Wait[MUI_Index[3]] = (Wait[MUI_Index[3]] - 1)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • Wait[MUI_Index[3]] Equal to 9
                        • Then - Actions
                          • Animation - Change Caster[MUI_Index[3]]'s animation speed to 0.00% of its original speed
                        • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • Wait[MUI_Index[3]] Equal to 3
                        • Then - Actions
                          • Animation - Change Caster[MUI_Index[3]]'s animation speed to 999999.00% of its original speed
                          • Set CasterLoc = (Position of Caster[MUI_Index[3]])
                          • Set TargetLoc = (Position of Target[MUI_Index[3]])
                          • Set Angle[MUI_Index[3]] = (Angle from CasterLoc to TargetLoc)
                          • Set Real[MUI_Index[3]] = (Random real number between -36.00 and 36.00)
                          • Custom script: call SetUnitFacing(udg_Caster[udg_MUI_Index[3]], udg_Angle[udg_MUI_Index[3]])
                          • Custom script: call RemoveLocation(udg_CasterLoc)
                          • Custom script: call RemoveLocation(udg_TargetLoc)
                        • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • Wait[MUI_Index[3]] Equal to 0
                        • Then - Actions
                          • Set Offset[MUI_Index[3]] = 60.00
                          • Animation - Change Caster[MUI_Index[3]]'s animation speed to 250.00% of its original speed
                          • Custom script: call SetUnitAnimationByIndex(udg_Caster[udg_MUI_Index[3]],6)
                          • Animation - Reset Caster[MUI_Index[3]]'s animation
                          • Set Count[MUI_Index[3]] = (Count[MUI_Index[3]] - 1)
                        • Else - Actions
                • Else - Actions
                  • Set Boolean[MUI_Index[3]] = False
            • Else - Actions
              • Custom script: call SetUnitTurnSpeed(udg_Caster[udg_MUI_Index[3]], GetUnitDefaultTurnSpeed(udg_Caster[udg_MUI_Index[3]]))
              • Unit - Make Caster[MUI_Index[3]] Vulnerable
              • Unit - Turn collision for Caster[MUI_Index[3]] On
              • Unit - Order Caster[MUI_Index[3]] to Stop
              • Animation - Reset Caster[MUI_Index[3]]'s animation
              • Animation - Change Caster[MUI_Index[3]]'s animation speed to 100.00% of its original speed
              • Set Caster[MUI_Index[3]] = No unit
              • Set Target[MUI_Index[3]] = No unit
              • Set Level[MUI_Index[3]] = 0
              • Set Count[MUI_Index[3]] = 0
              • Set Wait[MUI_Index[3]] = 0
              • Set MUI_Index[1] = (MUI_Index[1] - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • MUI_Index[1] Equal to 0
                • Then - Actions
                  • Set MUI_Index[2] = 0
                  • Trigger - Turn off (This trigger)
                • Else - Actions

the problem is when 2 unit cast it, the number of attacks are shared and 1 unit becomes vulnerable at the end while the other doesnt.
 
Last edited by a moderator:
I think Display - Text messages could help you with this, as debug.
Display the values of variables (that are bugged), after you set/changed them. If the value seems strange or wrong you easily can see in which part this happens.

Also you are using this:
  • Custom script: call SetUnitAnimationByIndex(udg_Caster[udg_MUI_Index[3]],6)
I think it's not MUI, because unit animation index can difffer.. depends on which unit type is casting.
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
The indexing method you are using is old and inefficient. You should look at the new method in my tutorial things a GUIer should know. It will show you the more efficient way to do it. The chapter on how to index.

You should also not name things like MUI_index.
Instead use a unique integer variable for each spell.
 
Status
Not open for further replies.
Top