Forum

SwimUp as the 'Use' key

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

SwimUp as the 'Use' key

Postby catalyst » Tue May 05, 2009 3:42 pm

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.
catalyst
 
Posts: 26
Joined: Tue Feb 17, 2009 12:06 pm

Postby Spike » Tue May 05, 2009 4:10 pm

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.
Spike
 
Posts: 2892
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Postby catalyst » Tue May 05, 2009 6:48 pm

Spike wrote:But really, why replace?


I wanted the player to be able to set it up in the game's config menu.
catalyst
 
Posts: 26
Joined: Tue Feb 17, 2009 12:06 pm

Postby MauveBib » Tue May 05, 2009 9:47 pm

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!
User avatar
MauveBib
 
Posts: 634
Joined: Thu Nov 04, 2004 1:22 am


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest