Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

FPSC Classic Scripts / Player Camera Offset

Author
Message
Mriganka
9
Years of Service
User Offline
Joined: 16th Jun 2014
Location: Virtuality
Posted: 10th Aug 2017 20:28
Does anyone know how I can increment/decrement the player camera offset along the axes? I am trying to make a (head bobbing camera effect). I have done the code below but they don't work as intended.



Please help! It would make the gameplay in FPSC very effective.
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 11th Aug 2017 03:23
Mriganka I have one I made awhile back, works great. Just along the "y" axis.
You can easily add more axis's if you need to?

Attach to a triggerzone anywhere in your level.

My games never have bugs. They just develop random features..
Lots and lots of random features...
Mriganka
9
Years of Service
User Offline
Joined: 16th Jun 2014
Location: Virtuality
Posted: 11th Aug 2017 04:34 Edited at: 11th Aug 2017 05:23
Thanks ncmako. The head bobbing looks great. But is there any fix for the weapon not moving along with the camera?



I made the above script, but it feels like the game has lag (although the camera changes at 30 times per second).
Mriganka
9
Years of Service
User Offline
Joined: 16th Jun 2014
Location: Virtuality
Posted: 11th Aug 2017 09:16
I had made a variation of the script, but for some reason the player's camera gets locked in the middle of the screen and can only move horizontally. Can you check what errors that may have caused this?

ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 11th Aug 2017 11:54
Mriganka Just a quick look and I noticed a couple syntax error's. It's "plrnotcrouched" or "plrcrouching"
Some use the "is" in the command, some don't
The weapon "bobbing" can be done if really needed by adding a few lines to the "gunspec"
I recall there's a "Y"offset when walking...
My games never have bugs. They just develop random features..
Lots and lots of random features...
Mriganka
9
Years of Service
User Offline
Joined: 16th Jun 2014
Location: Virtuality
Posted: 11th Aug 2017 13:14
I looked and cleaned up the syntax errors but I still have this persistent problem of the player's view being locked up in the horizontal axes. I think it may have to do with me using both variables $CAZ and $CAX together (but $CAZ doesn'/t do head bobbing for me when the player is facing east/west). Do you know of any commands that check which direction the player is facing? I cannot find one in the unofficial syntax list doc.
Mriganka
9
Years of Service
User Offline
Joined: 16th Jun 2014
Location: Virtuality
Posted: 12th Aug 2017 10:42 Edited at: 12th Aug 2017 10:44
ncmako I have found that using $CAX locks the player camera along the x-axis (horizontal axis) and $CAY along the y-axis (vertical axis). Any idea on how to counter that?
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 12th Aug 2017 11:43 Edited at: 12th Aug 2017 12:08
Mriganka
Quote: " Any idea on how to counter that?"

Just a thought, but can we even use 1/10's of a degree in the scripts for camera angles?
I never tested/tried it? When I had player "spin" in my scrap yard level just before a gun fight
I only used whole numbers (addvar=$CAY 3) to slowly spin player. Just a thought?

Edit: Yes, I can confirm that using decimals for the camera angle commands locks the script
I believe it's based on 360 for a full circle, with increments of one degree, so whole numbers are required.
My games never have bugs. They just develop random features..
Lots and lots of random features...
Mriganka
9
Years of Service
User Offline
Joined: 16th Jun 2014
Location: Virtuality
Posted: 12th Aug 2017 14:06 Edited at: 12th Aug 2017 14:39
ncmako there is the damn culprit!

I am not going with increments of 0.1 for all as there are 4 states

1. Player is moving
2. Player is running
3. Player is crouching
4. Player is jumping

Hopefully now I can make this well and good.

UPDATE -

I can confirm that the camera gets locked either way. Hope s4real and Nomad Soul are still working on BIMod so that they can sort this out. Till then I will have to do with $CAZ alone.

Login to post a reply

Server time is: 2024-04-25 21:53:00
Your offset time is: 2024-04-25 21:53:00