Jump to content
Sign in to follow this  
roguetrooper

Camera earthquake shake?

Recommended Posts

I've searched the forum and tried a lot of things with all commands related to "camera" with the help of the wiki. No success so far.

I want the player's camera to shake for a few seconds like in an earthquake. Is it possible at all? Does anyone have a script at hand?

Share this post


Link to post
Share on other sites

Just found this and it seems to work.....

"earthquake.sqf"

Switch (_This) do {
Case "BIS_Earthquake": {
  While {Alive Player} Do {
     Playsound "eq";
     _This = Vehicle Player;
     For "_i" from 0 to 140 do {
        _vx = vectorup _this select 0;
        _vy = vectorup _this select 1;
        _vz = vectorup _this select 2;
        _coef = 0.01 - ((Random 0.0004) * _i);
        _This setvectorup [
           _vx+(-_coef+random (2*_coef)),
           _vy+(-_coef+random (2*_coef)),
           _vz+(-_coef+random (2*_coef))
        ];
        sleep (0.01 + random 0.01);
     };
     sleep (60 + Random 180);
  };
};
Default {HintC "Error in Mainfunction";};
};

Execute from a trigger with :-

nul = "BIS_Earthquake" execVM "earthquake.sqf";

Just tried it....works fine. I had placed a Function Module as well....not sure if it was needed or not.

EDIT: Just realised you will have to make a few changes to get exactly what you need. I just ran the code without really looking at tit properly. The Function Module not necessary.

Edited by twirly

Share this post


Link to post
Share on other sites

As I said, I have been playing around with various commands, but I was not able to get such a camera shake:

I have copied the examples from the wiki:

enableCamShake true;

setCamShakeParams [1, 1, 1, 1, 1];

addCamShake [10, 1, 25];

I have changed/raised several values. But whatever I tried... not the faintest shake. I am using A2, OA, BAF and PMC 1.59 without any mods.

Nevertheless, the script that twirly found, works. Thanks.

PS. Is this script useful for multiplayer? It seems as if the player char's alignment gets changed several times per second for a few seconds... is this healthy for the data transfer between all participants?

Also concerning other purposes I'd be further interested in shaking the local camera only instead of moving the object very quickly the camera is attached to.

Edited by RogueTrooper

Share this post


Link to post
Share on other sites

addCamShake [power, duration, frequency]

Parameters: power: Number - how strong the camera movement will be

duration: Number - how long the effect will last

frequency: Number - how will be the rhythm

addcamshake [20,5,50]

activated by trigger or however you need it, just play around with the values to get what you want.

From what I can tell, it only works through the first person and not in cutscenes, though I think there's a work around by attaching the player to objects and so on, doing a search on here for addcamshake will bring all the info up.

Koni :)

Edited by Koni

Share this post


Link to post
Share on other sites

Camera shake should be enabled in difficulty options for the shake commands to work, maybe that's why it doesn't work for you.

Share this post


Link to post
Share on other sites

Great. That ugly 1st person camera bob or however it is called, has to be activated in order to have the earthquake-shake to come into effect.

Usually I have deactivated this, because it is unrealistic and causes sickness. When you run through the world, you don't perceive the world shaking as the bob does. You only perceive that bob when you shake a CAMERA while recording and watch that recordings later on a screen (though you are sitting in front of a screen while playing Arma, that screen is not meant to be a 'screen', but your own eyes).

The command 'addcamshake' should be untied from the difficulty-settings-shake. And it should have effect in 3rd person view.

Edited by RogueTrooper

Share this post


Link to post
Share on other sites
because it is unrealistic

...

And it should have effect in 3rd person view.

And 3rd person view isn't? I think it's fine though.

Share this post


Link to post
Share on other sites

Head bob is annoying. Basta! :p

Further, there is no 'reason' why an earthquake-shake should be visible in 1st person while in 3rd person it is not.

Edited by RogueTrooper

Share this post


Link to post
Share on other sites

I think I have head bob set to full, hate the Quake style smooth flowing while running.

Share this post


Link to post
Share on other sites

Yeah I think I have my headbob set at about 25-35% or so. Annoying? Is that it? So is dying, but we don't have a dying tolerance setting... :p I setup these things (headbob, deadzone, camshake, blur, other pp, whatever) to where I think would be the most realistic setting, not what makes me the better gamer and is least annoying.

If you claim to be able to read a roadsign from the same distance sprinting or standing still, then that's on you. For sure I'm not able to, and that's why I tweak these settings.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×