• 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.

Jumping Problem

Status
Not open for further replies.
Level 7
Joined
Nov 18, 2012
Messages
272
I created a Jump System and, whatever I do, it ends up with the unit not landing to the perfect landing height (It's always 0.09 or 0.10 from the ground). This is quite a problem since some triggers require exact numbers.

What causes the problem? Leaks? Error in code?

Edit:Here's the code:
  • Acttual Jump
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • For each (Integer J_Int) from 1 to J_MaxInts, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • J_JumpHeight[J_Int] Less than J_MaxJumpHeight[J_Int]
            • Then - Actions
              • Set J_JumpHeight[J_Int] = (J_JumpHeight[J_Int] + ((J_MaxJumpHeight[J_Int] + J_JumpLandingHeight[J_Int]) x (J_JumpTimer[J_Int] x 0.02)))
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • J_JumpHeight[J_Int] Equal to J_JumpLandingHeight[J_Int]
                • Then - Actions
                  • Set J_JumpHeight[J_Int] = (J_JumpHeight[J_Int] + 1.00)
                • Else - Actions
              • Unit - Move J_JumpingUnit[J_Int] instantly to ((Position of J_JumpingUnit[J_Int]) offset by (J_JumpDistance[J_Int] x (J_JumpTimer[J_Int] / 100.00)) towards J_JumpAngle[J_Int] degrees)
              • Animation - Change J_JumpingUnit[J_Int] flying height to (J_Default[J_Int] + J_JumpHeight[J_Int]) at 1000.00
              • Animation - Play J_JumpingUnit[J_Int]'s walk animation
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • J_JumpHeight[J_Int] Greater than or equal to J_MaxJumpHeight[J_Int]
                  • J_JumpHeight[J_Int] Less than (J_MaxJumpHeight[J_Int] x 2.00)
                • Then - Actions
                  • Set J_JumpHeight[J_Int] = (J_JumpHeight[J_Int] + (J_MaxJumpHeight[J_Int] x (J_JumpTimer[J_Int] x 0.02)))
                  • Unit - Move J_JumpingUnit[J_Int] instantly to ((Position of J_JumpingUnit[J_Int]) offset by (J_JumpDistance[J_Int] x (J_JumpTimer[J_Int] / 100.00)) towards J_JumpAngle[J_Int] degrees)
                  • Animation - Change J_JumpingUnit[J_Int] flying height to ((J_MaxJumpHeight[J_Int] + J_JumpLandingHeight[J_Int]) - (J_JumpHeight[J_Int] - (J_MaxJumpHeight[J_Int] + (Default flying height of J_JumpingUnit[J_Int])))) at 1000.00
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • J_JumpHeight[J_Int] Greater than or equal to (J_MaxJumpHeight[J_Int] x 2.00)
                    • Then - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Current flying height of J_JumpingUnit[J_Int]) Greater than (J_JumpHeight[J_Int] - 1.00)
                          • (Current flying height of J_JumpingUnit[J_Int]) Less than (J_JumpHeight[J_Int] + 1.00)
                        • Then - Actions
                          • Unit - Turn collision for J_JumpingUnit[J_Int] Off
                          • Unit Group - Remove J_JumpingUnit[J_Int] from J_Jumpers
                          • Set J_JumpingUnit[J_Int] = No unit
                          • Game - Display to (All players) the text: Boop
                        • Else - Actions
                          • Animation - Change J_JumpingUnit[J_Int] flying height to J_JumpLandingHeight[J_Int] at 1000.00
                    • Else - Actions
                      • Do nothing
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • J_JumpingUnit[J_Int] Equal to No unit
              • J_Int Equal to J_MaxInts
            • Then - Actions
              • Set J_MaxInts = (J_MaxInts - 1)
              • Set J_JumpHeight[J_Int] = 0.00
              • Set J_JumpingUnit[J_MaxInts] = No unit
              • Set J_JumpLandingHeight[J_Int] = 0.00
              • Set J_MaxJumpHeight[J_Int] = 0.00
              • Set J_Default[J_Int] = 0.00
              • Set J_JumpAngle[J_Int] = 0.00
              • Set J_JumpDistance[J_Int] = 0.00
              • Set J_JumpPoint[J_MaxInts] = (R_Point offset by ((Current movement speed of (Picked unit)) / 1.00) towards J_JumpAngle[J_MaxInts] degrees)
              • Custom script: call RemoveLocation (udg_J_JumpPoint[udg_J_Int])
            • Else - Actions
              • Do nothing
 
Status
Not open for further replies.
Top