The Second Step

Right, in this step, we totally dismantle your mod. Ideally, you read How To one, and have pretty much the basic structure you need to do this fairly cleanly. If you haven't, then, what you need is this:

- A game.txt event that triggers at what you have decided to be the end of each level.

OR

- In a few cases, an inlevel script trigger which marks the end.

Now, bear in mind there are 2 systems that relate to progress through a campaign. First, is level availability. This is, if a level even appears on the map or not. Second, is level having a mission set for that level.

The only safe way of having an unavailable level become available, is to have a trunk port that links to that level activated during gameplay. That doesn't necesserily mean you have to have objectives that include activating trunk ports, but that is certainly the easiest. This, however, is totally your domain - eg Stricken starts with almost all the levels available, because I had no realistic way to make the next level become available each time, so I had to have them start that way in order for it to work. Bear in mind, though, there are many cunning tricks that you can use in order to make this happen, but that's something for another day.

If you have more than one objective in a level, you will also need to have the next level's mission set to 'null' (although, I do this regardless and without consideration of if I actually need to) - why? As soon as a trunk port comes online, the level it points to becomes available. If it has a mission set, you can stop the level you are currently doing, and proceed to the next. Most of the time, you don't want this to happen, so, you need to set it to start with null in game.txt.

Since we've done that, we need to set the next level's mission when we complete this level. You'll need one of the two bullet pointed things above to do this - if you did how to 1 or did it of your own accord, you already have a script set up to fire at the end of each level, [name]_complete.txt. If you don't, you will need to create an event line that represents the completion of all the objectives in a level. This will look something like:

Event BuildingOnline :hack,61
Action RunScript Hack_complete.txt
End

Now, we have 2 options here. We can add Action SetMission [nextlevel] mission_[nextlevel].txt OR we can add setmission [nextlevel] mission_[nextlevel].txt into Hack_complete.txt. Which is better? The latter - why? Let's say you make a mistake, eg you spell the mission name wrong. But, it's for the last level and you have a few people helping you test it, and you know they haven't got that far yet and you could easily fix it so they can test it ok. If you did it the first way, to fix it, they all need new profiles. If you do it the 2nd way, they don't. If you're using an inlevel script trigger, you don't a choice.

Hopefully then, you can go through what you have for your mod, and now have a way of connecting each level to the next.

Once you think you've got that, duplicate it all into game_unlockall.txt again, and proceed to Stage 3