Jump to content

Home

button pushes register multiple times - preventable?


Vruki Salet

Recommended Posts

I have a setup where i want the game to register a series of button press combinations. For example I want to know if a player presses the fire button then if he presses the fire button or the alt-fire button right afterwards. Unfortunately when the first button is pressed (attack buttons at least) the game registers a pressing multiple times. The number of times it says it's pushed varies, usually about 3 to 6. This is interfering with determining the real sequence of player button pushes. How might I fix this?

 

BTW this code deals with four button's we'll call A,B,C & D and I'm trying to put this code in the function PM_SaberAttackForMovement in bg_saber.c.

 

(Sorry if I wasn't very clear.)

Link to comment
Share on other sites

From what I've seen of the Q3 engine, it is set up as 'at least' (so if the button was pushed at all it registers, even if it's not down anymore.), because several parts of the game have a need to know what button is pushed.

 

I don't think you're going to get completely accurate results without engine access, which you don't have for JKA. If there's a way to tell when a button was pushed and let up, you can just ignore the multiple registerings and hold out for the button to be in the up position, then expect the next button.

Link to comment
Share on other sites

You could make a struct that contains all players button commands and have it keep track of the status for you. That way you could make a really simple function to determine a button combo. I really don't know how great it would work, in practice, because I haven't done it, but user commands and buttons are sent to the server, so it should be technically possible.

Link to comment
Share on other sites

Lately I've moved away from the button combo idea. I went to 2-button combos that work fine but they were too hard to remember and too clumsy for ppl with old creaky fingers (like me) to perform as fast as necessary for my purposes.

 

I'm going single-button whenever possible.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...