Multi-Imput Impulse Toggle
Moderator: InsideQC Admins
9 posts
• Page 1 of 1
Multi-Imput Impulse Toggle
I was wondering if it's possible to...
Make it so my "W" key (walk forward) also could toggle an Impulse depending on weather or not the key is pressed down.
So, you enter the game, and you walk forward by holding "W" this will turn on impulse20, you run down a hallway and stop by letting up the "W" key, this will turn off impulse20...
Perhaps I am going about this wrong. Maybe there is a way to have the game read that you are moving and to have impulse20 activated; not moving - deactivate?
If anyone can help please be specific for I am still getting a handle on the workings of quakeC.
Make it so my "W" key (walk forward) also could toggle an Impulse depending on weather or not the key is pressed down.
So, you enter the game, and you walk forward by holding "W" this will turn on impulse20, you run down a hallway and stop by letting up the "W" key, this will turn off impulse20...
Perhaps I am going about this wrong. Maybe there is a way to have the game read that you are moving and to have impulse20 activated; not moving - deactivate?
If anyone can help please be specific for I am still getting a handle on the workings of quakeC.
Knives out. Catch the mouse. Squash his head. Put him in your mouth.
- Blackstar1000
- Posts: 52
- Joined: Mon Sep 13, 2010 5:16 pm
Re: Multi-Imput Impulse Toggle
Blackstar1000 wrote:I was wondering if it's possible to...
Make it so my "W" key (walk forward) also could toggle an Impulse depending on weather or not the key is pressed down.
So, you enter the game, and you walk forward by holding "W" this will turn on impulse20, you run down a hallway and stop by letting up the "W" key, this will turn off impulse20...
Perhaps I am going about this wrong. Maybe there is a way to have the game read that you are moving and to have impulse20 activated; not moving - deactivate?
If anyone can help please be specific for I am still getting a handle on the workings of quakeC.
Why not make an alias..?
bind w +walk_forward
alias +walk_forward "+forward; impulse 20"
alias -walk_forward "-forward; impulse 20"
- apolluwn
- Posts: 35
- Joined: Tue Apr 26, 2011 11:57 pm
What exactly are you trying to accomplish ?
AFAIK QuakeC can handle only one impulse per game frame, so using this approach would left you without a way to process other impulses (although this may not be an issue at all if you don't intend to use other impulse commands).
A simpler way to do something while the player is walking/running would be to call your code from the end of player_run () (in player.qc).
AFAIK QuakeC can handle only one impulse per game frame, so using this approach would left you without a way to process other impulses (although this may not be an issue at all if you don't intend to use other impulse commands).
A simpler way to do something while the player is walking/running would be to call your code from the end of player_run () (in player.qc).
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC
(LordHavoc)
-

frag.machine - Posts: 2090
- Joined: Sat Nov 25, 2006 1:49 pm
frag.machine wrote:...
using this approach would left you without a way to process other impulses
...
Just FYI... This is incorrect.
While you are pressing the key bound to +walk_forward it will only run the impulse command a single time... When it is released (-walk_forward) it will run impulse 20 again...
This won't keep you from running other impulse commands...
- apolluwn
- Posts: 35
- Joined: Tue Apr 26, 2011 11:57 pm
apolluwn wrote:frag.machine wrote:...
using this approach would left you without a way to process other impulses
...
Just FYI... This is incorrect.
While you are pressing the key bound to +walk_forward it will only run the impulse command a single time... When it is released (-walk_forward) it will run impulse 20 again...
This won't keep you from running other impulse commands...
Then, I stand corrected.
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC
(LordHavoc)
-

frag.machine - Posts: 2090
- Joined: Sat Nov 25, 2006 1:49 pm
if you trigger two impulses within one frame, only one will be sent and the other will be forgotten, so you will loose impulses if you merely hit them too fast. you can also loose them from client->server packet loss.
- Spike
- Posts: 2892
- Joined: Fri Nov 05, 2004 3:12 am
- Location: UK
Re: Multi-Imput Impulse Toggle
Thank you for the replies. If I told you what I was trying to accomplish it may not make much sense for my project is manipulating Quake far from its original form.
- Blackstar1000
- Posts: 52
- Joined: Mon Sep 13, 2010 5:16 pm
Re: Multi-Imput Impulse Toggle
Yup, worked like a damn charm. I have turned quakes camera into something that operates exactly like the camera in Mass Effect. Of if anyone remembers the game Anachronox.

- Blackstar1000
- Posts: 52
- Joined: Mon Sep 13, 2010 5:16 pm
Re:
Spike wrote:if you trigger two impulses within one frame, only one will be sent and the other will be forgotten, so you will loose impulses if you merely hit them too fast. you can also loose them from client->server packet loss.
Yeah, that's what I was trying to say. Thanks for pointing it out Spike.
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC
(LordHavoc)
-

frag.machine - Posts: 2090
- Joined: Sat Nov 25, 2006 1:49 pm
9 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest