Jump to content
Sign in to follow this  
liongreek

Outro anyone?...

Recommended Posts

OK, apologies first...I don't know if I use the right forum for this, and it's probably the millionth time you 've seen a noob request something similar, but...here goes:

I have searched throughout the forum several times, and although I did find quite a number of posts referring to it, I still cant't quite put an outro - lose in a mission.

To explain, I want to trigger an outro cutscene when all the players in a MP mission are dead. Problem is, no matter what instructions I follow I always end up watchingmy character lying dead, even when he is the last one.

Like I said, lots of info out there, but when people know how to script, they tend to take some things for granted, like triggers for instance.

pls bear in mind that I haven't used the editor for this, as I have no clue as to how. What I have done so far, is succeeded with the End#1 -win situation- (there, I'm not a complete noob...Am I?...) and scripted the scene I want to play in my outro - lose...

If you should find the time to address the situation...again..., pls keep in mind the noob factor when u r explaining thinks. Think of it as an effort to explain how babies are born to your 4-year-old son...don't go to the umbilical cord before you tell him the cabbage story...

Thanks in advance and forgive me for an unecessarily long post...

Share this post


Link to post
Share on other sites

I think you can override the player kia script with your own, so you can cam create all you want after they are dead.

Though i cannot remember its name, check the wiki.

Cheers

GC

Share this post


Link to post
Share on other sites

Nope, wiki didn't help much, I'm not that advanced to follow it in the first place...thanks for the effort though smile_o.gif

Share this post


Link to post
Share on other sites
<s>onplayerdeath (i think its called)</s>

here the page you need CLICKY

