• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Why wont the unit stop..?

Status
Not open for further replies.
Okay this is rather complicated (to me) but i can't figure out why the damn thing wont stop.. he rises in the air and starts moving but he never stops.. the way i have this set up is if he casts it a certain distance away it will stop him and change his height back down and stuff.. but its not working..

  • Flying
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Rush
    • Actions
      • Set RushCaster[(Player number of (Owner of (Casting unit)))] = (Casting unit)
      • Set RushPoint[(Player number of (Owner of (Casting unit)))] = (Target point of ability being cast)
      • Set RushDistance = (Distance between (Position of RushCaster[(Player number of (Owner of (Casting unit)))]) and (Target point of ability being cast))
      • Unit - Pause RushCaster[(Player number of (Owner of (Casting unit)))]
      • Unit - Add Fly to RushCaster[(Player number of (Owner of (Casting unit)))]
      • Unit - Remove Fly from RushCaster[(Player number of (Owner of (Casting unit)))]
      • Animation - Change RushCaster[(Player number of (Owner of (Casting unit)))] flying height to 200.00 at 200.00
      • Trigger - Turn on Flying Movement <gen>
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RushDistance Greater than or equal to 0.00
          • RushDistance Less than or equal to 9.00
        • Then - Actions
          • Wait 0.05 seconds
          • Trigger - Turn off Flying Movement <gen>
          • Animation - Change RushCaster[(Player number of (Owner of (Casting unit)))] flying height to 0.00 at 200.00
          • Unit - Unpause RushCaster[(Player number of (Owner of (Casting unit)))]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RushDistance Greater than or equal to 10.00
          • RushDistance Less than or equal to 19.00
        • Then - Actions
          • Wait 0.15 seconds
          • Trigger - Turn off Flying Movement <gen>
          • Animation - Change RushCaster[(Player number of (Owner of (Casting unit)))] flying height to 0.00 at 200.00
          • Unit - Unpause RushCaster[(Player number of (Owner of (Casting unit)))]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RushDistance Greater than or equal to 20.00
          • RushDistance Less than or equal to 29.00
        • Then - Actions
          • Wait 0.25 seconds
          • Trigger - Turn off Flying Movement <gen>
          • Animation - Change RushCaster[(Player number of (Owner of (Casting unit)))] flying height to 0.00 at 200.00
          • Unit - Unpause RushCaster[(Player number of (Owner of (Casting unit)))]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RushDistance Greater than or equal to 30.00
          • RushDistance Less than or equal to 39.00
        • Then - Actions
          • Wait 0.35 seconds
          • Trigger - Turn off Flying Movement <gen>
          • Animation - Change RushCaster[(Player number of (Owner of (Casting unit)))] flying height to 0.00 at 200.00
          • Unit - Unpause RushCaster[(Player number of (Owner of (Casting unit)))]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RushDistance Greater than or equal to 40.00
          • RushDistance Less than or equal to 49.00
        • Then - Actions
          • Wait 0.45 seconds
          • Trigger - Turn off Flying Movement <gen>
          • Animation - Change RushCaster[(Player number of (Owner of (Casting unit)))] flying height to 0.00 at 200.00
          • Unit - Unpause RushCaster[(Player number of (Owner of (Casting unit)))]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RushDistance Greater than or equal to 50.00
          • RushDistance Less than or equal to 59.00
        • Then - Actions
          • Wait 0.55 seconds
          • Trigger - Turn off Flying Movement <gen>
          • Animation - Change RushCaster[(Player number of (Owner of (Casting unit)))] flying height to 0.00 at 200.00
          • Unit - Unpause RushCaster[(Player number of (Owner of (Casting unit)))]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RushDistance Greater than or equal to 60.00
          • RushDistance Less than or equal to 69.00
        • Then - Actions
          • Wait 0.65 seconds
          • Trigger - Turn off Flying Movement <gen>
          • Animation - Change RushCaster[(Player number of (Owner of (Casting unit)))] flying height to 0.00 at 200.00
          • Unit - Unpause RushCaster[(Player number of (Owner of (Casting unit)))]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RushDistance Greater than or equal to 70.00
          • RushDistance Less than or equal to 79.00
        • Then - Actions
          • Wait 0.75 seconds
          • Trigger - Turn off Flying Movement <gen>
          • Animation - Change RushCaster[(Player number of (Owner of (Casting unit)))] flying height to 0.00 at 200.00
          • Unit - Unpause RushCaster[(Player number of (Owner of (Casting unit)))]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RushDistance Greater than or equal to 80.00
          • RushDistance Less than or equal to 89.00
        • Then - Actions
          • Wait 0.85 seconds
          • Trigger - Turn off Flying Movement <gen>
          • Animation - Change RushCaster[(Player number of (Owner of (Casting unit)))] flying height to 0.00 at 200.00
          • Unit - Unpause RushCaster[(Player number of (Owner of (Casting unit)))]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RushDistance Greater than or equal to 90.00
          • RushDistance Less than or equal to 99.00
        • Then - Actions
          • Wait 0.95 seconds
          • Trigger - Turn off Flying Movement <gen>
          • Animation - Change RushCaster[(Player number of (Owner of (Casting unit)))] flying height to 0.00 at 200.00
          • Unit - Unpause RushCaster[(Player number of (Owner of (Casting unit)))]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RushDistance Greater than or equal to 100.00
          • RushDistance Less than or equal to 109.00
        • Then - Actions
          • Wait 1.05 seconds
          • Trigger - Turn off Flying Movement <gen>
          • Animation - Change RushCaster[(Player number of (Owner of (Casting unit)))] flying height to 0.00 at 200.00
          • Unit - Unpause RushCaster[(Player number of (Owner of (Casting unit)))]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RushDistance Greater than or equal to 110.00
          • RushDistance Less than or equal to 119.00
        • Then - Actions
          • Wait 1.15 seconds
          • Trigger - Turn off Flying Movement <gen>
          • Animation - Change RushCaster[(Player number of (Owner of (Casting unit)))] flying height to 0.00 at 200.00
          • Unit - Unpause RushCaster[(Player number of (Owner of (Casting unit)))]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RushDistance Greater than or equal to 120.00
          • RushDistance Less than or equal to 129.00
        • Then - Actions
          • Wait 1.25 seconds
          • Trigger - Turn off Flying Movement <gen>
          • Animation - Change RushCaster[(Player number of (Owner of (Casting unit)))] flying height to 0.00 at 200.00
          • Unit - Unpause RushCaster[(Player number of (Owner of (Casting unit)))]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RushDistance Greater than or equal to 130.00
          • RushDistance Less than or equal to 139.00
        • Then - Actions
          • Wait 1.35 seconds
          • Trigger - Turn off Flying Movement <gen>
          • Animation - Change RushCaster[(Player number of (Owner of (Casting unit)))] flying height to 0.00 at 200.00
          • Unit - Unpause RushCaster[(Player number of (Owner of (Casting unit)))]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RushDistance Greater than or equal to 140.00
          • RushDistance Less than or equal to 149.00
        • Then - Actions
          • Wait 1.45 seconds
          • Trigger - Turn off Flying Movement <gen>
          • Animation - Change RushCaster[(Player number of (Owner of (Casting unit)))] flying height to 0.00 at 200.00
          • Unit - Unpause RushCaster[(Player number of (Owner of (Casting unit)))]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RushDistance Greater than or equal to 150.00
          • RushDistance Less than or equal to 159.00
        • Then - Actions
          • Wait 1.55 seconds
          • Trigger - Turn off Flying Movement <gen>
          • Animation - Change RushCaster[(Player number of (Owner of (Casting unit)))] flying height to 0.00 at 200.00
          • Unit - Unpause RushCaster[(Player number of (Owner of (Casting unit)))]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RushDistance Greater than or equal to 160.00
          • RushDistance Less than or equal to 169.00
        • Then - Actions
          • Wait 1.65 seconds
          • Trigger - Turn off Flying Movement <gen>
          • Animation - Change RushCaster[(Player number of (Owner of (Casting unit)))] flying height to 0.00 at 200.00
          • Unit - Unpause RushCaster[(Player number of (Owner of (Casting unit)))]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RushDistance Greater than or equal to 170.00
          • RushDistance Less than or equal to 179.00
        • Then - Actions
          • Wait 1.75 seconds
          • Trigger - Turn off Flying Movement <gen>
          • Animation - Change RushCaster[(Player number of (Owner of (Casting unit)))] flying height to 0.00 at 200.00
          • Unit - Unpause RushCaster[(Player number of (Owner of (Casting unit)))]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RushDistance Greater than or equal to 180.00
          • RushDistance Less than or equal to 189.00
        • Then - Actions
          • Wait 1.85 seconds
          • Trigger - Turn off Flying Movement <gen>
          • Animation - Change RushCaster[(Player number of (Owner of (Casting unit)))] flying height to 0.00 at 200.00
          • Unit - Unpause RushCaster[(Player number of (Owner of (Casting unit)))]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RushDistance Greater than or equal to 190.00
          • RushDistance Less than or equal to 199.00
        • Then - Actions
          • Wait 1.95 seconds
          • Trigger - Turn off Flying Movement <gen>
          • Animation - Change RushCaster[(Player number of (Owner of (Casting unit)))] flying height to 0.00 at 200.00
          • Unit - Unpause RushCaster[(Player number of (Owner of (Casting unit)))]
        • Else - Actions


  • Flying Movement
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • Unit - Move RushCaster[(Player number of (Owner of (Casting unit)))] instantly to ((Position of RushCaster[(Player number of (Owner of (Casting unit)))]) offset by 10.00 towards (Facing of RushCaster[(Player number of (Owner of (Casting unit)))]) degrees)
And don't say .10 seconds is too fast because that doesnt help at all..
 
