[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/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 - Walking and Running for player

Walking and Running for player

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Walking and Running for player

Postby jim » Fri Sep 21, 2007 3:52 am

zbang!
User avatar
jim
 
Posts: 599
Joined: Fri Aug 05, 2005 2:35 pm
Location: In The Sun

Postby Sajt » Fri Sep 21, 2007 5:56 am

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.
Sajt
 
Posts: 1215
Joined: Sat Oct 16, 2004 3:39 am

Postby jim » Fri Sep 21, 2007 1:37 pm

zbang!
User avatar
jim
 
Posts: 599
Joined: Fri Aug 05, 2005 2:35 pm
Location: In The Sun

Postby Urre » Fri Sep 21, 2007 1:57 pm

I was once a Quake modder
User avatar
Urre
 
Posts: 1109
Joined: Fri Nov 05, 2004 2:36 am
Location: Moon

Postby jim » Fri Sep 21, 2007 4:44 pm

I've looked into that sv_user.qc and I'm a bit unsure what it does. Does it override some other functions in other qc files? I'm seeing some stuff in some functions that are probably doing something same like the SV_PlayerPhysics. Yesterday I made some improved falling damage, but I didn't do it into that SV_PlayerPhysics function... but it works, but I think the falling damage will not just happen for players and I think it won't be just falling damage. I think people would get hurt if they were thrown hard into the ceiling or walls too.

Well... I'm quite used to hacking stuff in. With my old mod for Doomsday I managed to hack support for (nearly) unlimited amounts of weapons, while it actually supported only 10 weapons.. adding 11th weapon would make the game program suddenly quit after some initializing. Then later I noticed my weapon support hack was rather useless, since I had only modelled 13 weapons and never modelled more for it...

Anyway that SV_PlayerPhysics function looks complicated to me. Can I use it to change player move speed? I think I want player walk and run much slower.. current walk speed looks allright for running animation. And when I get some crouching done, it should be slower than walking and speed key shouldn't speed up crouch moving at all... I'll wonder about crouching later when I have crouching animations...

Right now I just have these:
Last edited by jim on Sun Sep 23, 2007 7:50 pm, edited 1 time in total.
zbang!
User avatar
jim
 
Posts: 599
Joined: Fri Aug 05, 2005 2:35 pm
Location: In The Sun

Postby Sajt » Fri Sep 21, 2007 11:21 pm

The velocity checking crashing is probably a bug in some of your other code.


As for .movement, remember that .movement is set using the client's movement speed cvars. So if the client has cl_forwardspeed set to 200, and they move forward, .movement will be set to '200 0 0'. But if they have cl_forwardspeed set to 100, it will be set to '100 0 0'.

You can put your own values for the cl_*speed cvars in a config file, or stuffcmd them from QuakeC. Then set sv_maxspeed so that player's can't cheat by setting their speed to high. For example:

stuffcmd:
cl_forwardspeed 150
cl_sidespeed 150
cl_backspeed 150
cl_upspeed 150
cl_movespeedkey to 2 (this is how much their speed is multiplied when holding down +speed)

Then set the server sv_maxspeed to 300.

Now if a client tries to cheat by setting cl_forwardspeed to 999, they still will only be able to go 300, and they will have lost the ability to walk so they'll be noisy and fatigued all the time.

Note that the client may send smaller values if they have an analog controller. Analog controllers are tough because there is no hard line between running and walking, but fortunately nobody plays Quake with a joystick.

As for detecting whether they are running or walking, check the .movement vector and compare it with the expected values of the cl_*speed cvars (I say 'expected' because the server can't know what the client has actually set them to).
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.
Sajt
 
Posts: 1215
Joined: Sat Oct 16, 2004 3:39 am


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 3 guests