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

Leap Spell MPI Problem

Status
Not open for further replies.
Level 8
Joined
Feb 17, 2007
Messages
368
I just started making my first spell MPI, and I'm not sure why this isn't working:

  • Leap
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to |cffff0000Leap|r
    • Actions
      • Set Unit[(Player number of (Owner of (Triggering unit)))] = (Triggering unit)
      • Unit - Pause Unit[(Player number of (Owner of (Triggering unit)))]
      • Animation - Play Unit[(Player number of (Owner of (Triggering unit)))]'s attack slam animation
      • Unit - Turn collision for Unit[(Player number of (Owner of (Triggering unit)))] Off
      • Animation - Change Unit[(Player number of (Owner of (Triggering unit)))]'s animation speed to 0.00% of its original speed
      • Unit - Add Crow Form to Unit[(Player number of (Owner of (Triggering unit)))]
      • Trigger - Turn on Leap Fly <gen>
      • Trigger - Turn on Leap Move <gen>
  • Leap Fly
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Current flying height of Unit[(Player number of (Owner of (Triggering unit)))]) Less than 200.00
        • Then - Actions
          • Animation - Change Unit[(Player number of (Owner of (Triggering unit)))] flying height to ((Current flying height of Unit[(Player number of (Owner of (Triggering unit)))]) + 4.00) at (Current flying height of Unit[(Player number of (Owner of (Triggering unit)))])
        • Else - Actions
          • Trigger - Turn on Leap Down <gen>
          • Trigger - Turn off (This trigger)
  • Leap Move
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Leap Fly <gen> is on) Equal to True
              • (Leap Down <gen> is on) Equal to True
        • Then - Actions
          • Unit - Move Unit[(Player number of (Owner of (Triggering unit)))] instantly to ((Position of Unit[(Player number of (Owner of (Triggering unit)))]) offset by 5.00 towards (Facing of Unit[(Player number of (Owner of (Triggering unit)))]) degrees)
        • Else - Actions
          • Animation - Change Unit[(Player number of (Owner of (Triggering unit)))] flying height to 0.00 at 0.00
          • Unit - Turn collision for Unit[(Player number of (Owner of (Triggering unit)))] On
          • Unit - Unpause Unit[(Player number of (Owner of (Triggering unit)))]
          • Animation - Change Unit[(Player number of (Owner of (Triggering unit)))]'s animation speed to 100.00% of its original speed
          • Special Effect - Create a special effect at (Position of Unit[(Player number of (Owner of (Triggering unit)))]) using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
          • Special Effect - Destroy (Last created special effect)
          • Unit - Remove Crow Form from Unit[(Player number of (Owner of (Triggering unit)))]
          • Unit Group - Pick every unit in (Units within 500.00 of (Position of Unit[(Player number of (Owner of (Triggering unit)))]) matching (((Matching unit) belongs to an enemy of (Owner of Unit[(Player number of (Owner of (Triggering unit)))])) Equal to True)) and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Unit[(Player number of (Owner of (Triggering unit)))] has buff |cffff0000Concentration of the Worgen|r ) Equal to True
                • Then - Actions
                  • Unit - Cause Unit[(Player number of (Owner of (Triggering unit)))] to damage (Picked unit), dealing 200.00 damage of attack type Normal and damage type Normal
                • Else - Actions
                  • Unit - Cause Unit[(Player number of (Owner of (Triggering unit)))] to damage (Picked unit), dealing 150.00 damage of attack type Normal and damage type Normal
          • Trigger - Turn off (This trigger)
  • Leap Down
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Current flying height of Unit[(Player number of (Owner of (Triggering unit)))]) Greater than 1.00
        • Then - Actions
          • Animation - Change Unit[(Player number of (Owner of (Triggering unit)))] flying height to ((Current flying height of Unit[(Player number of (Owner of (Triggering unit)))]) - 4.00) at (Current flying height of Unit[(Player number of (Owner of (Triggering unit)))])
        • Else - Actions
          • Trigger - Turn off (This trigger)
I only need to make it MPI as there will only be 1 hero/unit per player. I don't see any specific tutorials around for just MPI, only MUI. :p
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
You could loop through the players. Save a boolean in the first trigger. So if it is not true, it skips the actions. Use integer A instead of player number in the looping triggers.

  • Leap Fly
    • Events
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • IsFlying[Integer A] equal to true
            • Then - Actions
              • **Do actions**
            • Else - Actions
 
Level 9
Joined
Jun 25, 2009
Messages
427
Yeah, leave the first Trigger alone, but use an integer variable for the loop, such as Leap_Loop or something, and check it that way, since periodical triggers, when you put [player number (owner of something)] there it returns nothing because there is no triggering unit. (Periodical event).

  • Periodical Triggah
    • Events:
      • Time - Every 0.04 seconds of the game time
    • Conditions:
    • Actions:
      • For each Leap_Loop from 1 to 12 (Do Actions):
        • Loop - Actions:
          • If (All Conditions) are True then (Do Actions) else (Do Actions):
            • If - Conditions:
              • Leap_Should_Jump_Further[Leap_Loop] equal to True \\\\\\\For reasons explained below
            • Then - Actions:
              • If (All Conditions) are True then (Do Actions) else (Do Actions):
                • If - Conditions:
                  • Leap_Distance[Leap_Loop] equal to or greater than 700 \\\\\\\\Let's say it's 700 :D
                • Then - Actions:
                  • Set Leap_Should_Jump_Further[Leap_Loop]=False
                • Else - Actions:
                  • Unit - Move Unit[Leap_Loop] to somewhere
                  • Set Range=(Range - 32)
            • Else - Actions:
Add a boolean to check that and when the range is reached, just set it to False, because without it, let's say other player's mirana jumps and it moves your Mirana too, since you don't put a condition if the mirana should be moved :)

Hope it will help you

Tiche3
 
Level 8
Joined
Feb 17, 2007
Messages
368
Yeah, leave the first Trigger alone, but use an integer variable for the loop, such as Leap_Loop or something, and check it that way, since periodical triggers, when you put [player number (owner of something)] there it returns nothing because there is no triggering unit. (Periodical event).

  • Periodical Triggah
    • Events:
      • Time - Every 0.04 seconds of the game time
    • Conditions:
    • Actions:
      • For each Leap_Loop from 1 to 12 (Do Actions):
        • Loop - Actions:
          • If (All Conditions) are True then (Do Actions) else (Do Actions):
            • If - Conditions:
              • Leap_Should_Jump_Further[Leap_Loop] equal to True \\\\\\\For reasons explained below
            • Then - Actions:
              • If (All Conditions) are True then (Do Actions) else (Do Actions):
                • If - Conditions:
                  • Leap_Distance[Leap_Loop] equal to or greater than 700 \\\\\\\\Let's say it's 700 :D
                • Then - Actions:
                  • Set Leap_Should_Jump_Further[Leap_Loop]=False
                • Else - Actions:
                  • Unit - Move Unit[Leap_Loop] to somewhere
                  • Set Range=(Range - 32)
            • Else - Actions:
Add a boolean to check that and when the range is reached, just set it to False, because without it, let's say other player's mirana jumps and it moves your Mirana too, since you don't put a condition if the mirana should be moved :)

Hope it will help you

Tiche3

Wow thanks man, this helps a lot! You even explained the reason why it didn't work. :thumbs_up:

Thanks to Maker to for the speedy and helpful reply. :wink:
 
Status
Not open for further replies.
Top