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 / Cam Rotation While Strafing

Author
Message
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 8th Dec 2019 01:12
A simple script to rotate the camera Z angle while strafing left or right.
Two scripts really, first one is a "rigid" rotation, quick and fast. The second script is a more smooth transition with a natural movement.
Axis has been corrected but can be easily changed. Also amount of axis movement can also be adjusted.
Have fun, play hard
Quick rigid rotation...


Smooth natural rotating movement...


Video show both scripts working ....


My games never have bugs.... they just Explosys's

** WHERES MY YELLOW BUTTON ? **
xplosys
18
Years of Service
User Offline
Joined: 5th Jan 2006
Playing: FPSC Multiplayer Games
Posted: 8th Dec 2019 01:51
That really does add something to strafing. Very cool. Thanks.
Supermarket Killer: I got a bomb here! I'll kill her! I'll blow this whole place up!
Marion Cobretti: Go ahead. I don't shop here.
ScooT9
7
Years of Service
User Offline
Joined: 29th Mar 2017
Playing: Half-Life: WAR
Posted: 8th Dec 2019 09:17
This is cool! Kinda reminds me of quake 1.
hi, i'm a random guy who's making random games with random game engines for random reasons
 Dark Lord
4
Years of Service
User Offline
Joined: 11th May 2019
Playing:
Posted: 8th Dec 2019 10:14 Edited at: 8th Dec 2019 11:50
The idea to tilt the camera while strafing is great, it looks more immersive. The problem came from the Z axis, because it's world oriented. Mriganka also noticed this issue
https://forum.thegamecreators.com/thread/220231
The Z axis must be relative, oriented to the player's camera.
ncmako why you're looking only in one direction in the video? Spin around and you will see how "$CAZ" actually works. When you turn left or right, the lean effect makes you look up and down. When you turn 180° the lean effect is mirrored and left movement force you to lean to the right...
https://files.fm/f/nwxta9bn
The best is yet to come...
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 8th Dec 2019 11:42
@ Dark Lord I see what you mean, yes. Time to try and debug a little.
My games never have bugs.... they just Explosys's

** WHERES MY YELLOW BUTTON ? **
SolaraV
4
Years of Service
User Offline
Joined: 6th Dec 2019
Location:
Posted: 8th Dec 2019 17:54 Edited at: 9th Dec 2019 10:36
Yes yes yes!!! I hope the debugging leads to an answer because this will add so much to gameplay experience! So badass! This is a perfect example of how unlimited the engine can be when you think outside "the box!" I don't see fpsc dieing anytime soon.
Edit:
I have made a fpi file, used it as main, placed this code snippet in the playerinzone, and even ctrlc+v'd it into "when used" and i have decided that i must be a complete nit wit because I cant for the life of me figure out how to even get the cam to do what you did with it. Trigger zones they say...
Wish I still had my
Edit: I was looking in the syntax manual and I see there is playercamoffset listed, perhaps the engine would accept playercamrotz=x
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 9th Dec 2019 10:40
@ SolaraV Yes, just copy the code snippets & save to your scriptbank, then attach to a triggerzone and place anywhere in the level.
Test run and the A & D keys (left & right strafe ) will trigger the script
Also, might have something better script wise. Been testing using additional axis. Dark Lord is correct, the camera is world oriented
and not player. So that is a problem.
My games never have bugs.... they just Explosys's

** WHERES MY YELLOW BUTTON ? **
Mriganka
9
Years of Service
User Offline
Joined: 16th Jun 2014
Location: Virtuality
Posted: 9th Dec 2019 14:50
If they are working on Black Ice Mod perhaps they could implement a player-centric axis system. But for now, I would suggest creating dummy variables and then changing the axis (X or Z) to make it look like leaning. But then there is this problem with the X-axis being locked because of how it works with the mouse. Even increments don't work as they become the new default value for the X-axis once added.

So unless someone is willing to work on the source, there are no proper solutions to it, unless you want to make the entire game along the Z-axis.
SolaraV
4
Years of Service
User Offline
Joined: 6th Dec 2019
Location:
Posted: 9th Dec 2019 16:52
That would explain it ncmako, I saved the new FPI's on the desktop, didn't think it made a difference where they were as long as they were pointed to in the engine...

Mriganka, anything is possible with love...

is flat in every 3d modeling program I've ever used.
uzi idiot
Valued Member
14
Years of Service
User Offline
Joined: 27th Dec 2009
Location: Who Knows?
Posted: 9th Dec 2019 18:00
All of the camera rotations are in world space so it's a nightmare to try and have good tilting effects.
If something compiles on the first try. Something is terribly wrong.
SolaraV
4
Years of Service
User Offline
Joined: 6th Dec 2019
Location:
Posted: 9th Dec 2019 20:45 Edited at: 10th Dec 2019 00:55
Ok. Here's an idea, but it's incomplete. I don't reallly understand enough about the language yet, but something like this?


Edit: just tested this and it actually works somewhat, just needs more variables. To fix the 90 & -90 degree view
Edit, no maybe I was wrong. I'm actively digging in to this to achieve a workable solution. But I can't figure out the correct way to phrase this so that the engine understands. Tried multiple ways. Attached is a pic

Attachments

Login to view attachments
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 9th Dec 2019 22:59
@ Mriganka & Uzi Yes, you guys are both correct. It's a frustrating problem to overcome. All the axis come into play.
@ SolaraV I think I know what your after. Keep plugging away at it. If anything you will begin to understand the fpi script language much better
what it's able to do.
My games never have bugs.... they just Explosys's

** WHERES MY YELLOW BUTTON ? **
SolaraV
4
Years of Service
User Offline
Joined: 6th Dec 2019
Location:
Posted: 10th Dec 2019 04:46 Edited at: 10th Dec 2019 15:54
I probably tried 300 combinations tonight and so far I am unable to come up with anything that works, except once I was upside down and it kinda worked...
Btw, I came up with a hardware solution, place an electrical actuator under each side of the tv, an have them activated by a&d keys so the screen tilts when you strafe...ghetto but, for an extra 30 bux in hardware you could include the rotz package to the end user.

Edit: what about the mouse look function? Can this be manipulated? $MMY $ MMX are both in the syntax list, can $MMZ be called and is this even relevant as an idea? Doesn't mouse look operate separate from the camrot ?

Update: I find a value of 2 to be very tolerable in all directions when using the script. So although we have been unable to solve this, $CAZ 2 & -2 adds a bit of looseness and doesn't mess up your aim vertically too much when facing either side. So I call this a win! the 2 degrees of vertical movement could actually help a player if they are aiming slightly high or too low if they switch strafe directions right before taking the shot.
superunixstudio
5
Years of Service
User Offline
Joined: 5th May 2018
Location:
Posted: 6th Jan 2020 12:20 Edited at: 6th Jan 2020 12:22
great

Login to post a reply

Server time is: 2024-04-20 15:29:43
Your offset time is: 2024-04-20 15:29:43