Inside3D!
     

Binds and commands, how i do?

 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming
View previous topic :: View next topic  
Author Message
Niit



Joined: 16 Mar 2009
Posts: 4
Location: Brazil

PostPosted: Wed Mar 18, 2009 12:24 am    Post subject: Binds and commands, how i do? Reply with quote

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
View user's profile Send private message
Spike



Joined: 05 Nov 2004
Posts: 944
Location: UK

PostPosted: Wed Mar 18, 2009 1:26 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
scar3crow
Inside3D Staff


Joined: 18 Jan 2005
Posts: 837
Location: Las Vegas, NV

PostPosted: Wed Mar 18, 2009 1:33 am    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
Spike



Joined: 05 Nov 2004
Posts: 944
Location: UK

PostPosted: Wed Mar 18, 2009 1:46 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Niit



Joined: 16 Mar 2009
Posts: 4
Location: Brazil

PostPosted: Sun Mar 22, 2009 6:07 pm    Post subject: Reply with quote

Thank you,

I just creating a SINGLE PLAYER mod.

I go to use the autoexec.cfg to the aliases.

Niit
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2004 phpBB Group