Home   Help Search Login Register  


Author Topic: Campaigns with multiple endings  (Read 1377 times)

0 Members and 1 Guest are viewing this topic.

Offline eegore

  • Members
  • *
Campaigns with multiple endings
« on: 09 Jun 2009, 13:27:13 »

  I have the editing skills of a fruit bat.

  With that being said Ive never really understood assembling a campaign.  When we make ones at work we just slap in a notepad document saying what order to play the missions in.

  My question is if you had a series of missions with 4 seperate potential endings, is it possible to assemble that into a working campaign?  The idea stems from a series of missions I made that are loosely based off the Greneda school rescue on the airfield back in the 80's.  Each mission had a victory/fail ending and a seperate mission branched off each condition.

  For instance if you successfully destroyed the radio tower an the AA in mission 1 then all Rangers would land at the airfield.  If you failed mission 1 you still continued the campaign but 1/3 of the Rangers failed to land at the DZ.  A series of failures led to 4 missions and at the end you get killed at a beach.  A series of victories led to all students being flown off on UN choppers. 

  To keep it tight I made sure all conditions looped into one of 4 endings.  Is it possible to do this in a real campaign if I knew someone that could assemble the completed missions? 

Offline firegraphite

  • Members
  • *
Re: Campaigns with multiple endings
« Reply #1 on: 09 Jun 2009, 13:57:55 »
Actually that sounds really good. I've just read about the OFPEC campaign and maybe they could implement multiple endings for that. But thats beyond me for now. I'm not exactly into ArmA.. But hey, have you tried the OFP resistance campaign? That one's got an alternate ending. The part where Victor Troska was made to decide whether to betray a rebel's hiding place.. An alternate ending goes depending on that decision. Well, I dont know how to make campaigns actually.. I got a knack for making MP missions. But you might want to de-PBO that campaign to see how they did it to have an alternate ending.

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: Campaigns with multiple endings
« Reply #2 on: 09 Jun 2009, 16:02:33 »
You can easily make a campaign file using the OFP CampEdit, it's a very simple and intuitive little application. You can also use it for ArmA campaigns with some slight editing of the files (just look at the description.ext of a working ArmA campaign for reference).

The key thing for making a branching campaign is simply to match up the different "ends" with the appropriate triggers. Example:

Code: [Select]
class Part1
        name = "Start";

        cutscene = ;

        firstMission = StartingMission;
        lost = ;
        end1 = ;
        end2 = ;
        end3 = ;
        end4 = ;
        end5 = ;
        end6 = ;

class Mission1: MissionDefault
            end1 = Mission2;
            end2 = Mission3;
            end3 = Mission4;
            end4 = Mission5;
            end5 = Mission6;
            end6 = Mission7;
            lost = Mission1;
            template = Mission1.Intro;

In Mission1 (which follows directly on StartMission), the different ends (1-6) correspond to the End # 1 - # 6 triggers found in the editor. E.g., if obj1 && obj2 then --> End #1, if !obj1 && obj2 --> End #2 etc. etc.

You can make endless possibilities beyond 1-6 by creating interval missions (e.g., end 1-5 go to their respective endings, end 6 goes to a new mission which again has end 1-5 alternatives etc etc.).

However, even easier is to simply use saveVar. saveVar saves a variable between missions (forever), so you can for instance at the end of mission 1 saveVar a variable:

Code: [Select]
saveVar "obj1"
And then in the next mission (there's no loadVar - they're loaded automagically) you can simply have a trigger such as:

Code: [Select]
Cond: obj1
On Activation: {deletevehicle _x} foreach units enemy_reinforcements

And if obj1 is true, the enemy reinforcements will be deleted in the next mission. You can have quite a lot of variation between missions using this simple method.

Campaign scripting is a little bit on the advanced side, and it's hard to test except by actually creating and playing the campaign. That's of course why using the multiple ending way is easier, since then each mission can be created without relying on previously saved variables.

Oh, if you want to save e.g. your group (wounded, killed etc.) between missions you can always try RUG Campaign ;)

Good luck!

Wolfrug out.
"When 900 years YOU reach, look as good you will not!"

Offline eegore

  • Members
  • *
Re: Campaigns with multiple endings
« Reply #3 on: 10 Jun 2009, 00:24:45 »

  Thanks for the info here. 

  This saveVar thing seems like the way to go.  The question is do I place this code into a type of end trigger? 

  Also in mission 1 a failure will result in mission 2 having a trigger that will setdammage1 some aircraft.  If I saveVar "Trig1" will it create that trigger, or does it only work on objects/units.  If its only for units I'll have to rework how Ive set up the mission changes.   

  I do like this idea though, saves on making so many missions.  Man I wish I knew all this stuff back when this game was new.