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 Product Chat / shake camera when hit

Author
Message
nikas
17
Years of Service
User Offline
Joined: 23rd Apr 2009
Location:
Posted: 2nd Jun 2010 01:53
How can i make it so that when i am hit the camera shakes??Does it has to do with airmods camshake?

xplosys
20
Years of Service
User Offline
Joined: 5th Jan 2006
Playing: FPSC Multiplayer Games
Posted: 2nd Jun 2010 02:33 Edited at: 2nd Jun 2010 02:37
Here is one way to do it in vanilla FPSC by Conjured Entertainment. I've used it and it works well.



Assign that script to a dynamic entity anywhere in the vicinity of where you want to have the camera shake. Make sure the entity is set to "always active". Add your own sound if desired or remove the reference from the script. I used it for an earthquake.

I would assume that to have a shake when the player is hit, you would change the trigger to shotdamage= or plrhealthless= instead of plrdistwithin= and make the duration of the shake much shorter.

The Storyteller 01
17
Years of Service
User Offline
Joined: 11th May 2009
Location: On a silent hill in dead space
Posted: 2nd Jun 2010 03:04
Isn't this included in vanilla fpsc?

When throwing the stock handgrenade there is a camera shake.

In case you find my grammar and spelling weird ---> native German speaker ^^
PW Productions
17
Years of Service
User Offline
Joined: 13th Mar 2009
Location: sitting in a chair.
Posted: 2nd Jun 2010 04:52
@Storyteller, that's only for explosions- it's programmed like that.

Marc Steene
FPSC Master
20
Years of Service
User Offline
Joined: 27th Mar 2006
Location: Bahrain
Posted: 2nd Jun 2010 05:57
Obviously Project Blue would be the way to go, as it has camera control built in giving you control of the x, y, z axis as well as their respective angles, as well as AirMod's built in camshake command.

As the others above pointed out, it's also possible in stock too.


[b]FPSC MIGRATION: http://forum.thegamecreators.com/?m=forum_view&t=142497&b=21
nikas
17
Years of Service
User Offline
Joined: 23rd Apr 2009
Location:
Posted: 2nd Jun 2010 12:59
I am not very good with scripting i tried to change plrdistwithin= with shotdamage= or plrhealthless= but it doesnt work

Marc Steene
FPSC Master
20
Years of Service
User Offline
Joined: 27th Mar 2006
Location: Bahrain
Posted: 2nd Jun 2010 15:34
Quote: "I am not very good with scripting"


What you'd need to do is detect when the player has been hit i.e. when he has lost health. To do this you'd need Project Blue and set up some variables. The script would look something like this (no testing or debugging)

:state=0:dimvar=health,state=1
:state=1:setvar=health $PH,state=2
:state=2,varless=$PH %health:etimerstart,state=3
:state=3:camshake=5
:state=3,etimergreater=250:state=4
:state=4:state=1

:vargreater=$PH %health:setvar=health $PH

You'll need to edit values and test yourself so everything looks okay. Camshake may not give the appropriate effect, so you may need to script the camshake yourself (not too hard).


[b]FPSC MIGRATION: http://forum.thegamecreators.com/?m=forum_view&t=142497&b=21
Plystire
23
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 2nd Jun 2010 20:21
Cleaned up your script a bit, Marc. Hope you don't mind.



Not sure the timer is necessary, but it wouldn't be hard for him to remove if it isn't.


The one and only,


DarkFrost
17
Years of Service
User Offline
Joined: 3rd May 2009
Location: ON, Canada
Posted: 2nd Jun 2010 22:26
This script it not working. When I enter it the games screen shakes whether I am hit or not. I have Project Blue UMs latest version I believed.

[img][/img]
Plystire
23
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 3rd Jun 2010 04:12
Hmmmm, not sure if the "varless" is actually a "varlessorequal"... but just in case, try this one:



I added a check in state 1 for if the health variable is not equal to the player's actual health, then if it isn't, it will check for "less than" before shaking.

Lemme know if it works.


The one and only,


Marc Steene
FPSC Master
20
Years of Service
User Offline
Joined: 27th Mar 2006
Location: Bahrain
Posted: 3rd Jun 2010 06:05
Quote: "Not sure the timer is necessary, but it wouldn't be hard for him to remove if it isn't."


I discovered that the camshake command needs to be constantly called, rather than simply turned on for a single state, so the timer ensures it turns off after 0.25 seconds.


[b]FPSC MIGRATION: http://forum.thegamecreators.com/?m=forum_view&t=142497&b=21
nikas
17
Years of Service
User Offline
Joined: 23rd Apr 2009
Location:
Posted: 3rd Jun 2010 06:30
I am interested in the vanilla fpsc version script of this cause i use fenix mod......

DarkFrost
17
Years of Service
User Offline
Joined: 3rd May 2009
Location: ON, Canada
Posted: 4th Jun 2010 00:30
Yep, Ply it works perfect now thanks!

[img][/img]

Login to post a reply

Server time is: 2026-07-05 02:52:09
Your offset time is: 2026-07-05 02:52:09