BaseQC CCam rotation?
Moderator: InsideQC Admins
34 posts
• Page 2 of 3 • 1, 2, 3
Thanks, My hiatus did not help my syntax, lol.
float SVC_SETANGLE;
float SVC_SETVIEW;
float ChaseCam_Update;
Now I have this at the bottom of my defs.qc
I get one new error, it points toward ChaseCam_update
ERROR client.qc temp is not a function.
Also thanks for your help. It would have taken me a great amount of time to troubleshoot this. The last two months of work have been crazy and I have had little time off so I've fallen out of practice.
float SVC_SETANGLE;
float SVC_SETVIEW;
float ChaseCam_Update;
Now I have this at the bottom of my defs.qc
I get one new error, it points toward ChaseCam_update
ERROR client.qc temp is not a function.
Also thanks for your help. It would have taken me a great amount of time to troubleshoot this. The last two months of work have been crazy and I have had little time off so I've fallen out of practice.
Knives out. Catch the mouse. Squash his head. Put him in your mouth.
- Blackstar1000
- Posts: 52
- Joined: Mon Sep 13, 2010 5:16 pm
ChaseCam_Update();
This is all it highlights in Friq when I click edit.
This is all it highlights in Friq when I click edit.
Knives out. Catch the mouse. Squash his head. Put him in your mouth.
- Blackstar1000
- Posts: 52
- Joined: Mon Sep 13, 2010 5:16 pm
Blackstar1000 wrote:
Unknown Value "SVC_SETANGLE"
Error client.qc Unknown Value "SVC_SETVIEW"
Well... Spike basically told you what was wrong...
You would just add this to the bottom of defs.qc
- Code: Select all
float SVC_SETVIEW = 5;
float SVC_SETANGLE = 10;
Or, you could just set these to the above values in SetViewPoint() and SetViewAngle()
e.g.
- Code: Select all
void SetViewAngle(entity ent)
{
msg_entity = self;
WriteByte (MSG_ONE, 10);
WriteAngle (MSG_ONE, ent.angles_x);
WriteAngle (MSG_ONE, ent.angles_y);
WriteAngle (MSG_ONE, ent.angles_z);
}
void SetViewPoint(entity ent)
{
msg_entity = self;
WriteByte (MSG_ONE, 5);
WriteEntity(MSG_ONE, ent);
}
Blackstar1000 wrote:float ChaseCam_Update;
Remove this... This isn't a float...
Blackstar1000 wrote:Error client.qc Unknown Value "SetViewPoint"
Error client.qc Unknown Value "ChaseCam_Update"
It looks like you don't have these in the right order? All of those functions SetViewPoint(), SetViewAngle(), ChaseCam_Update(), ChaseCam_Toggle() should be right before PlayerPreThink in client.qc
It almost seems like you've placed them afterwards, or not at all?
The order does matter unless you have prototypes...
- apolluwn
- Posts: 35
- Joined: Tue Apr 26, 2011 11:57 pm
//I HAVE ALL THIS ABOVE void() PlayerPreThink =
entity ccamera;
void SetViewAngle(entity ent)
{
msg_entity = self;
WriteByte (MSG_ONE, SVC_SETANGLE);
WriteAngle (MSG_ONE, ent.angles_x);
WriteAngle (MSG_ONE, ent.angles_y);
WriteAngle (MSG_ONE, ent.angles_z);
}
void SetViewPoint(entity ent)
{
msg_entity = self;
WriteByte (MSG_ONE, SVC_SETVIEW);
WriteEntity(MSG_ONE, ent);
}
void Chasecam_Update()
{
// face the player in a constant direction
self.angles = '0 90 0';
// ccamera distance from player
ccamera.origin_x = self.origin_x+128;
ccamera.origin_x = self.origin_x+128;
// set ccamera origin based on self.origin
ccamera.origin_y = self.origin_y;
ccamera.origin_z = self.origin_z;
setorigin (ccamera, ccamera.origin);
}
void ChaseCam_Toggle()
{
if (self.aflag == FALSE)
{
self.aflag = TRUE;
ccamera = spawn();
ccamera.classname = "ccamera";
ccamera.movetype = MOVETYPE_NONE;
ccamera.solid = SOLID_NOT;
setmodel (ccamera, "progs/null.spr");
setsize (ccamera, '0 0 0', '0 0 0');
// 180 degrees to face player model
ccamera.angles = '0 180 0';
SetViewPoint(ccamera);
SetViewAngle(ccamera);
stuffcmd(self, "r_drawviewmodel 0\ncl_bob 0\ncl_rollangle 0\nv_kickpitch 0\nv_kickroll 0\n");
}
else
{
self.aflag = FALSE;
stuffcmd(self, "r_drawviewmodel 1\ncl_bob 0.02\ncl_rollangle 2.0\nv_kickpitch 0.6\nv_kickroll 0.6\n");
// face the same direction as the player model appeared w/ chasecam on
self.angles = '0 90 0';
SetViewPoint(self);
SetViewAngle(self);
remove(ccamera);
}
}
//THIS IS WHERE THE "void() PlayerPreThink =" is
Next I have
if(self.aflag)
ChaseCam_Update();
at the bottom of "void() PutClientInServer ="
Finally I have
float SVC_SETVIEW = 5;
float SVC_SETANGLE = 10;
at the bottom of defs.qc
I still get Unknown value "ChaseCam_Update" in FriqQcc
Sorry if I'm missing something really stupid

