Editors Depot - Mission Editing and Scripting > OFP - Editing/Scripting General

Variables from mission in outros?

(1/3) > >>

Anmac:

Can you use a variable from the init.sqs file or set in the mission, in an outro.

ie

How do I have 6 different endings and two different outros WITHOUT using the 'loose' ending, which doesn't let you have a debriefing.

I have different debriefings. It's the outros that are getting me.

I have tried using a variable in the init file that will run one outro if it's true and another if false.  But the value doesn't seem to carry over past the mission.

Tell this poor fool what he's doing wrong, if anything.

*can't believed I'm asking this*

KTottE:
I don't think you can have two different Outro - Wins.
And OFP:Res lets you bring variables across, that's how they save the weapons from one mission to another.
If you have it, I suggest peaking inside the Resistance.pbo campaign file and see how they did it.
Combination of exit.sqs and init.sqs.

One idea that just popped into my head was that you save a variable in the end of the mission, and start the outro with triggers. Two of them.
Trigger1 looks for the condition: outro1
Trigger2 looks for the condition: outro2
and then you have Outro - loose for the rest.
And in the end, when you complete End1 you get outro1
End2 gets you outro2
And the rest gets you Outro - Loose, or am I missunderstanding you?

Does that sound like a plan?

Anmac:
T or F - End Loose does not let you set a custom defrief.

T or F - By using 6 different custom defriefings (end1, end2 and so on) I can only have one outro

I tried the two trigger idea but the variable didn't carry over from the mission.

I will look into the exit.sqs file idea.  That sounds like a winner.   :D

Although campaigns work a little differently.

Thanks.

[update]

Hey those exit.sqs files should be required reading!

A big thanks to BIS for adding comments to their scripts.

I think it just might work... will let ya know... :o

KTottE:
No problem, and to answer your questions:

Outro - Loose makes you loose the mission. Finito. You don't progress. You don't get a debriefing. You get: "Sorry sucker, you died"
At least, that's all I've ever seen with Outo - Loose.

There is only one Outro - Win section, so I'm guessing that you can only have one Outro - Win no matter what. Even if you only have 1 debriefing.
Anyway, that's about the only thing I can think of. Is a global variable accessible from a camscript?
Can a global variable be set at the end of a mission?
If yes on both, then just set a global variable in a trigger at the end of a mission, and have the camscript divided into sections and check for the variable.

?(GlobalVariable=True): goto "Outro1"
?(GlobalVariable=False): goto "Outro2"

#Outro1
Outro1 camscript here...

#Outro2
Outro2 camscript here...

That sounds like it could work.

Black_Feather:
I don't think its possible to use global vars in outros I tried to get what vehicle the player was in and use it in the outro but it never worked. I think they work totally different to missions.

Navigation

[0] Message Index

[#] Next page

Go to full version