No announcement yet.

How do I trigger functions based on movement keys?

  • Filter
  • Time
  • Show
Clear All
new posts

    How do I trigger functions based on movement keys?

    Another GunShip-related question: How do I test if the Left, Right, Back, and Forward keys are pressed? I would like to trigger different animations based on which one is pressed.

    I've followed the class chain all the way up to Engine/Actor.uc but don't want to mess with anything there for fear of damaging something serious.

    All I need is a simple if/then that tells me those keys are pressed - not movement speed, not acceleration. Just simple key presses.

    Looking around on the web, I was able to find the "keydown" and "keyup" functions.

    However, what value do I test for?


      Look at Engine.PlayerInput, spawned in the PlayerController class. All input is parsed there.


        I would say make an Interaction class, and parse the key input there.

        This would work very well for what you're doing.


          I belive the variables you are looking for are called:


          All go from -1, 0, 1

          -1 being left, down and back
          1 being right, up and forward

          These should be available in ONSvehicle classes as well as the sublcasses.

          Now, if you are looking for more than that, such as, if they press it twice.... Then I cant help you there, try asking Mr. Slate.


          Wp, good luck with the new vehilces, they sound awesome. Also, if you are looking for another creative idea, I got one, but I dont think I will have the time to work on it.


            You shouldn't have any fear of damaging something -- if you're modifying the game's original .uc files you are completely barking up the wrong tree. Just an in case warning


              Aside from the interaction approach (prob overkill), the rise, steering, throttle (should be the best solution), you cuold also use RawInput.


                Sorry for the late reply guys. I was out of town for a couple of days.

                Cman - thanks! I'll try those variables on for size, see if I can get something working. Let me know about that vehicle idea you had - just e-mail me at: mark *at**

                GuruKnight, mrslatezb - I'll look into that. Never heard of interaction classes. Thanks!

                you are completely barking up the wrong tree
                lol - I'm really not too clever with Uscript yet, so looking and poking around helps me see what there is to work with.