entity ccamera;
void SetViewAngle(entity ent)
{
msg_entity = self;
WriteByte (MSG_ONE, SVC_SETANGLE);
WriteAngle (MSG_ONE, ent.angles_x);
WriteAngle (MSG_ONE, ent.angles_y);
WriteAngle (MSG_ONE, ent.angles_z);
}
void SetViewPoint(entity ent)
{
msg_entity = self;
WriteByte (MSG_ONE, SVC_SETVIEW);
WriteEntity(MSG_ONE, ent);
}
void Chasecam_Update()
{
// face the player in a constant direction
self.angles = '0 90 0';
// ccamera distance from player
ccamera.origin_x = self.origin_x+128;
ccamera.origin_x = self.origin_x+128;
// set ccamera origin based on self.origin
ccamera.origin_y = self.origin_y;
ccamera.origin_z = self.origin_z;
setorigin (ccamera, ccamera.origin);
}
void ChaseCam_Toggle()
{
if (self.aflag == FALSE)
{
self.aflag = TRUE;
ccamera = spawn();
ccamera.classname = "ccamera";
ccamera.movetype = MOVETYPE_NONE;
ccamera.solid = SOLID_NOT;
setmodel (ccamera, "progs/null.spr");
setsize (ccamera, '0 0 0', '0 0 0');
// 180 degrees to face player model
ccamera.angles = '0 180 0';
SetViewPoint(ccamera);
SetViewAngle(ccamera);
stuffcmd(self, "r_drawviewmodel 0\ncl_bob 0\ncl_rollangle 0\nv_kickpitch 0\nv_kickroll 0\n");
}
else
{
self.aflag = FALSE;
stuffcmd(self, "r_drawviewmodel 1\ncl_bob 0.02\ncl_rollangle 2.0\nv_kickpitch 0.6\nv_kickroll 0.6\n");
// face the same direction as the player model appeared w/ chasecam on
self.angles = '0 90 0';
SetViewPoint(self);
SetViewAngle(self);
remove(ccamera);
}
}
//THIS IS WHERE THE "void() PlayerPreThink =" is
Next I have
if(self.aflag)
ChaseCam_Update();
at the bottom of "void() PutClientInServer ="
Finally I have
float SVC_SETVIEW = 5;
float SVC_SETANGLE = 10;
at the bottom of defs.qc
I still get Unknown value "ChaseCam_Update" in FriqQcc
Sorry if I'm missing something really stupid
Knives out. Catch the mouse. Squash his head. Put him in your mouth.
- Blackstar1000
- Posts: 52
- Joined: Mon Sep 13, 2010 5:16 pm
Blackstar1000 wrote:I still get Unknown value "ChaseCam_Update" in FriqQcc
argg...
Ok. It was a typo the entire time.
The function isn't called ChaseCam_Update it was called Chasecam_Update.
You can change either one just so they are the same...
Sorry about that. I guess I wanted us to chase our tails there for a bit...
- apolluwn
- Posts: 35
- Joined: Tue Apr 26, 2011 11:57 pm
Nice it compiles! Though my impulse 666 does not do anything.
I changed the model of the chasecam to the eyes.mdl and it does not show up. I messed with parameters - they don't seem to help.
This is called first, is that right?
if(self.aflag)
Chasecam_Update();
I changed the model of the chasecam to the eyes.mdl and it does not show up. I messed with parameters - they don't seem to help.
This is called first, is that right?
if(self.aflag)
Chasecam_Update();
Knives out. Catch the mouse. Squash his head. Put him in your mouth.
- Blackstar1000
- Posts: 52
- Joined: Mon Sep 13, 2010 5:16 pm
Blackstar1000 wrote:Nice it compiles! Though my impulse 666 does not do anything.
I changed the model of the chasecam to the eyes.mdl and it does not show up. I messed with parameters - they don't seem to help.
This is called first, is that right?
if(self.aflag)
Chasecam_Update();
I'm not sure what all you've changed...
Since I saw you'd said you changed calling Chasecam_Update from PlayerPreThink to PutClientInServer then this will only be called when the client joins the game... On the other hand, PlayerPreThink is called every frame.
You should put that back if you have removed it and if you haven't added the impulse command into weapons.qc you need to add that as well.
- apolluwn
- Posts: 35
- Joined: Tue Apr 26, 2011 11:57 pm
Blackstar1000 wrote:Nice it compiles! Though my impulse 666 does not do anything.
I changed the model of the chasecam to the eyes.mdl and it does not show up. I messed with parameters - they don't seem to help.
This is called first, is that right?
if(self.aflag)
Chasecam_Update();
I'm not sure what all you've changed...
Since I saw you'd said you had changed calling Chasecam_Update from PlayerPreThink to PutClientInServer then this will only be called when the client joins the game... On the other hand, PlayerPreThink is called every frame.
You should put that back if you have removed it and if you haven't added the impulse command into weapons.qc you need to add that as well.
- apolluwn
- Posts: 35
- Joined: Tue Apr 26, 2011 11:57 pm
Yes, yes. The impulse commands are in place. ( I have much experience in modding the weapons) I also moved the lines back into player prethink. Compiles correctly, still no effect when I impulse them.
Knives out. Catch the mouse. Squash his head. Put him in your mouth.
- Blackstar1000
- Posts: 52
- Joined: Mon Sep 13, 2010 5:16 pm
Blackstar1000 wrote:Yes, yes. The impulse commands are in place. ( I have much experience in modding the weapons) I also moved the lines back into player prethink. Compiles correctly, still no effect when I impulse them.
It won't accept a value larger than 255. Make the impulse < 255
- apolluwn
- Posts: 35
- Joined: Tue Apr 26, 2011 11:57 pm
God I remember reading that like a year ago. I have to stop programming against my instincts.
YES it works, Thanks everyone. You saved me a great deal of time and effort. Kick ass.
YES it works, Thanks everyone. You saved me a great deal of time and effort. Kick ass.
Knives out. Catch the mouse. Squash his head. Put him in your mouth.
- Blackstar1000
- Posts: 52
- Joined: Mon Sep 13, 2010 5:16 pm
34 posts
• Page 2 of 3 • 1, 2, 3
Who is online
Users browsing this forum: No registered users and 1 guest
