View previous topic :: View next topic |
Author |
Message |
Niit
Joined: 16 Mar 2009 Posts: 4 Location: Brazil
|
Posted: Wed Mar 18, 2009 12:24 am Post subject: Binds and commands, how i do? |
|
|
Hello,
I would like to know if there is any way to bind a key for qc.
And also how to create a command and not by impulses (like the +hook in CTF).
Thank you,
Niit
PS: Sorry for the bad english, I'm from Brazil |
|
Back to top |
|
 |
Spike
Joined: 05 Nov 2004 Posts: 944 Location: UK
|
Posted: Wed Mar 18, 2009 1:26 am Post subject: |
|
|
binding a key in qc... stuffcmd(player, "bind uparrow +forward\n");
of course, that's hideous. you can't tell if they have that key bound or not, or if they have something else to do +forward, or anything like that so please don't do that.
creating +hook for instance:
stuffcmd(player, "alias +hook \"impulse 100\"\n");
stuffcmd(player, "alias -hook \"impulse 101\"\n");
then get the user to bind some key to do +hook and when they press it you'll receive impulse 100 followed by 101 when they release it again.
krimzon_sv_parseclientcommand allows you to use string commands instead of impulses, which are more reliable but mneh, impulses ftw. _________________ What's a signature? |
|
Back to top |
|
 |
scar3crow Inside3D Staff

Joined: 18 Jan 2005 Posts: 837 Location: Las Vegas, NV
|
Posted: Wed Mar 18, 2009 1:33 am Post subject: |
|
|
Couldn't you also in theory do it from an autoexec.cfg included with the mod? Just the aliases of course, don't force binds on anyone, that's evil... _________________ ...and all around me was the chaos of battle and the reek of running blood.... and for the first time in my life I knew true happiness. |
|
Back to top |
|
 |
Spike
Joined: 05 Nov 2004 Posts: 944 Location: UK
|
Posted: Wed Mar 18, 2009 1:46 am Post subject: |
|
|
yeah, you could do the aliases via a mod-specific default.cfg
Its generally considered bad karma to put +hook aliases in autoexec.cfg and certainly binds shouldn't go in there, binds really ought to go in default.cfg
autoexec.cfg is expected to be for the user to modify, and overrides all. config.cfg is the previous settings (delete for defaults), and default.cfg is... the defaults.
course, if this is a quakeworld mod then chances are the user won't download any of that stuff anyway, so won't benefit from any of it so the only option is to stuffcmd those aliases.
Really it depends if your mod is server-only(or download-off-server) or if they really do need to download a full mod off some website before they can connect to that server. _________________ What's a signature? |
|
Back to top |
|
 |
Niit
Joined: 16 Mar 2009 Posts: 4 Location: Brazil
|
Posted: Sun Mar 22, 2009 6:07 pm Post subject: |
|
|
Thank you,
I just creating a SINGLE PLAYER mod.
I go to use the autoexec.cfg to the aliases.
Niit |
|
Back to top |
|
 |
|