Jump to content
Sign in to follow this  
madrussian

See Your Death script - Little help needed

Recommended Posts

Hi all, I wrote a little script to see your death upon dying in ArmA3 SP. As opposed to default ArmA3 where everything blurs and blacks out when you die, now you get to see yourself ragdoll.

Works pretty good, but it's not perfect yet. Wrote two Event Scripts, which get placed in the main mission dir, and override the corresponding event scripts (located inside "A3.pbo").

onPlayerKilled.sqs:

_this execvm "onPlayerKilled.sqf"
~10000000000000000000

onPlayerKilled.sqf:

[] spawn { sleep 10; endMission "END1" };

_pos = positionCameraToWorld [0,0,0];
_cam = "camera" camCreate _pos;
_cam cameraEffect ["internal", "BACK"];

_dead = player;
selectNoPlayer;
_cam camSetTarget _dead;

// Wipe out the blur, fisheye effect, and blackout
[] spawn {
while {true} do {
	for "_i" from 0 to 1000 do {
		_i ppEffectEnable false;
		_i ppEffectForceInNVG false;
		_i cutFadeOut 0;
	};
	sleep 0.1;
};
};

while {true} do {
_cam camCommit 0;
sleep 0.001;
};

In order to see one's death, we must overcome 3 different visual effects that default ArmaA3 generates upon death:

  1. Screen blurred - The ppEffectEnable line above eliminates the blur.
  2. Fisheye effect onscreen - The ppEffectForceInNVG line above eliminates the fisheye effect.
  3. Screen blacks out - After a few seconds, the screen begins to black out, and will stay that way without any intervention. The cutFadeOut line above makes the blackout effect go away, but only after the blackout fades in first.

Question is regarding #3. I can make the blackout go away, but again only after the blackout completely fades into view. I'd like to stop the blackout as soon as it starts, so the player never even sees it.

So, trying to wipe out the blackout upon death all-together. Any ideas?

Share this post


Link to post
Share on other sites

Cutrsc has the time for far in so try that above cutfadeout.

Share this post


Link to post
Share on other sites

Thanks, that pointed me in the right direction. Turns out a cutText right before the cutFadeOut will do the trick, eliminating the blackout completely.

[] spawn {
while {true} do {
	for "_i" from 0 to 10000 do {
		_i ppEffectEnable false;
		_i ppEffectForceInNVG false;
	};
	4 cutText ["","PLAIN",0];
	4 cutFadeOut 0;
	sleep 0.1;
};
};

Appears the death blackout is occurring in layer 4, at least for me. Also, apparently the post process IDs for the blur and fisheye effect are not always in the 0 to 1000 range, so I increased the loop to encompass 0 to 10000.

No where near optimized yet, but works like a charm for simple missions! :-)

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  

×