OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Ade on 16 Jan 2004, 02:03:59

Title: Characters in a campaign..
Post by: Ade on 16 Jan 2004, 02:03:59
Thanks to everyone who answers my dumb questions.  Some forums can be a bit intimidating but none of that here. Yet another noob one I'm afraid...

I'm working on a SP campaign because I had a good idea for a story at last (won't give too much away because I'll have the first mission ready for testing soon).

You play a squad leader in an anti-terror unit and I wanted to make the second-in command a bit of a character so that if he gets killed you'll be a bit upset.  Is there any way that I can track the survival of a squad member through a campaign and make certain things happen or not happen in missions depending whether he's alive or not?

I know how to edit the .ext files so that I can set up identities and stuff so I don't need the really basic basics.

Thanx,

Ade
Title: Re:Characters in a campaign..
Post by: j-man on 16 Jan 2004, 06:51:51
Taken from the unofficial command reference:

Quote
Command :
SaveVar
 
Description :
Allows you to save variables from one mission to the next mission in a campaign.
 
Syntax :
SaveVar  variablename

Variablename is the name of the variable to save. It is necessary to enclose it in quotes.
 
Returns :
N/A
 
Example:
SaveVar  "houseDestroyedFlag"

Notes:
It is not necessary to load a variable in the next mission. It is automatically loaded.

You can place triggers in the first mission to check if someone has died. If they have, then you can change a variable in your init.sqs, then, just save the variable to use in the next mission ;)

Hope this helps you ;)
Title: Re:Characters in a campaign..
Post by: Ade on 16 Jan 2004, 18:36:56
j-man,

That sounds like it will work - for each character I want to track I can have a flag variable to determine if they are alive or not.  Depending on this I can give the units in the player's squad a different setIdentity, and alter the behaviour of cutscenes if I need to, like different dialogue.  With one, or maybe two non-player characters it should stay manageable.  Any more would be a bit tricky to manage.

Now all I have to do is write a second mission so that I can test it.

Cheers,

Ade ;)