Jump to content
Sign in to follow this  
limmy3

Dead in mission alive in outro ?

Recommended Posts

Hello again ... nice to see you again ...  biggrin_o.gif

Well, I'm all most finished with my mission and need to rewrite the outro-loose.sqs.

It can happen that one or the other of my units die in action.    confused_o.gif

I'm writting an outro where the enemy General receives the surrender of my fireteam.

But it looks somehow strange if all of my units surrender even those killed in the main mission.

So, is there a method to transfer the mission data to the outro?  huh.gif  huh.gif   huh.gif

All  help.gif  is  welcome.gif .

Regards limmy3

Share this post


Link to post
Share on other sites

No, I think there's no method to transfer mission data into the outro.

The solution? 'Transfer' the outro scene inside the mission.

Share this post


Link to post
Share on other sites

Yes, thank you.

You're wright that's what I'm gonna do. wink_o.gif

Regards limmy3

Share this post


Link to post
Share on other sites

Actually it is totally possible

Example :

In your mission set yourself and in front of you put 4 different units : a black ops, a crew, a pilot, a soldier

Name them

n1 for the black ops

n2 for the crew

n3 for the pilot

n4 for the soldier

Make a radio alpha trigger that has On Activation :

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">[] exec "savetest.sqs"

Here is the content of savetest.sqs

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

~1

? !(alive n1) : deadcheck=deadcheck+2

? !(alive n2) : deadcheck=deadcheck+4

? !(alive n3) : deadcheck=deadcheck+8

? !(alive n4) : deadcheck=deadcheck+16

~1

saveVar "deadcheck"

~1

ENDTHISMISSION=true

exit

create a 2nd trigger and replace in the line Condition

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

by

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

and in the Type drop down menu select End #1

Save the mission

Now in the Outro-Win of this mission, put yourself and in front of you 4 units (the same as the one from the mission itself)

Name those units exactly

n1 for the black ops

n2 for the crew

n3 for the pilot

n4 for the soldier

In your init line put

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">[] exec "outrotest.sqs"

Here is the content of outrotest.sqs

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

? (deadcheck == 2) : n1 setdammage 1

? (deadcheck == 4) : n2 setdammage 1

? (deadcheck == 8) : n3 setdammage 1

? (deadcheck == 16) : n4 setdammage 1

? (deadcheck == 6) : n1 setdammage 1;n2 setdammage 1

? (deadcheck == 10) : n1 setdammage 1;n3 setdammage 1

? (deadcheck == 18) : n1 setdammage 1;n4 setdammage 1

? (deadcheck == 12) : n2 setdammage 1;n3 setdammage 1

? (deadcheck == 20) : n2 setdammage 1;n4 setdammage 1

? (deadcheck == 24) : n3 setdammage 1;n4 setdammage 1

? (deadcheck == 14) : n1 setdammage 1;n2 setdammage 1; n3 setdammage 1

? (deadcheck == 22) : n1 setdammage 1;n2 setdammage 1; n4 setdammage 1

? (deadcheck == 26) : n1 setdammage 1;n3 setdammage 1; n4 setdammage 1

? (deadcheck == 28) : n2 setdammage 1;n3 setdammage 1; n4 setdammage 1

? (deadcheck == 30) : n1 setdammage 1;n2 setdammage 1;n3 setdammage 1; n4 setdammage 1

~10

exit

Save the mission

Now back to the mission (NOT the outro-win) preview

Kill some of the 4 units.

Once done, call radio alpha , after 3 seconds you will have the debriefing screen appearing.

Click on Continue

Now select the outro-win and preview it.

Notice the same soldiers that you killed in the mission will die after 1 second and the ones you sparred will stay alive smile_o.gif

You can then adapt this to your mission situation (of course the more units you want to check alive/dead, the longer the outro script will be , as you need to check each combinations)

Share this post


Link to post
Share on other sites

Here is a way you can do it and not have the scripts be so long. It may not work if saveVar cannot save an array value, but I think it can.

Savetest.sqs

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

_units == [n1,n2,n3,n4]

{if (! alive _x) then {deadtest = deadtest + _x}} forEach _units

saveVar "deadtest"

~ .1

ENDTHISMISSION = true

exit

Outrotest.sqs

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

{_x setDamage 1} forEach deadtest

Its worth a try. If it works it will save you a whole lot of typing.

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  

×