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

Unit Stuck?

Status
Not open for further replies.
Level 9
Joined
Jan 17, 2009
Messages
372
  • walk
    • Events
      • Timer - Every 0.08 seconds of Real Time
    • Local Variables
    • Conditions
    • Actions
      • Unit - Make Soldier [42.56, 78.76] face (Current camera yaw of player 1) over 0.02 seconds
      • General - If (Conditions) then do (Actions) else do (Actions)
        • If
          • And
            • Conditions
              • ("W" from the Global data table) == true
              • ("A" from the Global data table) == false
              • ("S" from the Global data table) == false
              • ("D" from the Global data table) == false
        • Then
          • General - Wait 0.07 Real Time seconds
          • Unit - Order Soldier [42.56, 78.76] to ( Move targeting ((Position of Soldier [42.56, 78.76]) offset by 0.35 towards (Current camera yaw of player 1) degrees)) (Replace Existing Orders)
        • Else
      • General - If (Conditions) then do (Actions) else do (Actions)
        • If
          • And
            • Conditions
              • ("W" from the Global data table) == true
              • ("A" from the Global data table) == true
              • ("S" from the Global data table) == false
              • ("D" from the Global data table) == false
        • Then
          • General - Wait 0.07 Real Time seconds
          • Unit - Order Soldier [42.56, 78.76] to ( Move targeting ((Position of Soldier [42.56, 78.76]) offset by 0.35 towards ((Current camera yaw of player 1) + 45.0) degrees)) (Replace Existing Orders)
        • Else
      • General - If (Conditions) then do (Actions) else do (Actions)
        • If
          • And
            • Conditions
              • ("W" from the Global data table) == false
              • ("A" from the Global data table) == true
              • ("S" from the Global data table) == false
              • ("D" from the Global data table) == false
        • Then
          • General - Wait 0.07 Real Time seconds
          • Unit - Order Soldier [42.56, 78.76] to ( Move targeting ((Position of Soldier [42.56, 78.76]) offset by 0.35 towards ((Current camera yaw of player 1) + 90.0) degrees)) (Replace Existing Orders)
        • Else
      • General - If (Conditions) then do (Actions) else do (Actions)
        • If
          • And
            • Conditions
              • ("W" from the Global data table) == false
              • ("A" from the Global data table) == true
              • ("S" from the Global data table) == true
              • ("D" from the Global data table) == false
        • Then
          • General - Wait 0.07 Real Time seconds
          • Unit - Order Soldier [42.56, 78.76] to ( Move targeting ((Position of Soldier [42.56, 78.76]) offset by 0.35 towards ((Current camera yaw of player 1) + 135.0) degrees)) (Replace Existing Orders)
        • Else
      • General - If (Conditions) then do (Actions) else do (Actions)
        • If
          • And
            • Conditions
              • ("W" from the Global data table) == false
              • ("A" from the Global data table) == false
              • ("S" from the Global data table) == false
              • ("D" from the Global data table) == true
        • Then
          • General - Wait 0.07 Real Time seconds
          • Unit - Order Soldier [42.56, 78.76] to ( Move targeting ((Position of Soldier [42.56, 78.76]) offset by 0.35 towards ((Current camera yaw of player 1) - 90.0) degrees)) (Replace Existing Orders)
        • Else
      • General - If (Conditions) then do (Actions) else do (Actions)
        • If
          • And
            • Conditions
              • ("W" from the Global data table) == false
              • ("A" from the Global data table) == false
              • ("S" from the Global data table) == true
              • ("D" from the Global data table) == true
        • Then
          • General - Wait 0.07 Real Time seconds
          • Unit - Order Soldier [42.56, 78.76] to ( Move targeting ((Position of Soldier [42.56, 78.76]) offset by 0.35 towards ((Current camera yaw of player 1) - 135.0) degrees)) (Replace Existing Orders)
        • Else
      • General - If (Conditions) then do (Actions) else do (Actions)
        • If
          • And
            • Conditions
              • ("W" from the Global data table) == true
              • ("A" from the Global data table) == false
              • ("S" from the Global data table) == false
              • ("D" from the Global data table) == true
        • Then
          • General - Wait 0.07 Real Time seconds
          • Unit - Order Soldier [42.56, 78.76] to ( Move targeting ((Position of Soldier [42.56, 78.76]) offset by 0.35 towards ((Current camera yaw of player 1) - 45.0) degrees)) (Replace Existing Orders)
        • Else
      • General - If (Conditions) then do (Actions) else do (Actions)
        • If
          • And
            • Conditions
              • ("W" from the Global data table) == false
              • ("A" from the Global data table) == false
              • ("S" from the Global data table) == true
              • ("D" from the Global data table) == false
        • Then
          • General - Wait 0.07 Real Time seconds
          • Unit - Order Soldier [42.56, 78.76] to ( Move targeting ((Position of Soldier [42.56, 78.76]) offset by 0.35 towards ((Current camera yaw of player 1) - 180.0) degrees)) (Replace Existing Orders)
        • Else
I have created a unit that cannot turn manual, but it will turn if you make it face an angle or point in triggers.
However, when i try to move the unit and turn at once, i need a .07 second wait time in order for the unit to actually move.

Are there any ways for me to reduce or just remove the wait entirely?

It is really choppy and any wait that is shorter will cause the unit to not face the angle i want.
 
Level 9
Joined
Jan 17, 2009
Messages
372
I am making a 3rd person movement system, that includes strafing

I want the unit to face my camera rotation when pressing all W,S,A, and D keys

I want the unit to change its angle when i move my mouse, so if i turn the camera with my mouse, my unit will turn also.

Currently, my unit will only turn with my mouse if i have a .07 wait in between the turn and move action.
 
Status
Not open for further replies.
Top