Inside3D!
     

SwimUp as the 'Use' key

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



Joined: 17 Feb 2009
Posts: 26

PostPosted: Tue May 05, 2009 3:42 pm    Post subject: SwimUp as the 'Use' key Reply with quote

Hi,
I want to create a 'use' key for buttons (like the spacebar in Duke3D, or 'E' in Half-Life) replacing the Quake's 'Swim Up' key but I don't know where to start. I've looked through the code in client.qc but couldnt find anything helpful.

Thx in advance for any hints.
Back to top
View user's profile Send private message
Spike



Joined: 05 Nov 2004
Posts: 944
Location: UK

PostPosted: Tue May 05, 2009 4:10 pm    Post subject: Reply with quote

If you're using DP or FTE you can check the sign of self.movement_z (after defining .vector movement;)

But really, why replace?

Do this:

stuffcmd(player, "alias +use \"impulse 34\"\n");
stuffcmd(player, "alias -use \"impulse 35\"\n");

Add code to handle impulse 34 and 35. And there you have a use button.
_________________
What's a signature?
Back to top
View user's profile Send private message Visit poster's website
catalyst



Joined: 17 Feb 2009
Posts: 26

PostPosted: Tue May 05, 2009 6:48 pm    Post subject: Reply with quote

Spike wrote:

But really, why replace?


I wanted the player to be able to set it up in the game's config menu.
Back to top
View user's profile Send private message
MauveBib



Joined: 04 Nov 2004
Posts: 602

PostPosted: Tue May 05, 2009 9:47 pm    Post subject: Reply with quote

catalyst wrote:
Spike wrote:

But really, why replace?


I wanted the player to be able to set it up in the game's config menu.


The menu would still say "swim up" regardless of what the QC did, so that's not really that viable anyway. Plus, direct key access is difficult in QC for anything other than firing and jumping.

Definately better to go with the alias, or a +button if using DP or similar.
_________________
Apathy Now!
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