Inside3D!
     

Console commands via localcmd overriding key presses.

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



Joined: 16 Dec 2004
Posts: 22

PostPosted: Sun Jan 09, 2005 12:55 am    Post subject: Console commands via localcmd overriding key presses. Reply with quote

i've got a powerup. i wanted the screen to be tinted a certain colour when the player has the powerup, so i used localcmd to send the console command "v_cshift x x x x" to the console to change colour.

this work fine, but sometimes, if you press (or release) a key at close to the same time as the console command is sent, quake will not receive the key press, so if you let go of, say, the forward key, quake might not get the "-forward" command, and keep moving you forward forever until you press the key again.

is there any way around this?
i never noticed this problem with stuffcmd when it sends "bf" to the console to flash the screen when you pick up items.
Back to top
View user's profile Send private message
Sajt



Joined: 16 Oct 2004
Posts: 1026

PostPosted: Sun Jan 09, 2005 1:36 am    Post subject: Reply with quote

Well, at least don't use localcmd ! ... that sends the message to the server only. So only the host would get it (if there even is a host). Use stuffcmd
Back to top
View user's profile Send private message
necros



Joined: 16 Dec 2004
Posts: 22

PostPosted: Sun Jan 09, 2005 3:21 am    Post subject: Reply with quote

well, it doesn't really matter at this point since it's all SP, and there is no server/client relation.
Back to top
View user's profile Send private message
Sajt



Joined: 16 Oct 2004
Posts: 1026

PostPosted: Sun Jan 09, 2005 5:26 am    Post subject: Reply with quote

You still should... honestly Smile
_________________
F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe.
Back to top
View user's profile Send private message
Wazat



Joined: 15 Oct 2004
Posts: 732
Location: Middle 'o the desert, USA

PostPosted: Sun Jan 09, 2005 5:27 am    Post subject: Reply with quote

I imagine using localcmd is the problem, since it's sent through the server and may conflict with or override the other console commands (like -forward). Stuffcmd seems to work fine for "bf", so try it.

Otherwise I don't know what would cause that. Sad
_________________
When my computer inevitably explodes and kills me, my cat inherits everything I own. He may be the only one capable of continuing my work.
Back to top
View user's profile Send private message MSN Messenger
necros



Joined: 16 Dec 2004
Posts: 22

PostPosted: Sun Jan 09, 2005 11:39 pm    Post subject: ok Reply with quote

well, i'll try it with stuffcmd. i'm pretty sure it still causes trouble with that one instead of localcmd, but we'll see. thanks for the suggestion.

also, beyond this problem, what real reason is there to use stuffcmd besides localcmd except for the aforementioned server only reason?
Back to top
View user's profile Send private message
MauveBib



Joined: 04 Nov 2004
Posts: 602

PostPosted: Mon Jan 10, 2005 1:50 am    Post subject: Reply with quote

The main reason to use stuffcmd is that the task you are doing is best performed with it Smile

localcmd is simply not designed for what you are trying to achieve. It only sends to the server, and even then it has problems, i.e. the problems which caused you to post this thread in the first place :p

Stuffcmd sends the message to be executed by the specified client, and should not interfere with keypresses. I'm 90% certain that using stuffcmd will solve your problem, and that's the reason to use it Smile

smiley overload.... ~( 8^J)
Back to top
View user's profile Send private message
Wazat



Joined: 15 Oct 2004
Posts: 732
Location: Middle 'o the desert, USA

PostPosted: Mon Jan 10, 2005 2:23 am    Post subject: Reply with quote

For single-player purposes, the difference is what code processes the command and when. Stuffcmd is generally safer in all aspects.
_________________
When my computer inevitably explodes and kills me, my cat inherits everything I own. He may be the only one capable of continuing my work.
Back to top
View user's profile Send private message MSN Messenger
Tei



Joined: 25 Oct 2004
Posts: 195

PostPosted: Mon Jan 10, 2005 9:43 am    Post subject: Re: Console commands via localcmd overriding key presses. Reply with quote

try adding \n after commands
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