Thanks Junker, I was aware of that, unfortunately I do have respawn enabled in the mission...perhaps there is no way to do it my way (well, I'm not Sinatra..)

Share this post


Link to post
Share on other sites

OK, if we can't do that, let's change the request a bit. Supposing that we cannot trigger an outro End#2 that will have as condition that all players are dead, can we do it if only a certain number is left alive? Let's say, out of 20 people we have 3 alive. That ends the mission with a failure message in ending 2...

Share this post


Link to post
Share on other sites

Look, maybe you should use the BAS framework as I do... I think that one has a script for counting friendly losses getting too high although haven't used it myself.

BAS framework

In that you can easily link outros into mission ending conditions.

(The BAS creates it's own End# triggers so the type of your ending trigger will be "switch")

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">this exec "outroLose.sqs";myEnd = [1] execVM "f\server\mpEndBroadcast.sqf";

Just a suggestion....in that framework you'll find good instructions how to use every aspect. (Previous code is from framework. You can specify different end conditions in it)

Share this post


Link to post
Share on other sites
[...] here the page you need CLICKY

[...]I was aware of that, unfortunately I do have respawn enabled in the mission [...]

What's wrong with PlayerRespawnOtherUnit (also described on the provided page)?

Share this post


Link to post
Share on other sites
[...] here the page you need CLICKY

[...]I was aware of that, unfortunately I do have respawn enabled in the mission [...]

What's wrong with PlayerRespawnOtherUnit (also described on the provided page)?

Nothing wrong, I just want my cutscene to appear when every member of my team is dead. Seems that I cannot overide the default death scene though...

Witt, thanks, I'l give it a go...

I'll keep at it and advise accordingly...

Thanks for the support people!

Share this post


Link to post
Share on other sites

Outro and intro sections in the mission editor are for singleplayer only, not MP. If you want cutscenes in MP they need to be done in the mission.

Share this post


Link to post
Share on other sites
Outro and intro sections in the mission editor are for singleplayer only, not MP. If you want cutscenes in MP they need to be done in the mission.

That meansthat they won't work in MP? Man, there goes a week's work!

Thanks Matt....     sad_o.gif

(no, really, thanks for the heads up)

Share this post


Link to post
Share on other sites
Outro and intro sections in the mission editor are for singleplayer only, not MP. If you want cutscenes in MP they need to be done in the mission.

That meansthat they won't work in MP? Man, there goes a week's work!

Thanks Matt.... sad_o.gif

(no, really, thanks for the heads up)

You can move them into the mission with a little work though. But you can't skip it like an intro, unless you make your own way to skip it.

Or you could make an SP mission out of it whistle.gif

Share this post


Link to post
Share on other sites
Outro and intro sections in the mission editor are for singleplayer only, not MP. If you want cutscenes in MP they need to be done in the mission.

That meansthat they won't work in MP? Man, there goes a week's work!

Thanks Matt....      sad_o.gif

(no, really, thanks for the heads up)

You can move them into the mission with a little work though. But you can't skip it like an intro, unless you make your own way to skip it.

Or you could make an SP mission out of it whistle.gif

Got it! A little work it was, Matt...as for the SP, it will be part of the campaign for the Hellenic Warfare Mod, sometime in Christmas if all goes well...

Thanks again people!

Share this post


Link to post
Share on other sites

so am i late ?

a way to do this is name your units like w1,w2,w3 ... e1,e2,e3 ...

create a client side script checking alive status for all units in a while- or for-loop until all units are dead ... as this happens the loop breaks and starts your cutscene or outro ... do this by creating a camera spotting on where you want ... over this camera scene you are able to > titletext ["your messages ..","plain"] <

as this script runs out you can force mission to end, or just go on to another one you created ... whatever.

Regards,

Zap

Share this post


Link to post
Share on other sites
so am i late ?

a way to do this is name your units like w1,w2,w3 ... e1,e2,e3 ...

create a client side script checking alive status for all units in a while- or for-loop until all units are dead ... as this happens the loop breaks and starts your cutscene or outro ... do this by creating a camera spotting on where you want ... over this camera scene you are able to > titletext ["your messages ..","plain"] <

as this script runs out you can force mission to end, or just go on to another one you created ... whatever.

Regards,

Zap

Whoa there Zap, u got my attention...your instructions are clear as per their use, but being a noob restricts my actual implementation...how exactly can I do those beautiful things you say?

Besides naming the units, I am at a loss with scripting...

Share this post


Link to post
Share on other sites

hmm ...

try this:

create a new multiplayer mission in multiplayer dialog section.

create 3 OPFOR units and name them in "name" field e1,e2 and e3

and put in initialisation field: removeallweapons this;

then create 3 BLUFOR units and name them w1,w2 and w3 the same way

save your mission...

go in mission folder and create 2 empty textfiles ... name the one "init.sqf" and the other one "functions.sqf" ...

now you can go "scripting" biggrin_o.gif

as the units are now visible in scripts via their variable names you gave to them ... and you can enter the scripts for use directly to these empty files and check it in game by starting new multiplayer map.

put in init.sqf:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">call compile preprocessfile "functions.sqf";

if(local player)then{

[] spawn zf_client_loop;

[4] spawn zf_test_kill_all;

};

and put in functions.sqf

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">//global functions

zf_all_units_dead={//returns true or false

private ["_u"];

_u=[w1,w2,w3,e1,e2,e3];

if(({!(alive _x)} count _u)==(count _u))exitwith{true};

false

};

zf_client_loop={//client loop checks zf_all_units_dead every second here

while{!(call zf_all_units_dead)}do{

sleep 1;

hint format ["%1",{!(alive _x)} count [w1,w2,w3,e1,e2,e3]];

};

[] spawn zf_outro;

};

zf_test_kill_all={//just a test ... kill em all

{sleep (_this select 0);_x setdammage 1;} foreach [w1,w2,w3,e3,e2,e1];

};

zf_outro={//outro

private ["_c"];

0 fademusic 0;

playmusic ["ATrack8",144];

1 fademusic 1;

titletext ["","black out",5];

cuttext ["","black out",5];

sleep 4;

enableradio false;

//disableuserinput true;

showcinemaborder true;

titletext ["","black in",3];

cuttext ["","black in",3];

_c="camera" camcreate [1477.88,9370.08,96.73];

_c cameraeffect ["internal","back"];

_c camsettarget [-40962.95,-76302.14,-27545.39];

_c camsetpos [1758.05,9771.48,32];

_c camsetfov 0.7000;

_c camcommit 0;

waituntil {camcommitted _c};

titletext ["blah","plain",4];

sleep 4;

titletext ["blah blah","plain",4];

sleep 8;

cuttext ["","black out",3];

titletext ["blah blah blah","plain",2];

sleep 2;

//disableuserinput false;

enableradio true;

//player switchcamera "internal";

//player cameraeffect ["terminate","back"];

camdestroy _c;

sleep 4;

};

what happens is:

in init.sqf the loop and a test killer functions is started

the loop runs the whole game .. checking every second if all units are dead by a function ... as this one returns true the outro function is starting with an example cam and texts on open water...

you can use a trigger instead of the client loopscript, too ... as you want ..

Regards,

Zap

Share this post


Link to post
Share on other sites

try too:

...

_c="camera" camcreate [1477.88,9370.08,96.73];

_c camsetfov 0.7000;

_c cameraeffect ["internal","back"];

_c camsettarget (getpos player);

_c camsetrelpos [2,2,2];

_c camcommit 0;

waituntil {camcommitted _c};

_c camsetrelpos [16,16,8];

_c camcommit 30;

...

this will spot on dead player and zoom out slowly (untested)

Share this post


Link to post
Share on other sites

small problem, I get this error message

if(local player)then#{

Generic error in expression

and nothing happens whe everyobody dies, which I suppose it has to do with the error above...

any ideas?

Share this post


Link to post
Share on other sites

the # shows you that the error must be inside the {} brackets ..

or in a function that is called within these brackets...

maybe you modified something that produces an script error...

you have to create precise code ... do it exatly as i do and if you are unsure watch here:

Scripting Commands Biki

remember your last steps ... your error will be there ...

Regards and have fun,

Zap

Share this post


Link to post
Share on other sites

Right again, Zap...it works perfectly...thanks.

One more question though. I suppose that there are lines in your int that kill the players so as the functions to check an respond accordingly.

To use this function in a mission, am I right to assume that I should omit the init lines? I mean it sounds obvious but just to be sure I get it right...

Thanks again...

Share this post


Link to post
Share on other sites

this is just a testmission ..

removeallweapons this; is added in editor so that these guys don't start shooting at each other immediately ... not needed in your mission ...

the test kill function not needed too, it just kills everyone for test reasons to start the outro you wanted ... without the need that you have to kill them ...

just remove it or put // in front:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

if(local player)then{

//this will be executed

[] spawn zf_client_loop;

//this will not be executed

//[4] spawn zf_test_kill_all;

};

all code in line after // will be ignored ..

so you can write your own things for your own documentation

try removing the "removeallweapons this;" in units init

and remove the test_kill as descibed ...

after that they got weapons .. start shooting ... after all dead outro starts...

you can also let the outro start as only one is left ... the zf_all_units_dead function now checks for ==6 (count _u) .... this can easily check for ==6-1 (count _u)-1 so the mission ends/ outro starts on last survivor.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

zf_all_units_dead={//returns true or false

private ["_u"];

_u=[w1,w2,w3,e1,e2,e3];

if(({!(alive _x)} count _u)==(count _u)-1)exitwith{true};

false

};

just to show you what you can do/change for example.

Share this post


Link to post
Share on other sites

Firstly, thanks for making sense! I really start to get it now. Your examples work perfectly! I still have a problem with init in my mission, but since they do work I must have something that causes some type of conflict. I'll nailt that sucker sooner or later...

If u ever get to Greece, the beer is on me Zap! Thanks again!

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  

×