[CSM]Soldier.camerashakefactor 1

Lots of cool and useful tips to mod either serverside or clientside

[CSM]Soldier.camerashakefactor 1

Postby Senshi » Sun Jan 17, 2010 10:15 am

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!
User avatar
Senshi
 
Posts: 695
Joined: Sun Oct 18, 2009 1:14 pm
Location: Germany

Re: [CSM]Soldier.camerashakefactor 1

Postby Apache Thunder » Tue Jan 19, 2010 2:03 am

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.
ImageImageImage

I have cameras in your head!
User avatar
Apache Thunder
 
Posts: 1199
Joined: Mon Oct 19, 2009 2:48 am
Location: Levelland Texas, USA

Re: [CSM]Soldier.camerashakefactor 1

Postby freddy » Tue Jan 19, 2010 4:24 am

is this why it looked so silly when you run in version 1.0?
User avatar
freddy
 
Posts: 1242
Joined: Sun Oct 18, 2009 4:58 pm

Re: [CSM]Soldier.camerashakefactor 1

Postby Senshi » Tue Jan 19, 2010 10:45 am

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?
User avatar
Senshi
 
Posts: 695
Joined: Sun Oct 18, 2009 1:14 pm
Location: Germany

Re: [CSM]Soldier.camerashakefactor 1

Postby freddy » Tue Jan 19, 2010 4:17 pm

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 ;)
User avatar
freddy
 
Posts: 1242
Joined: Sun Oct 18, 2009 4:58 pm

Re: [CSM]Soldier.camerashakefactor 1

Postby Swaffy » Thu Nov 07, 2013 8:51 pm

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.
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
User avatar
Swaffy
 
Posts: 1715
Joined: Sun Aug 29, 2010 9:25 pm
Location: Cibolo, Texas

Re: [CSM]Soldier.camerashakefactor 1

Postby freddy » Fri Nov 08, 2013 3:43 am

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
User avatar
freddy
 
Posts: 1242
Joined: Sun Oct 18, 2009 4:58 pm

Re: [CSM]Soldier.camerashakefactor 1

Postby Vilespring » Fri Nov 08, 2013 3:49 am

the auto fire code? it could be like a beer bottle, and when you drink it, your drunk for a bit! :lol:
A picture is worth a thousand words, but takes up three thousand times the memory.

Area 51: http://battlefieldarea51mod.weebly.com/

Image
"I didn't steal your pizza"
User avatar
Vilespring
 
Posts: 740
Joined: Sat Nov 24, 2012 5:47 am
Location: Somewere in the United States

Re: [CSM]Soldier.camerashakefactor 1

Postby Waldek » Fri Dec 06, 2013 11:33 pm

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?
Waldek
 
Posts: 49
Joined: Thu Mar 08, 2012 12:09 pm

Re: [CSM]Soldier.camerashakefactor 1

Postby Senshi » Sat Dec 07, 2013 8:32 pm

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.
User avatar
Senshi
 
Posts: 695
Joined: Sun Oct 18, 2009 1:14 pm
Location: Germany


Return to General Modding Tutorials

Who is online

Users browsing this forum: No registered users and 4 guests