Jump to content

Home

+button12 causing strange problems


Recommended Posts

Hi,

 

Well I've added a similar function to the scoreboard to my mod, but for stats (e.g. total damage, total kills, NET score, etc), and I've done this by using +button12 to call up the 'statsboard', similar to the way +scores does to bring up the scoreboard. But the problem is, when I bind +button12 to a key, some other commands stop working. For example, if I bind +button12 to CTRL, jumping doesn't work, or if I bind +button12 to '3', I can't strafe right.

 

I've seen other mods like JA+ and OJP make use of adding +button12 for extra uses without any preventing other commands from being used so I'm thinking it could be the way I'm showing the 'statsboard' which is causing the problem.

 

Originally I tried simply using a new command like +stats to bring up the stats but that had the same problem, so I turned to using +button12, but I'm the position I was when I started.

 

So any thoughts on fixing this? Thanks in advance :)

Link to post
Share on other sites

Well i haven't made a constant for the button yet because I just wanted to do a quick test and adding something to a header file would mean VS2005 recompiles everything. Changing a source file just recompiles the files ive edited. So I've just done:

if ( cmd.buttons & 4096 )....

Link to post
Share on other sites

Where are you checking for it anyway?

 

Seeing as your doing an extra scoreboard which is client-side, you might as well just do the command in the cg_consolecmds list and do it exactly like the scoreboard instead of wasting a +button.

Link to post
Share on other sites
Where are you checking for it anyway?

In cg_predict.c - dunno if that would be the best place for it though :p

you might as well just do the command in the cg_consolecmds list and do it exactly like the scoreboard instead of wasting a +button.

I tried that originally but I still get the same problem with some commands not working.

Link to post
Share on other sites
In cg_predict.c - dunno if that would be the best place for it though :p

 

I tried that originally but I still get the same problem with some commands not working.

 

You tried what exactly? Are you sure that what you are doing is the best way to do it, and cg_predict.c is bad bad for checking button stuff.

 

Remove all the code you are using for the stuff and see if it still messes up. I have a feeling you have something else breaking it along the lines. Because theres absolutely no way that a command in static consoleCommand_t commands[] = { could make other buttons stop working. I hope you clean often too.

Link to post
Share on other sites

Ok, I've completely removed anything I tried with +button12, and now I've retried incorporating a command similar to the way the scoreboard does it. I used the command +stats, but with the same problems still. One thing I'm thinking it could be is that I've not made my CG_StatsDown_f and CG_StatsUp_f functions static. Could this be causing any problems?

 

edit Ive just realised I might have explained it slightly wrong :s Some keys stop working whilst holding down the button which +button12 or +stats is bound to.

Link to post
Share on other sites
×
×
  • Create New...