Jump to content
Sign in to follow this  
chronicsilence

cameraEffect changing animation

Recommended Posts

I have an animation of my player laying on his back:

player playMoveNow "AinjPpneMstpSnonWnonDnon";

This works fine and dandy. However, now I want to add a camera view above the player looking down on him:

_deathCam = "CAMERA" camCreate (player modelToWorld [0,0,15]);
showCinemaBorder true;
_deathCam camSetTarget player;
_deathCam cameraEffect ["INTERNAL", "BACK"];
_deathCam camSetFOV 1;
_deathCam camSetFocus [50,0];
_deathCam camCommit 0;

For some reason, executing this code causes the player to roll over onto his stomach. How can adding a camera effect change the animation of the player? This is making me crazy trying to figure out what is going on.

"enableSimulation false" is not a solution I can use for this to keep the player from rolling over, I need something that keeps the simulation going.

Edited by ChronicSilence

Share this post


Link to post
Share on other sites
How can adding a camera effect change the animation of the player? This is making me crazy trying to figure out what is going on.

"enableSimulation false" is not a solution I can use for this to keep the player from rolling over, I need something that keeps the simulation going.

The simulation keeping going is your problem. Just try playing the animation on its own, the player once completing the anim will automatically roll back over.

Play the anim, wait until the anim has stopped playing, lock him in position.

nul = []  spawn {nul = []  spawn {

player playMoveNow "AinjPpneMstpSnonWnonDnon"; 
waitUntil { animationState player == "AinjPpneMstpSnonWnonDnon"};
waitUntil { animationState player != "AinjPpneMstpSnonWnonDnon" };
player enableSimulationGlobal false; 
_deathCam = "CAMERA" camCreate (player modelToWorld [0,0,15]);
showCinemaBorder true;
_deathCam camSetTarget player;
_deathCam cameraEffect ["INTERNAL", "BACK"];
_deathCam camSetFOV 1;
_deathCam camSetFocus [50,0];
_deathCam camCommit 0;
};

Share this post


Link to post
Share on other sites

The weird part is that if I don't add the camera effect (i.e. just use the regular 3rd person camera), he doesn't roll back over. He'll stay on his back. If you add the camera effect through the debug console while he's on his back, then as soon as it opens the new camera view he'll roll over onto his stomach again. It has something to do with adding the camera effect, and I don't understand why.

Share this post


Link to post
Share on other sites
The weird part is that if I don't add the camera effect (i.e. just use the regular 3rd person camera), he doesn't roll back over.

Weird he does for me no matter which way i do it either through debug console or script in the units init, he will always roll back onto his front.

Open editor, place player, preview, switch to third person view, open debug console, run player playMoveNow "AinjPpneMstpSnonWnonDnon";, close console.

Anim plays and then he automatically rolls back onto his front.

Open editor, place player, add

h = [] spawn {
waitUntil { time > 0 && !isNull player };
player switchCamera "EXTERNAL";
player playMoveNow "AinjPpneMstpSnonWnonDnon";
};

to its init, preview.

Anim plays and then he automatically rolls back onto his front.

Even doing the same for a non player unit does exactly the same thing.

I have even tried playmove and switchmove and i always get the same results. What are you doing different to get him to stay on his back?

Share this post


Link to post
Share on other sites
Weird he does for me no matter which way i do it either through debug console or script in the units init, he will always roll back onto his front.

Open editor, place player, preview, switch to third person view, open debug console, run player playMoveNow "AinjPpneMstpSnonWnonDnon";, close console.

Anim plays and then he automatically rolls back onto his front.

Open editor, place player, add

h = [] spawn {
waitUntil { time > 0 && !isNull player };
player switchCamera "EXTERNAL";
player playMoveNow "AinjPpneMstpSnonWnonDnon";
};

to its init, preview.

Anim plays and then he automatically rolls back onto his front.

Even doing the same for a non player unit does exactly the same thing.

I have even tried playmove and switchmove and i always get the same results. What are you doing different to get him to stay on his back?

I tried it with a new mission and you're right, he rolls over onto his stomach again immediately. I realized the only thing different between that and my actual mission is that when I was testing it, the player had no weapon. So I dropped the player's weapons in the new empty mission, and sure enough he stayed rolled on his back and didn't go onto his stomach again. Looks like it's playing an animation to get into a prone shooting position because his weapon is out.

This, however, does not solve the question of why the camera effect is causing him to roll over again even when he doesn't have a weapon.

Share this post


Link to post
Share on other sites

have you guys tried disableAI "ANIM"; by any chance?

Possibly when the client loses control of the player unit it switches back over to AI.

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  

×