Page 1 of 1

[CSM]Soldier.camerashakefactor 1

Posted: Sun Jan 17, 2010 10:15 am
by Senshi
Yeah I know this one is an oldie, but it's a goodie. And I found how to edit its parameters.

First things first.
Type

Code: Select all

soldier.camerashakefactor 1
ANYWHERE in your mod/map files (just put it in a .con that's definetly called) or you even can simply type it in the console ingame to test it.
This enables a camerashake effect for the soldier. Yeah. So, if you start running around, you'll notice a slight headbobbing and that your crosshair jiggles around a bit. Very subtle. Cool thing is depending on your stance the strength changes.

So, I found where this shakes are defined some months ago, but just recently worked a bit on them to enhance the shakeeffects.
Animations\AnimationStatesLower.con

Check AnimationStateMachine.createState Lb_RunForward . In the end of this paragraph there are these lines:

Code: Select all

AnimationStateMachine.setCameraShakeLeftRight 0 0.02 5
AnimationStateMachine.setCameraShakeYaw 0 0.15 8.0
AnimationStateMachine.setCameraShakeUpDown 0 0.08 15
AnimationStateMachine.setCameraShakeFadeIn 0 0.6
As you can see, this really is a completely regular camerashake effect, nothing out of the ordinary :) . If you know about camerashakes already, just do whatever you want here. You can add some more parameters (Pitch, Roll, InOut) if you like, but they are not really useful and only make the player throw up when running aroun :D .

First Argument always should be 0 (dunno what happens else ;) ).
Second argument defines the strength of the shake. A shake of 1 is ten times stronger than 0.1 . Simple.
Third argument defines the amount of time in which the shake should occur. This is not in seconds. It's a bit difficult to say precisely, but just fiddling with it you'll notice quickly what settings fit quite good.

The real difficulty is to make the camerashake look fitting to the weapon animations, which usually have a left-right-swaying-animation.

But, this actually allows for various stuff to accomplish. You could make a "realism"-mod and set a pretty heavy swaying camera when running so people are encouraged to stand still for shooting (as not only the camera shakes, but the crosshair does too!) or prefer walking (which again can be set up separatly :) ). Or you could make something completely crazy and get all BF soldiers drunk, adding very strong and slow sway animations for every stance. Did this once (even for Stand-Animation ;) ) and it really gets you crazy. It's especially funny because you no longer are able to walk straight ahead. As the animation sways your crosshair heavily, it obviously also changes your direction of movement. Would be quite funny to have 30 guys staggering around on a server trying to kill the others... :D
Only downside: You can't deny people to switch the camerashake off manually...by setting it to 1 in a .con you merely make it active in the beginning, but if anyone types it in the console with "0", the effect gets deactivated...so best is to not inform your players about this possibility ;) . Ignorance is bliss!

Re: [CSM]Soldier.camerashakefactor 1

Posted: Tue Jan 19, 2010 2:03 am
by Apache Thunder
This command is client side I think. I don't recall it working if you add it to a map that didn't have it before. It's also a command you can run in the console! Yep. You can turn it on/off ingame on any server you like as this command is mostly controlled by the client. Drop it in the BuddyList.con file in your profile and you can have it turned on any map/mod/server and it won't cause any issues with Punkbuster or MD5! ;)

Of coarse if your making a new map/mod the command will work fine for both client/server since the client will have it on by default if you set it that way.

Re: [CSM]Soldier.camerashakefactor 1

Posted: Tue Jan 19, 2010 4:24 am
by freddy
is this why it looked so silly when you run in version 1.0?

Re: [CSM]Soldier.camerashakefactor 1

Posted: Tue Jan 19, 2010 10:45 am
by Senshi
I thought I made it clear that this is Client side...it's in the title [CSM], it's in the text ;) , but well, repetition helps learning, huh? :D

What do you mean with Version 1.0? Game version 1.0? Who in the lord's name would play that?

Re: [CSM]Soldier.camerashakefactor 1

Posted: Tue Jan 19, 2010 4:17 pm
by freddy
yeh game version 1

sounds are differentto if i remember correct and when running the soldier kinda move up and down in a silly way. sniper is super steady and can hit headshots while running

remember the rotes lol ;)

Re: [CSM]Soldier.camerashakefactor 1

Posted: Thu Nov 07, 2013 8:51 pm
by Swaffy
I've been messing around with this, and I have some camera shakes going fairly well. BUT...

Is there a way to make a running camera shake for just one hand weapon? I have one hand weapon that I'd like to make completely drunk-like shakes for.

Re: [CSM]Soldier.camerashakefactor 1

Posted: Fri Nov 08, 2013 3:43 am
by freddy
Swaffy wrote:I've been messing around with this, and I have some camera shakes going fairly well. BUT...

Is there a way to make a running camera shake for just one hand weapon? I have one hand weapon that I'd like to make completely drunk-like shakes for.
only thing i know is some code that make a gun shake when you fire it

Re: [CSM]Soldier.camerashakefactor 1

Posted: Fri Nov 08, 2013 3:49 am
by Vilespring
the auto fire code? it could be like a beer bottle, and when you drink it, your drunk for a bit! :lol:

Re: [CSM]Soldier.camerashakefactor 1

Posted: Fri Dec 06, 2013 11:33 pm
by Waldek
Hi

I have few question regarding AnimationStateMachine group.

1. AnimationStateMachine.addIdle <state>. This command is used for calling camera shake definition that goes triggered after circa 5 seconds of player's idleness. Is it possible to increase that time?

2. I went quite far with altering camera shakes so I would be really dissapointed if it won't work online. So another question is: Can I use all of AnimationStateMachine commands in Client Side Mod?

3.Am I allowed to create my own AnimationStateMachine.setSoundTrigger?

4. After dying, the camera from 1st Person View goes to Top Down mode. How can I keep 1.P after being killed?
thx in advance

5. Is it possible to shake the camera after being hit in a tank?

Re: [CSM]Soldier.camerashakefactor 1

Posted: Sat Dec 07, 2013 8:32 pm
by Senshi
Camera Shakes do work online if you use "soldier.camerashakefactor 1" somewhere in your server files.
However, every client will be able to freely disable this effect by entering "soldier.camerashakefactor 0" in the console. This command is not restricted for the regular bf42.exe, sadly. So it's OK to use camera shakes for better immersion, but you shouldn't use it for gameplay-important aspects, as gamey players will just disable it altogether.

No idea on the other Qs, sorry.