x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

How can I set up Action Mapping for Simultaneous Button Presses?

How would you go about Action Mapping simultaneous button presses for the Gamepad? For example How would you map the following command:

"Hold Left Stick Right and Press Gamepad FaceButton Right to execute..."

Product Version: Not Selected
Tags:
more ▼

asked May 31 '14 at 07:49 PM in C++ Programming

avatar image

firstplayer
6 3 5 8

(comments are locked)
10|2000 characters needed characters left

2 answers: sort voted first

While Dartanilla's suggestion will work, you will quickly find that players aren't robots, and controllers have physical lag, and the sticks and buttons won't time to activate at exactly the same time even though the player intends it.

If you want to build, say, a fighter game, where the controls feel right, you will have to build a pretty complex state machine. That state machine is best built by having all the different input commands just forward a "state change" to the state machine, and have the state machine drive the synthesis of player intent. You will then have to introduce delays for each button if you want to support combos. Thus, pressing A might set a timer for 50 milliseconds to perform action A, but if you get button B within that interval, you do action AB. Same thing for button B; set a timer, if you get A within that window, do action AB.

In the end, game design has to also come into it. It's easier to support combo buttons if one is an automatic extension of the other. Then you can start playing the wind-up animations right at button press, but if the modified is added within the timing window, you then modify the actual action. Thus, if A is punch, and B is block, and AB is down-punch, then your state machine would start playing a punch or block wind-up at A or B, but if it got the other button within the timing window, it would transition to the down-punch animation (partway in) and change what the actual action will be.

Hope this helps!

more ▼

answered Jun 02 '14 at 03:44 PM

avatar image

jwatte
1.2k 48 38 87

(comments are locked)
10|2000 characters needed characters left

Create an action mapping for "Gamepad FaceButton Right" and then have an IF statement that checks to see if the Left Stick is held to the right when the button is pressed. Put whatever you want this action mapping to do inside the IF statement. Basically, you are checking that the "Gamepad FaceButton Right" is pressed AND that the Left Stick is held to the right. You can also have multiple IF's inside the action to check for other conditions such as the Left Stick held to the left or up or down or anything else you want to check in combination with the "Gamepad FaceButton Right" being pressed. Using this method you can create any combination you can imagine.

more ▼

answered May 31 '14 at 10:22 PM

avatar image

Dartanlla
2.6k 61 26 281

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question