[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/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 - restricting range for looking up / down?

restricting range for looking up / down?

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

restricting range for looking up / down?

Postby drm_wayne » Thu Apr 18, 2013 3:10 pm

hey,

i recently created a 3rd person chasecam, but i need to know how i can restrict the player too look up / down so you cant look
inside the model and directly to the ceiling /floor...

How can i do that?
User avatar
drm_wayne
 
Posts: 232
Joined: Sat Feb 11, 2012 5:47 pm

Re: restricting range for looking up / down?

Postby frag.machine » Thu Apr 18, 2013 4:23 pm

It depends. Are you using chase_active = 1 or did you implement a chasecam entity ?
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC :) (LordHavoc)
User avatar
frag.machine
 
Posts: 2120
Joined: Sat Nov 25, 2006 1:49 pm

Re: restricting range for looking up / down?

Postby drm_wayne » Thu Apr 18, 2013 5:05 pm

its based on the enders scratch qc chasecam from the tutorials section :)
its the only one who works good for me.

I want basicially make a chasecam like in the newer Resident Evil games.
User avatar
drm_wayne
 
Posts: 232
Joined: Sat Feb 11, 2012 5:47 pm

Re: restricting range for looking up / down?

Postby Spike » Thu Apr 18, 2013 9:03 pm

most chasecam games seem to just make the player transparent if the camera comes too close.
In which case, check the distance and update the player's .alpha value when you move the camera.
doing it inside customizeentityforclient is a better choice if you want multiplayer to work, of course, but this is an extension which might not be available to you. do it in both placeas, and it'll work in multiplayer in engines that support the extension, without crashing engines that don't - it'll just look goofy in those, but hey, at least singleplayer will work okay!

you'll also need to ensure that the camera does not get within the near-clip-distance of walls. this is typically 4qu. sadly there is no mechanism that allows you to traceline with that precision however.
DP_QC_GETSURFACE can be used to find if there's a wall nearby, but its a real pain when doors etc are involved, it is possible though.

if you just want to clamp the player's view pitch range, cl_minpitch or cl_maxpitch work for some engines, or pq_minpitch/pq_maxpitch in proquake, or "serverinfo minpitch -30" for most quakeworld clients (where extened pitch ranges are considered a cheat).
because things would be boring if there was only one standard.

or you can use svc_setangles to force the angle to some other value. this sucks though. you can change the user's m_pitch cvar to 0, which will prevent the user from being able to change pitch angle with the mouse, which means you won't end up having to spam it endlessly, which can only be a good thing.
.
Spike
 
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Re: restricting range for looking up / down?

Postby drm_wayne » Fri Apr 19, 2013 11:57 am

thanks, cl_minpitch and cl_maxpitch does the job...
And yeah, its currently only for a small singleplayer test, it currently feels like the 3rd person view
from fallout3..

I wonder why nobody did a good 3rd person cam already for quake xD
User avatar
drm_wayne
 
Posts: 232
Joined: Sat Feb 11, 2012 5:47 pm

Re: restricting range for looking up / down?

Postby mankrip » Fri Apr 19, 2013 2:02 pm

Ph'nglui mglw'nafh mankrip Hell's end wgah'nagl fhtagn.
==-=-=-=-=-=-=-=-=-=-==
/ /
User avatar
mankrip
 
Posts: 915
Joined: Fri Jul 04, 2008 3:02 am

Re: restricting range for looking up / down?

Postby drm_wayne » Fri Apr 19, 2013 4:06 pm

User avatar
drm_wayne
 
Posts: 232
Joined: Sat Feb 11, 2012 5:47 pm

Re: restricting range for looking up / down?

Postby r00k » Fri Apr 19, 2013 4:46 pm

r00k
 
Posts: 1111
Joined: Sat Nov 13, 2004 10:39 pm

Re: restricting range for looking up / down?

Postby drm_wayne » Sun Apr 21, 2013 4:23 pm

The other problem with the cam is you can see thru walls....
I wonder if it can be fixed with a traceline code stopping the cam go thru walls??

Its this:
User avatar
drm_wayne
 
Posts: 232
Joined: Sat Feb 11, 2012 5:47 pm

Re: restricting range for looking up / down?

Postby r00k » Mon Apr 22, 2013 3:47 pm

my code above is 99% accurate in the manner of blocking the camera against walls.
it also kind of acts like a tethered balloon by lagging behind the player based on a fixed velocity.
Yet will move faster towards the player, the further away, or comlpetely reset to the base (back 100, up 32) if the
camera can not see the player at all.
r00k
 
Posts: 1111
Joined: Sat Nov 13, 2004 10:39 pm

Re: restricting range for looking up / down?

Postby drm_wayne » Tue Apr 23, 2013 3:37 pm

i wonder, when i save and load a game the chasecam is gone??

EDIT: Nevermind, its still there, it just seems to "spawn" later lol :P
User avatar
drm_wayne
 
Posts: 232
Joined: Sat Feb 11, 2012 5:47 pm


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest