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

[Solved] Help me fix this MPI Combo System

Status
Not open for further replies.
Level 18
Joined
Dec 17, 2009
Messages
1,114
  • Start
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Attack
    • Actions
      • Set Combo_Number = (Player number of (Owner of (Triggering unit)))
      • Set Combo_Caster[Combo_Number] = (Triggering unit)
      • Set Combo_Time[Combo_Number] = (Combo_Time[Combo_Number] + 0.75)
      • Set Combo_Max[Combo_Number] = (1 + (Level of Attack for (Triggering unit)))
      • Set Combo_Current[Combo_Number] = (Combo_Current[Combo_Number] + 1)
      • Set Combo_AttackPoint[Combo_Number] = (Combo_Point[Combo_Number] offset by 75.00 towards (Facing of Combo_Caster[Combo_Number]) degrees)
      • Set Combo_ATTGroup[Combo_Number] = (Units within 175.00 of Combo_AttackPoint[Combo_Number] matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True) and ((Matching unit) Not equal to (Triggering unit)))))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Combo_Max[Combo_Number] Less than or equal to Combo_Current[Combo_Number]
        • Then - Actions
          • Set Combo_Current[Combo_Number] = 0
          • Set Combo_Time[Combo_Number] = 0.00
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • Combo_Current[Combo_Number] Equal to 1
              • Combo_Current[Combo_Number] Equal to 3
        • Then - Actions
          • Set Combo_Anim[Combo_Number] = Attack 2
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Combo_Current[Combo_Number] Equal to 4
            • Then - Actions
              • Set Combo_Anim[Combo_Number] = Attack 3
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • Combo_Current[Combo_Number] Equal to 2
                      • Combo_Current[Combo_Number] Equal to 5
                • Then - Actions
                  • Set Combo_Anim[Combo_Number] = Attack 1
                • Else - Actions
      • Animation - Play Combo_Caster[Combo_Number]'s Combo_Anim[Combo_Number] animation
      • Unit Group - Pick every unit in Combo_ATTGroup[Combo_Number] and do (Actions)
        • Loop - Actions
          • Set Combo_PointEffect = (Position of (Picked unit))
          • Unit - Cause (Triggering unit) to damage (Picked unit), dealing (10.00 x (Real(Combo_Current[Combo_Number]))) damage of attack type Spells and damage type Normal
          • Special Effect - Create a special effect at Combo_PointEffect using Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl
          • Special Effect - Destroy (Last created special effect)
          • Special Effect - Create a special effect at Combo_PointEffect using Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl
          • Special Effect - Destroy (Last created special effect)
          • Custom script: call RemoveLocation(udg_Combo_PointEffect)
      • Custom script: call RemoveLocation(udg_Combo_Point[udg_Combo_Number])
      • Custom script: call RemoveLocation(udg_Combo_AttackPoint[udg_Combo_Number])
      • Custom script: call DestroyGroup(udg_Combo_ATTGroup[udg_Combo_Number])
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Combo_UG is empty) Equal to False
        • Then - Actions
          • Trigger - Turn on Check <gen>
        • Else - Actions
  • Check
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Combo_UG is empty) Equal to True
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
          • Unit Group - Pick every unit in Combo_UG and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Combo_Time[(Player number of (Owner of (Picked unit)))] Less than or equal to 0.00
                • Then - Actions
                  • Set Combo_Current[(Player number of (Owner of (Picked unit)))] = 0
                  • Set Combo_Time[(Player number of (Owner of (Picked unit)))] = 0.00
                  • Unit - Order (Picked unit) to Stop
                  • Unit Group - Remove (Picked unit) from Combo_UG
                • Else - Actions
                  • Set Combo_Time[(Player number of (Owner of (Picked unit)))] = (Combo_Time[(Player number of (Owner of (Picked unit)))] - 0.01)
Can somebody tell me what is wrong with the code?

Here's the test map if you want to test it yourself :D

I would really appreciate your help..:wink:
 

Attachments

  • HELP.w3x
    22.5 KB · Views: 57
Level 18
Joined
Dec 17, 2009
Messages
1,114
Err.. it works like When you tap A it will play the animation and units infront of it will receive damage

Max Combo is according to the level of the ability

E.G
Level 1 max 2 combos
Level 2 max 3 combos etc


