Development:Campaigns

From VsWiki
Revision as of 13:50, 3 January 2009 by Pyramid (talk | contribs)
Jump to: navigation, search

Editing Campaigns

Note: The information contained here is useful only to those willing to learn a minimal amount of python code (the language does not need to be learned, only the formatting restrictions imposed). A GUI editor is in development, but work has stalled due to lack of time on the developer's part. If anyone wishes to assist, please contact dandandaman.

An example campaign can be found under the following link

To write a campaign, you'll require missions. The mission system is what is used by both the mission bbs, and the campaign. As a start, it is good to plan to use only the mission types available, as writing your own can be a pain, and requires a degree of proficiency with python and vegastrike which you may not have for a little while. If you are developing a campaign and do require something specific that isn't available, just ask, and we'll see what can be done.

Since you are then limited to the missions we have, you'll want a nice reference about what each of the variables for each mission are ... and what they do. We don't actually have one ;-) but we have something that is almost as good: verify_missions.py At the bottom of this file is a list of the mission types, and slightly more descriptive labels for the arguments (their meanings should be relatively easy to glean from that info, but ask if you're unsure :-) ).

That is unfortunately the easy part. The harder part (easy once you understand it) is then writing the campaign. The campaign for Vega Strike is stored in campaigns.py.

Before we proceed I think it's best if you look at this stuff and try to understand a little bit yourself. At the top of campaigns.py is a whole bunch of text, the dialog and strings used by all the various campaign 'nodes.'

A 'node' is a branch of a campaign, it is where fixers get created and the decision to accept or deny a mission occurs, or where the campaign is branched automatically (depending on some conditions that you might want to specify. I.e. you might have a branching storyline depending on whether a flight group still exists or not).

Typically, each node contains a mission ... Cargo missions are a special case, they have a special type of node wrapper, and are probably the easiest to start with. Anyway, get yourself a text editor with syntax highlighting for python, and have a look at the nodes in the function LoadTestCampaign (this is a short test campaign that I made to demonstrate a bug).

There was more documentation somewhere, but it appears to have been vanquished. So, ask the inevitable questions!

Campaign Structure

Campaign Integration

Nodes

There are 2 types of nodes:

  • CampaignClickNode() - here you have to accept or reject the proposed mission
  • CampaignNode() - creates an action like adding reward

The nodes are then connected with MakeMission statements

Campaign Missions

Campaigns

The first major campaign written (Jenek)

See also the forum thread (comments & feedback) when this mission was first put into SVN. FIXME Improve/expand it?

See Also