[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4787: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4789: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4790: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4791: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
InsideQC Forums • View topic - CSQC_InputEvent - event pressed not loopable?

CSQC_InputEvent - event pressed not loopable?

Discuss CSQC related programming.

Moderator: InsideQC Admins

CSQC_InputEvent - event pressed not loopable?

Postby toneddu2000 » Sat Dec 27, 2014 12:12 pm

- my first commercial game, made with FTEQW game engine
toneddu2000
 
Posts: 1395
Joined: Tue Feb 24, 2009 4:39 pm
Location: Italy

Re: CSQC_InputEvent - event pressed not loopable?

Postby Spike » Sat Dec 27, 2014 1:40 pm

mouse do not auto-repeat.
keyboard buttons auto-repeat at an operating-system-defined rate, or not at all if the engine disabled autorepeat for some reason. auto-repeat repeats at the same rate as in the console or in notepad. key bindings will not fire from auto-repeated keys, which is one of many reasons why you should still use the engine's key binding system instead of enforcing your own vision of keys on people.
do not depend upon keyboard auto-repeat for anything other than text entry - failure to stick to this rule means that people can just go into their windows/etc keyboard settings and just crank up their key repeat rate to make things super spammy.

it could be replicated if you implement a timer in your own code. either in the csqc, or in the ssqc. preferably the ssqc, which will help smooth intervals between firing - just as the vanilla ssqc does with button0.
.
Spike
 
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Re: CSQC_InputEvent - event pressed not loopable?

Postby toneddu2000 » Sat Dec 27, 2014 3:03 pm

- my first commercial game, made with FTEQW game engine
toneddu2000
 
Posts: 1395
Joined: Tue Feb 24, 2009 4:39 pm
Location: Italy

Re: CSQC_InputEvent - event pressed not loopable?

Postby Spike » Sat Dec 27, 2014 3:42 pm

.
Spike
 
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Re: CSQC_InputEvent - event pressed not loopable?

Postby toneddu2000 » Sat Dec 27, 2014 5:43 pm

- my first commercial game, made with FTEQW game engine
toneddu2000
 
Posts: 1395
Joined: Tue Feb 24, 2009 4:39 pm
Location: Italy

Re: CSQC_InputEvent - event pressed not loopable?

Postby Spike » Sat Dec 27, 2014 6:36 pm

attack_finished _IS_ a timer for input.
after it triggers, another input is accepted. how is that not input related? :P

people use ssqc for things because its the authoritive version of the game state. you can have lots of different instances of the game running in lots of 100% independant csqc modules, sure... but that's really not a multiplayer game. that's just a load of different people all playing the same game independantly.
there's not really any reason you can't reduce weapon impacts to that of a single timer (per attack), but do do so you would have to decide in advance whether and when it was going to hit or latency will just destroy everything. of course, in such a case, hits would likely need to be able to home in on the receiving client and stuff. I don't think that sort of thing would have a good feel to it though. such things are good in mmo-style games though, where latency and bandwidth use can spike when things get crowded.
.
Spike
 
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Re: CSQC_InputEvent - event pressed not loopable?

Postby gnounc » Sat Dec 27, 2014 10:53 pm

my
gnounc's
User avatar
gnounc
 
Posts: 424
Joined: Mon Apr 06, 2009 6:26 am

Re: CSQC_InputEvent - event pressed not loopable?

Postby toneddu2000 » Sat Dec 27, 2014 11:17 pm

- my first commercial game, made with FTEQW game engine
toneddu2000
 
Posts: 1395
Joined: Tue Feb 24, 2009 4:39 pm
Location: Italy

Re: CSQC_InputEvent - event pressed not loopable?

Postby gnounc » Sat Dec 27, 2014 11:35 pm

my
gnounc's
User avatar
gnounc
 
Posts: 424
Joined: Mon Apr 06, 2009 6:26 am

Re: CSQC_InputEvent - event pressed not loopable?

Postby toneddu2000 » Sat Dec 27, 2014 11:42 pm

ah ok thanks gnounc, understood now. I guess that, if I want to replicate this kind of behaviour I'd do a check through InputFrame to control if button is released or it's still pressed, but always triggered by CSQC_InputEvent. I don't know if it's bandwith-killer but I'll do some tests
Thanks again
- my first commercial game, made with FTEQW game engine
toneddu2000
 
Posts: 1395
Joined: Tue Feb 24, 2009 4:39 pm
Location: Italy

Re: CSQC_InputEvent - event pressed not loopable?

Postby gnounc » Sun Dec 28, 2014 12:59 am

What I did, was set a flag when the left mouse button is held, (in csqc_input_event, if event is keydown, if key is mouse1)
and unset that flag when the left mouse button is released.

THEN in a function that is called every frame, like at the bottom of CSQC_UpdateView(), check that flag, and check the time since it was last pressed.
my
gnounc's
User avatar
gnounc
 
Posts: 424
Joined: Mon Apr 06, 2009 6:26 am

Re: CSQC_InputEvent - event pressed not loopable?

Postby Spike » Sun Dec 28, 2014 2:12 am

.
Spike
 
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Re: CSQC_InputEvent - event pressed not loopable?

Postby toneddu2000 » Sun Dec 28, 2014 2:38 pm

- my first commercial game, made with FTEQW game engine
toneddu2000
 
Posts: 1395
Joined: Tue Feb 24, 2009 4:39 pm
Location: Italy


Return to CSQC Programming

Who is online

Users browsing this forum: No registered users and 1 guest