PS:
Okay guys i've just fixed the triggers and i've found the problem
NOW the new problem is that the animation won't play...?
  • Start
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Attack
    • Actions
      • Set Combo_Number = (Player number of (Owner of (Triggering unit)))
      • Set Combo_Caster[Combo_Number] = (Triggering unit)
      • Set Combo_Time[Combo_Number] = (Combo_Time[Combo_Number] + 0.75)
      • Set Combo_Max[Combo_Number] = (1 + (Level of Attack for (Triggering unit)))
      • Set Combo_Current[Combo_Number] = (Combo_Current[Combo_Number] + 1)
      • Set Combo_Point[Combo_Number] = (Position of Combo_Caster[Combo_Number])
      • Set Combo_AttackPoint[Combo_Number] = (Combo_Point[Combo_Number] offset by 75.00 towards (Facing of Combo_Caster[Combo_Number]) degrees)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Combo_Max[Combo_Number] Less than or equal to Combo_Current[Combo_Number]
        • Then - Actions
          • Set Combo_Current[Combo_Number] = 0
          • Set Combo_Time[Combo_Number] = 0.00
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • Combo_Current[Combo_Number] Equal to 1
              • Combo_Current[Combo_Number] Equal to 3
        • Then - Actions
          • Set Combo_Anim[Combo_Number] = Attack - 2
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Combo_Current[Combo_Number] Equal to 4
            • Then - Actions
              • Set Combo_Anim[Combo_Number] = Attack - 3
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • Combo_Current[Combo_Number] Equal to 2
                      • Combo_Current[Combo_Number] Equal to 5
                • Then - Actions
                  • Set Combo_Anim[Combo_Number] = Attack - 1
                • Else - Actions
      • Set Combo_ATTGroup[Combo_Number] = (Units within 90.00 of Combo_AttackPoint[Combo_Number] matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True) and ((Matching unit) Not equal to (Triggering unit)))))
      • Animation - Play Combo_Caster[Combo_Number]'s Combo_Anim[Combo_Number] animation
      • Unit Group - Pick every unit in Combo_ATTGroup[Combo_Number] and do (Actions)
        • Loop - Actions
          • Set Combo_PointEffect = (Position of (Picked unit))
          • Unit - Cause (Triggering unit) to damage (Picked unit), dealing (10.00 x (Real(Combo_Current[Combo_Number]))) damage of attack type Spells and damage type Normal
          • Special Effect - Create a special effect at Combo_PointEffect using Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl
          • Special Effect - Destroy (Last created special effect)
          • Special Effect - Create a special effect at Combo_PointEffect using Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl
          • Special Effect - Destroy (Last created special effect)
          • Unit - Move (Picked unit) instantly to Combo_PointEffect
          • Custom script: call RemoveLocation(udg_Combo_PointEffect)
      • Custom script: call RemoveLocation(udg_Combo_Point[udg_Combo_Number])
      • Custom script: call RemoveLocation(udg_Combo_AttackPoint[udg_Combo_Number])
      • Custom script: call DestroyGroup(udg_Combo_ATTGroup[udg_Combo_Number])
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Combo_UG is empty) Equal to False
        • Then - Actions
          • Trigger - Turn on Check <gen>
        • Else - Actions
  • Check
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Combo_UG is empty) Equal to True
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
          • Unit Group - Pick every unit in Combo_UG and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Combo_Time[(Player number of (Owner of (Picked unit)))] Less than or equal to 0.00
                • Then - Actions
                  • Set Combo_Current[(Player number of (Owner of (Picked unit)))] = 0
                  • Set Combo_Time[(Player number of (Owner of (Picked unit)))] = 0.00
                  • Unit - Order (Picked unit) to Stop
                  • Unit Group - Remove (Picked unit) from Combo_UG
                • Else - Actions
                  • Set Combo_Time[(Player number of (Owner of (Picked unit)))] = (Combo_Time[(Player number of (Owner of (Picked unit)))] - 0.01)
 
Last edited:
Level 16
Joined
Aug 7, 2009
Messages
1,403
You can't index animations, but they'll get their index automatically. Just open your Warcraft3Viewer, open the model and count the animations from the top to the bottom. The first one has an index of 0, the second one has 1, and so forth.

You can also convert the model to .mdl, open it in Notepad, search the Sequences block and do the same thing there.
 
Status
Not open for further replies.
Top