Level 5
Joined
Oct 17, 2006
Messages
151
Ok so what I got is that you are trying to turn off "flying movement" when rush distance equals a certain distance over a certain time.

So this means that your rush distance check should actually be once every .01 sec.

Your flying trigger needs to be changed to:
  • Flying
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Rush
    • Actions
      • Set RushCaster[(Player number of (Owner of (Casting unit)))] = (Casting unit)
      • Set RushPoint[(Player number of (Owner of (Casting unit)))] = (Target point of ability being cast)
      • Set RushDistance = (Distance between (Position of RushCaster[(Player number of (Owner of (Casting unit)))]) and (RushPoint)
      • Unit - Pause RushCaster[(Player number of (Owner of (Casting unit)))]
      • Unit - Add Fly to RushCaster[(Player number of (Owner of (Casting unit)))]
      • Unit - Remove Fly from RushCaster[(Player number of (Owner of (Casting unit)))]
      • Animation - Change RushCaster[(Player number of (Owner of (Casting unit)))] flying height to 200.00 at 200.00
      • Trigger - Turn on Flying Movement <gen>
      • Trigger - Turn on Rush Distance Check <gen>
Now our check should be checking the distance between position of rush caster and rush point (we need to reset this distance every .01 sec seeing this is a changing distance)

  • Rush Distance Check
    • Events
      • Time - Every .01 Sec
    • Conditions
    • Actions
      • Set RushDistance = (Distance between (Position of RushCaster[(Player number of (Owner of (Casting unit)))]) and (RushPoint))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RushDistance Greater than or equal to 0.00
          • RushDistance Less than or equal to 9.00
        • Then - Actions
          • Wait 0.05 seconds
          • Trigger - Turn off Flying Movement <gen>
          • Animation - Change RushCaster[(Player number of (Owner of (Casting unit)))] flying height to 0.00 at 200.00
          • Unit - Unpause RushCaster[(Player number of (Owner of (Casting unit)))]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RushDistance Greater than or equal to 10.00
          • RushDistance Less than or equal to 19.00
        • Then - Actions
          • Wait 0.15 seconds
          • Trigger - Turn off Flying Movement <gen>
          • Animation - Change RushCaster[(Player number of (Owner of (Casting unit)))] flying height to 0.00 at 200.00
          • Unit - Unpause RushCaster[(Player number of (Owner of (Casting unit)))]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RushDistance Greater than or equal to 20.00
          • RushDistance Less than or equal to 29.00
        • Then - Actions
          • Wait 0.25 seconds
          • Trigger - Turn off Flying Movement <gen>
          • Animation - Change RushCaster[(Player number of (Owner of (Casting unit)))] flying height to 0.00 at 200.00
          • Unit - Unpause RushCaster[(Player number of (Owner of (Casting unit)))]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RushDistance Greater than or equal to 30.00
          • RushDistance Less than or equal to 39.00
        • Then - Actions
          • Wait 0.35 seconds
          • Trigger - Turn off Flying Movement <gen>
          • Animation - Change RushCaster[(Player number of (Owner of (Casting unit)))] flying height to 0.00 at 200.00
          • Unit - Unpause RushCaster[(Player number of (Owner of (Casting unit)))]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RushDistance Greater than or equal to 40.00
          • RushDistance Less than or equal to 49.00
        • Then - Actions
          • Wait 0.45 seconds
          • Trigger - Turn off Flying Movement <gen>
          • Animation - Change RushCaster[(Player number of (Owner of (Casting unit)))] flying height to 0.00 at 200.00
          • Unit - Unpause RushCaster[(Player number of (Owner of (Casting unit)))]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RushDistance Greater than or equal to 50.00
          • RushDistance Less than or equal to 59.00
        • Then - Actions
          • Wait 0.55 seconds
          • Trigger - Turn off Flying Movement <gen>
          • Animation - Change RushCaster[(Player number of (Owner of (Casting unit)))] flying height to 0.00 at 200.00
          • Unit - Unpause RushCaster[(Player number of (Owner of (Casting unit)))]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RushDistance Greater than or equal to 60.00
          • RushDistance Less than or equal to 69.00
        • Then - Actions
          • Wait 0.65 seconds
          • Trigger - Turn off Flying Movement <gen>
          • Animation - Change RushCaster[(Player number of (Owner of (Casting unit)))] flying height to 0.00 at 200.00
          • Unit - Unpause RushCaster[(Player number of (Owner of (Casting unit)))]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RushDistance Greater than or equal to 70.00
          • RushDistance Less than or equal to 79.00
        • Then - Actions
          • Wait 0.75 seconds
          • Trigger - Turn off Flying Movement <gen>
          • Animation - Change RushCaster[(Player number of (Owner of (Casting unit)))] flying height to 0.00 at 200.00
          • Unit - Unpause RushCaster[(Player number of (Owner of (Casting unit)))]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RushDistance Greater than or equal to 80.00
          • RushDistance Less than or equal to 89.00
        • Then - Actions
          • Wait 0.85 seconds
          • Trigger - Turn off Flying Movement <gen>
          • Animation - Change RushCaster[(Player number of (Owner of (Casting unit)))] flying height to 0.00 at 200.00
          • Unit - Unpause RushCaster[(Player number of (Owner of (Casting unit)))]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RushDistance Greater than or equal to 90.00
          • RushDistance Less than or equal to 99.00
        • Then - Actions
          • Wait 0.95 seconds
          • Trigger - Turn off Flying Movement <gen>
          • Animation - Change RushCaster[(Player number of (Owner of (Casting unit)))] flying height to 0.00 at 200.00
          • Unit - Unpause RushCaster[(Player number of (Owner of (Casting unit)))]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RushDistance Greater than or equal to 100.00
          • RushDistance Less than or equal to 109.00
        • Then - Actions
          • Wait 1.05 seconds
          • Trigger - Turn off Flying Movement <gen>
          • Animation - Change RushCaster[(Player number of (Owner of (Casting unit)))] flying height to 0.00 at 200.00
          • Unit - Unpause RushCaster[(Player number of (Owner of (Casting unit)))]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RushDistance Greater than or equal to 110.00
          • RushDistance Less than or equal to 119.00
        • Then - Actions
          • Wait 1.15 seconds
          • Trigger - Turn off Flying Movement <gen>
          • Animation - Change RushCaster[(Player number of (Owner of (Casting unit)))] flying height to 0.00 at 200.00
          • Unit - Unpause RushCaster[(Player number of (Owner of (Casting unit)))]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RushDistance Greater than or equal to 120.00
          • RushDistance Less than or equal to 129.00
        • Then - Actions
          • Wait 1.25 seconds
          • Trigger - Turn off Flying Movement <gen>
          • Animation - Change RushCaster[(Player number of (Owner of (Casting unit)))] flying height to 0.00 at 200.00
          • Unit - Unpause RushCaster[(Player number of (Owner of (Casting unit)))]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RushDistance Greater than or equal to 130.00
          • RushDistance Less than or equal to 139.00
        • Then - Actions
          • Wait 1.35 seconds
          • Trigger - Turn off Flying Movement <gen>
          • Animation - Change RushCaster[(Player number of (Owner of (Casting unit)))] flying height to 0.00 at 200.00
          • Unit - Unpause RushCaster[(Player number of (Owner of (Casting unit)))]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RushDistance Greater than or equal to 140.00
          • RushDistance Less than or equal to 149.00
        • Then - Actions
          • Wait 1.45 seconds
          • Trigger - Turn off Flying Movement <gen>
          • Animation - Change RushCaster[(Player number of (Owner of (Casting unit)))] flying height to 0.00 at 200.00
          • Unit - Unpause RushCaster[(Player number of (Owner of (Casting unit)))]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RushDistance Greater than or equal to 150.00
          • RushDistance Less than or equal to 159.00
        • Then - Actions
          • Wait 1.55 seconds
          • Trigger - Turn off Flying Movement <gen>
          • Animation - Change RushCaster[(Player number of (Owner of (Casting unit)))] flying height to 0.00 at 200.00
          • Unit - Unpause RushCaster[(Player number of (Owner of (Casting unit)))]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RushDistance Greater than or equal to 160.00
          • RushDistance Less than or equal to 169.00
        • Then - Actions
          • Wait 1.65 seconds
          • Trigger - Turn off Flying Movement <gen>
          • Animation - Change RushCaster[(Player number of (Owner of (Casting unit)))] flying height to 0.00 at 200.00
          • Unit - Unpause RushCaster[(Player number of (Owner of (Casting unit)))]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RushDistance Greater than or equal to 170.00
          • RushDistance Less than or equal to 179.00
        • Then - Actions
          • Wait 1.75 seconds
          • Trigger - Turn off Flying Movement <gen>
          • Animation - Change RushCaster[(Player number of (Owner of (Casting unit)))] flying height to 0.00 at 200.00
          • Unit - Unpause RushCaster[(Player number of (Owner of (Casting unit)))]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RushDistance Greater than or equal to 180.00
          • RushDistance Less than or equal to 189.00
        • Then - Actions
          • Wait 1.85 seconds
          • Trigger - Turn off Flying Movement <gen>
          • Animation - Change RushCaster[(Player number of (Owner of (Casting unit)))] flying height to 0.00 at 200.00
          • Unit - Unpause RushCaster[(Player number of (Owner of (Casting unit)))]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RushDistance Greater than or equal to 190.00
          • RushDistance Less than or equal to 199.00
        • Then - Actions
          • Wait 1.95 seconds
          • Trigger - Turn off Flying Movement <gen>
          • Animation - Change RushCaster[(Player number of (Owner of (Casting unit)))] flying height to 0.00 at 200.00
          • Unit - Unpause RushCaster[(Player number of (Owner of (Casting unit)))]
        • Trigger - Turn off Rush Distance check <gen>
        • Else - Actions
You had the right idea however rush distance is a changing variable which means you need to reset it over and over again.

And not the Turn on and Off of "Rush Distance Check" at the end of both of these triggers.
 
Level 8
Joined
Aug 4, 2006
Messages
357
there is a better way to do this:

  • Flying
    • Events
      • Unit - A unit begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Rush
    • Actions
      • Set RushPoint[(Player number of (Owner of (Triggering unit)))] = (Target point of ability being cast)
      • -------- Create a Unit Group called RushCasters --------
      • Unit Group - Add (Triggering unit) to RushCasters
      • Unit - Pause (Triggering unit)
      • Unit - Add Fly to (Triggering unit)
      • Unit - Remove Fly from (Triggering unit)
      • Animation - Change (Triggering unit) flying height to 200.00 at 200.00
  • Rush Distance Check
    • Events
      • Time - Every .03 seconds of game-time
    • Conditions
      • (Number of units in RushCasters) Greater than 0
    • Actions
      • Unit Group - Pick every unit in RushCasters and do (Actions)
        • Loop - Actions
          • Set RushDistance = (Distance between (Picked unit) and (RushPoint[(Player number of (Owner of (Picked unit)))]))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • RushDistance Greater than 15.00
            • Then - Actions
              • Unit - Move (Picked unit) instantly to (Position of (Picked unit)) offset by 10.00 towards (Angle from (Position of (Picked unit)) to (RushPoint[(Player Number of (Owner of (Picked unit)))]) degrees
            • Else - Actions
              • Unit - Move (Picked unit) instantly to (Position of (Picked unit)) offset by RushDistance towards (Angle from (Position of (Picked unit)) to (RushPoint[(Player Number of (Owner of (Picked unit)))])
              • Animation - Change (Picked unit) flying height to 0.00 at 200.00
              • Unit - Unpause (Picked unit)
              • Unit Group - Remove (Picked unit) from RushCasters
this should work as long as no more than one unit owned by each player is "Rush"ing at the same time.
 
Last edited:
Level 8
Joined
Aug 4, 2006
Messages
357
1. Something happening every .01 seconds is way too fast. That's 100 frames per second, while humans can only see at about 30 fps. So, there will be no visual difference between doing something every .01 second as opposed to every .03 second (assuming you change the amount the rushing unit moves). This will allow the program more time to breathe and cause less lag.

2. It's a lot shorter and easier to read. That mass of if-then-else statements were not even nested in each other, meaning that the program will run through all of them no matter what. Even if the distance is less than 9, it will still check if it's between 10 and 19. This will also cause the game unnecessary lag.

3. You really only need to check if the unit is a really small distance from the target point, every time it's going to move. If it's within that distance, it has basically reached its target point, you can do the final actions, and remove it from the group so it won't be moved anymore.

4. More than one player can be rushing at one time. Using trigger turn offs means that if one player is in the middle of rushing, and another player finishes rushing, it will turn off the movement trigger so that the first player ALSO stops rushing. The way I did it, once a unit casts Rush, he is added to a unit group. Everyone in this unit group (everyone who's rushing) is moved towards their respective target points, every .03 seconds. Once they reach their target points, they are removed from the group so they will no longer be moved.

I also fixed a bunch of other stuff that I don't want to have to explain...
 
Level 5
Joined
Oct 17, 2006
Messages
151
I see now... Ty for explaining it. I've never thought much of the .03. The reason why though i used .01 is because his waits are like .05 which means the smallest increments need to be made in time (i thought).
 
Status
Not open for further replies.
Top