Forum

Static camera angles, How i do??

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Static camera angles, How i do??

Postby Nahuel » Wed Jan 12, 2011 9:13 pm

Hello I am new(bie), in inside 3d, But I want create the code for a trigger like the used in the "survival horror maker" from http://chrisjpage.com/?page_id=75 with the darkplaces engine.
Is something like a a function called func_trigger_camera (a bsp invisible and not solid like a normal trigger) with a target for an entity called func_camera.
Maybe the question is stupid but i need your help.
THANKSª
hi, I am nahuel, I love quake and qc.
User avatar
Nahuel
 
Posts: 492
Joined: Wed Jan 12, 2011 8:42 pm
Location: mar del plata

Postby ceriux » Wed Jan 12, 2011 9:15 pm

well basically the way i think you would do it is set up a variable for your camera and when its 0 your camera mode is normal. then have some sort of event fire and turn your camera variable to 1 which would turn your camera mod on. it could be done a lot of ways.
User avatar
ceriux
 
Posts: 2223
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

static camera angles

Postby Nahuel » Wed Jan 12, 2011 9:26 pm

ceriux wrote:well basically the way i think you would do it is set up a variable for your camera and when its 0 your camera mode is normal. then have some sort of event fire and turn your camera variable to 1 which would turn your camera mod on. it could be done a lot of ways.

yes but i do know create cameras, only chasecams :( :(
hi, I am nahuel, I love quake and qc.
User avatar
Nahuel
 
Posts: 492
Joined: Wed Jan 12, 2011 8:42 pm
Location: mar del plata

Re: static camera angles

Postby Nahuel » Wed Jan 12, 2011 9:28 pm

Nahuel wrote:
ceriux wrote:well basically the way i think you would do it is set up a variable for your camera and when its 0 your camera mode is normal. then have some sort of event fire and turn your camera variable to 1 which would turn your camera mod on. it could be done a lot of ways.

yes but i do know create cameras, only chasecams :( :(

Im sorry i want said "I dont know to create cameras" :) :)
hi, I am nahuel, I love quake and qc.
User avatar
Nahuel
 
Posts: 492
Joined: Wed Jan 12, 2011 8:42 pm
Location: mar del plata

Postby ceriux » Wed Jan 12, 2011 10:53 pm

if you just want a chase cam, setup an impulse command and stuff cmd chase_active 1 that will make it toggleable.

if you want it to be permanent i think (this may not be the best/properway) stuffcmd it in playerprethink
User avatar
ceriux
 
Posts: 2223
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Postby Sajt » Thu Jan 13, 2011 12:05 am

Read it over again, he doesn't want a chasecam. He's said that several times. He wants a camera that sits in one spot.

It's been a while for me but it has something to do with SVC_SETVIEW. (This isn't defined in defs.qc, you have to add it. I think it might be 5 or something.) SETVIEW makes the view occur from the position of a different entity (rather than the player entity). Make sure the entity that you set it to has a model (even null.spr or something like that) or it won't get sent over the network and your view will be from the world origin. (This drove me crazy when I was first trying to do this sort of thing.)

Then you use SVC_SETANGLE (or something like that. it's also not defined in defs.qc) to change the camera angles. The angles are compressed badly so if you want the camera to smoothly turn (e.g. look at the player), you're probably out of luck. It will turn pretty jerkily. But if you just have a totally static camera you won't notice it. Anyway, if you don't call SVC_SETANGLE at all, I think what happens is the player can still turn the view with the mouse. So you should set to zero (in autoexec.cfg) all the clientside cvars associated with turning: cl_turnspeed, cl_lookspeed, m_pitch, m_yaw (I think those are what they're called, anyway), then do SVC_SETANGLE.

SVC_SETVIEW and SVC_SETANGLE are used with the MSG_WriteByte etc. functions. You should send them with MSG_ONE. I don't remember the exact arguments, but it's probably something like this:

msg_entity = player; // the player (client) to send this message to
MSG_WriteByte(MSG_ONE, SVC_SETVIEW);
MSG_WriteEntity(MSG_ONE, camera_entity);

MSG_WriteByte(MSG_ONE, SVC_SETANGLE);
MSG_WriteAngle(MSG_ONE, angle_x);
MSG_WriteAngle(MSG_ONE, angle_y);
MSG_WriteAngle(MSG_ONE, angle_z);

(Again, this is off the top of my head. I haven't done anything like this in about eight years.)

You should only have to do this once per camera change, not every frame, unless you want the camera to turn towards the player.

Sorry, Nahuel, this probably won't help you directly. Hopefully somebody can come in who knows about this stuff. I'm sure Spike does.
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 ceriux » Thu Jan 13, 2011 12:15 am

im sorry didnt understand him. i suppose his english was jumbled up. (was just trying to help)
User avatar
ceriux
 
Posts: 2223
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Postby Nahuel » Thu Jan 13, 2011 12:47 am

ceriux wrote:im sorry didnt understand him. i suppose his english was jumbled up. (was just trying to help)
:) :) :) :) my english is very bad, i need learn :) :)
hi, I am nahuel, I love quake and qc.
User avatar
Nahuel
 
Posts: 492
Joined: Wed Jan 12, 2011 8:42 pm
Location: mar del plata

Postby Nahuel » Thu Jan 13, 2011 12:53 am

thanks for your help
hi, I am nahuel, I love quake and qc.
User avatar
Nahuel
 
Posts: 492
Joined: Wed Jan 12, 2011 8:42 pm
Location: mar del plata


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest