• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Need help with my camera/movement system

Status
Not open for further replies.
Level 8
Joined
Mar 3, 2009
Messages
327
I made a camera/movement system and it worked awesomely when i did it in single player. i tested it with some friends though, and the movement wouldnt work for them. One of my friends had a look over it and said that nothing seemed to be wrong.

I use pick every player, so i can stop it from firing for specific players. I've noticed that every other GUI camera system uses integer A.

the code uses too many I/T/E's for me to bother posting it here so ill attach the map :p
if you find any leaks for me that would be appreciated too

EDIT: that version got kinda retarded. attached a slightly less buggy one, but my problem still remains.

{EDIT}
BUMP please :(
 

Attachments

  • gogo camera system.w3x
    26.8 KB · Views: 56
Last edited by a moderator:
Level 10
Joined
Feb 7, 2005
Messages
409
  • movement
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Set temppoint[(Player number of (Picked player))] = (Position of Hero[(Player number of (Picked player))])
          • Custom script: set udg_CamHeight[GetConvertedPlayerId(GetEnumPlayer())] = GetLocationZ(udg_temppoint[1])
          • Camera - Set (Picked player)'s camera Height Offset to (CamHeight[(Player number of (Picked player))] x 0.70) over 0.10 seconds
          • Camera - Set (Picked player)'s camera Distance to target to 700.00 over 0.10 seconds
          • Camera - Set (Picked player)'s camera Angle of attack to 340.00 over 0.10 seconds
          • Camera - Set (Picked player)'s camera Rotation to (Facing of Paladin 0000 <gen>) over 0.30 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • movingup[(Player number of (Picked player))] Equal to True
        • Then - Actions
          • Set temppoint1[(Player number of (Picked player))] = (temppoint[(Player number of (Picked player))] offset by movespeed[(Player number of (Picked player))] towards (Facing of Hero[(Player number of (Picked player))]) degrees)
          • Animation - Play Hero[(Player number of (Picked player))]'s walk animation
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • movingdown[(Player number of (Picked player))] Equal to True
        • Then - Actions
          • Set temppoint1[(Player number of (Picked player))] = (temppoint[(Player number of (Picked player))] offset by movespeed[(Player number of (Picked player))] towards ((Facing of Hero[(Player number of (Picked player))]) + 180.00) degrees)
          • Animation - Play Hero[(Player number of (Picked player))]'s walk animation
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • strafe Equal to False
          • moveingleft[(Player number of (Picked player))] Equal to True
        • Then - Actions
          • Unit - Make Hero[(Player number of (Owner of (Picked unit)))] face ((Facing of Hero[(Player number of (Picked player))]) + 10.00) over 0.00 seconds
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • strafe Equal to False
          • movingright[(Player number of (Picked player))] Equal to True
        • Then - Actions
          • Unit - Make Hero[(Player number of (Owner of (Picked unit)))] face ((Facing of Hero[(Player number of (Picked player))]) - 10.00) over 0.00 seconds
        • Else - Actions
      • -------- @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • strafe Equal to True
          • movingright[(Player number of (Picked player))] Equal to True
        • Then - Actions
          • Set temppoint1[(Player number of (Picked player))] = (temppoint[(Player number of (Picked player))] offset by movespeed[(Player number of (Picked player))] towards ((Facing of Hero[(Player number of (Picked player))]) - 90.00) degrees)
          • Animation - Play Hero[(Player number of (Picked player))]'s walk animation
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • strafe Equal to True
          • moveingleft[(Player number of (Picked player))] Equal to True
        • Then - Actions
          • Set temppoint1[(Player number of (Picked player))] = (temppoint[(Player number of (Picked player))] offset by movespeed[(Player number of (Picked player))] towards ((Facing of Hero[(Player number of (Picked player))]) + 90.00) degrees)
          • Animation - Play Hero[(Player number of (Picked player))]'s walk animation
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • strafe Equal to True
          • moveingleft[(Player number of (Picked player))] Equal to True
          • movingup[(Player number of (Picked player))] Equal to True
        • Then - Actions
          • Set temppoint1[(Player number of (Picked player))] = (temppoint[(Player number of (Picked player))] offset by movespeed[(Player number of (Picked player))] towards ((Facing of Hero[(Player number of (Picked player))]) + 45.00) degrees)
          • Animation - Play Hero[(Player number of (Picked player))]'s walk animation
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • strafe Equal to True
          • movingright[(Player number of (Picked player))] Equal to True
          • movingup[(Player number of (Picked player))] Equal to True
        • Then - Actions
          • Set temppoint1[(Player number of (Picked player))] = (temppoint[(Player number of (Picked player))] offset by movespeed[(Player number of (Picked player))] towards ((Facing of Hero[(Player number of (Picked player))]) - 45.00) degrees)
          • Animation - Play Hero[(Player number of (Picked player))]'s walk animation
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • strafe Equal to True
              • moveingleft[(Player number of (Picked player))] Equal to True
              • movingdown[(Player number of (Picked player))] Equal to True
            • Then - Actions
              • Set temppoint1[(Player number of (Picked player))] = (temppoint[(Player number of (Picked player))] offset by movespeed[(Player number of (Picked player))] towards ((Facing of Hero[(Player number of (Picked player))]) + 135.00) degrees)
              • Animation - Play Hero[(Player number of (Picked player))]'s walk animation
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • strafe Equal to True
          • movingright[(Player number of (Picked player))] Equal to True
          • movingdown[(Player number of (Picked player))] Equal to True
        • Then - Actions
          • Set temppoint1[(Player number of (Picked player))] = (temppoint[(Player number of (Picked player))] offset by movespeed[(Player number of (Picked player))] towards ((Facing of Hero[(Player number of (Picked player))]) - 135.00) degrees)
          • Animation - Play Hero[(Player number of (Picked player))]'s walk animation
        • Else - Actions
      • Unit - Move Hero[(Player number of (Picked player))] instantly to temppoint1[(Player number of (Picked player))]
      • Custom script: call RemoveLocation(udg_temppoint[(GetConvertedPlayerId(GetEnumPlayer()))])
      • Custom script: call RemoveLocation(udg_temppoint1[(GetConvertedPlayerId(GetEnumPlayer()))])
apparently your friend doesn't know much about triggers :p

in this you'll notice all your I/T/Es are below your "pick every player" and are not actually in the loop. You'll have to move everything below the loop into the loop for starters. This line here, and the ones below it "movingup[(Player number of (Picked player))] Equal to True" "picked player" is a null value, since the I/T/E is not in the loop

understand what I'm trying to say?

You also have improper values for a lot of the variables, here's the trigger redone, it should work much better this way...

It's not perfect but it's your system not mine, this should help.

  • movement
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Set temppoint[(Player number of (Picked player))] = (Position of Hero[(Player number of (Picked player))])
          • Custom script: set udg_CamHeight[GetConvertedPlayerId(GetEnumPlayer())] = GetLocationZ(GetConvertedPlayerId(GetEnumPlayer()))
          • Camera - Set (Picked player)'s camera Height Offset to (CamHeight[(Player number of (Picked player))] x 0.70) over 0.10 seconds
          • Camera - Set (Picked player)'s camera Distance to target to 700.00 over 0.10 seconds
          • Camera - Set (Picked player)'s camera Angle of attack to 340.00 over 0.10 seconds
          • Camera - Set (Picked player)'s camera Rotation to (Facing of Hero[(Player number of (Picked player))]) over 0.30 seconds
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • movingup[(Player number of (Picked player))] Equal to True
            • Then - Actions
              • Set temppoint1[(Player number of (Picked player))] = (temppoint[(Player number of (Picked player))] offset by movespeed[(Player number of (Picked player))] towards (Facing of Hero[(Player number of (Picked player))]) degrees)
              • Animation - Play Hero[(Player number of (Picked player))]'s walk animation
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • movingdown[(Player number of (Picked player))] Equal to True
            • Then - Actions
              • Set temppoint1[(Player number of (Picked player))] = (temppoint[(Player number of (Picked player))] offset by movespeed[(Player number of (Picked player))] towards ((Facing of Hero[(Player number of (Picked player))]) + 180.00) degrees)
              • Animation - Play Hero[(Player number of (Picked player))]'s walk animation
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • strafe Equal to False
              • moveingleft[(Player number of (Picked player))] Equal to True
            • Then - Actions
              • Unit - Make Hero[(Player number of (Owner of (Picked unit)))] face ((Facing of Hero[(Player number of (Picked player))]) + 10.00) over 0.00 seconds
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • strafe Equal to False
              • movingright[(Player number of (Picked player))] Equal to True
            • Then - Actions
              • Unit - Make Hero[(Player number of (Owner of (Picked unit)))] face ((Facing of Hero[(Player number of (Picked player))]) - 10.00) over 0.00 seconds
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • strafe Equal to True
              • movingright[(Player number of (Picked player))] Equal to True
            • Then - Actions
              • Set temppoint1[(Player number of (Picked player))] = (temppoint[(Player number of (Picked player))] offset by movespeed[(Player number of (Picked player))] towards ((Facing of Hero[(Player number of (Picked player))]) - 90.00) degrees)
              • Animation - Play Hero[(Player number of (Picked player))]'s walk animation
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • strafe Equal to True
              • moveingleft[(Player number of (Picked player))] Equal to True
            • Then - Actions
              • Set temppoint1[(Player number of (Picked player))] = (temppoint[(Player number of (Picked player))] offset by movespeed[(Player number of (Picked player))] towards ((Facing of Hero[(Player number of (Picked player))]) + 90.00) degrees)
              • Animation - Play Hero[(Player number of (Picked player))]'s walk animation
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • strafe Equal to True
              • moveingleft[(Player number of (Picked player))] Equal to True
              • movingup[(Player number of (Picked player))] Equal to True
            • Then - Actions
              • Set temppoint1[(Player number of (Picked player))] = (temppoint[(Player number of (Picked player))] offset by movespeed[(Player number of (Picked player))] towards ((Facing of Hero[(Player number of (Picked player))]) + 45.00) degrees)
              • Animation - Play Hero[(Player number of (Picked player))]'s walk animation
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • strafe Equal to True
              • movingright[(Player number of (Picked player))] Equal to True
              • movingup[(Player number of (Picked player))] Equal to True
            • Then - Actions
              • Set temppoint1[(Player number of (Picked player))] = (temppoint[(Player number of (Picked player))] offset by movespeed[(Player number of (Picked player))] towards ((Facing of Hero[(Player number of (Picked player))]) - 45.00) degrees)
              • Animation - Play Hero[(Player number of (Picked player))]'s walk animation
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • strafe Equal to True
                  • moveingleft[(Player number of (Picked player))] Equal to True
                  • movingdown[(Player number of (Picked player))] Equal to True
                • Then - Actions
                  • Set temppoint1[(Player number of (Picked player))] = (temppoint[(Player number of (Picked player))] offset by movespeed[(Player number of (Picked player))] towards ((Facing of Hero[(Player number of (Picked player))]) + 135.00) degrees)
                  • Animation - Play Hero[(Player number of (Picked player))]'s walk animation
                • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • strafe Equal to True
              • movingright[(Player number of (Picked player))] Equal to True
              • movingdown[(Player number of (Picked player))] Equal to True
            • Then - Actions
              • Set temppoint1[(Player number of (Picked player))] = (temppoint[(Player number of (Picked player))] offset by movespeed[(Player number of (Picked player))] towards ((Facing of Hero[(Player number of (Picked player))]) - 135.00) degrees)
              • Animation - Play Hero[(Player number of (Picked player))]'s walk animation
            • Else - Actions
          • Unit - Move Hero[(Player number of (Picked player))] instantly to temppoint1[(Player number of (Picked player))]
          • Custom script: call RemoveLocation(udg_temppoint[(GetConvertedPlayerId(GetEnumPlayer()))])
          • Custom script: call RemoveLocation(udg_temppoint1[(GetConvertedPlayerId(GetEnumPlayer()))])
 
Status
Not open for further replies.
Top