<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://wiki.vega-strike.org/mediawiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Railla</id>
		<title>VsWiki - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.vega-strike.org/mediawiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Railla"/>
		<link rel="alternate" type="text/html" href="https://wiki.vega-strike.org/Special:Contributions/Railla"/>
		<updated>2026-05-13T17:41:16Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.30.2</generator>

	<entry>
		<id>https://wiki.vega-strike.org/mediawiki/index.php?title=Development:Campaigns&amp;diff=18022</id>
		<title>Development:Campaigns</title>
		<link rel="alternate" type="text/html" href="https://wiki.vega-strike.org/mediawiki/index.php?title=Development:Campaigns&amp;diff=18022"/>
				<updated>2011-02-25T16:57:33Z</updated>
		
		<summary type="html">&lt;p&gt;Railla: /* Editing Campaigns */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NAV_Manual |&lt;br /&gt;
| previous=[[HowTo:Edit faction relationships|Edit faction relationships]]&lt;br /&gt;
| up=[[HowTos]]&lt;br /&gt;
| next=[[Development:Missions|Edit Missions]]&lt;br /&gt;
}}&lt;br /&gt;
----&lt;br /&gt;
=Editing Campaigns=&lt;br /&gt;
&lt;br /&gt;
'''''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 [[User:dandandaman|dandandaman]].''&lt;br /&gt;
&lt;br /&gt;
An example campaign can be found under the following [http://vegastrike.svn.sourceforge.net/viewvc/vegastrike/trunk/data/modules/campaigns.py?view=markup link]&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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 :-) ).&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.'&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
There was more documentation somewhere, but it appears to have been vanquished. So, ask the inevitable questions!&lt;br /&gt;
&lt;br /&gt;
=Campaign Structure=&lt;br /&gt;
&lt;br /&gt;
==Campaign Integration==&lt;br /&gt;
&lt;br /&gt;
You will need to create a new campaign python file (e.g. ''campaign_mycamp.py''), which then will be integrated into the ''campaigns.py'' with the following additions:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
import campaign_mycampaign&lt;br /&gt;
&lt;br /&gt;
campaignsloaders = [ ...&lt;br /&gt;
  lambda:campaign_mycamp.LoadMyCampaign()&lt;br /&gt;
]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The basic structure of your new ''campaign_mycamp.py'' file will then be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
import universe&lt;br /&gt;
import campaign_lib&lt;br /&gt;
from campaign_lib import *&lt;br /&gt;
&lt;br /&gt;
### define node dialogs&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
### define fixer sprites&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
def LoadMyCampaign():&lt;br /&gt;
&lt;br /&gt;
  ### define nodes&lt;br /&gt;
  ...&lt;br /&gt;
&lt;br /&gt;
  # savegame_variable (can't contain spaces)&lt;br /&gt;
  vs = Campaign(&amp;quot;campaign_mycamp&amp;quot;)&lt;br /&gt;
  # the starting node.&lt;br /&gt;
  vs.Init(FirstNode)&lt;br /&gt;
&lt;br /&gt;
  ### define node missions&lt;br /&gt;
  ...&lt;br /&gt;
&lt;br /&gt;
  # finalize campaign definition&lt;br /&gt;
  return vs&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Nodes==&lt;br /&gt;
&lt;br /&gt;
There are 2 types of nodes:&lt;br /&gt;
* ''CampaignClickNode()'' - here you have to accept or reject the proposed mission&lt;br /&gt;
* ''CampaignNode()'' - creates an action like adding reward&lt;br /&gt;
&lt;br /&gt;
The nodes are then connected with the last four arguments in the ''MakeMission'' function:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;MakeMission(vs, ... &lt;br /&gt;
    RejectNode, # If you reject the mission twice. &amp;quot;None&amp;quot; means that he continues asking you forever until you accept&lt;br /&gt;
    LoseNode, # Node if you lose the mission&lt;br /&gt;
    WinNode, # Node if you win the mission&lt;br /&gt;
    ThisNode) # The node for this mission &lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The complete mission statement is described in the following section.&lt;br /&gt;
&lt;br /&gt;
==Campaign Missions==&lt;br /&gt;
&lt;br /&gt;
The different types of mission nodes that can be created are described here. Further down, you will find the singular structure of the arguments.&lt;br /&gt;
&lt;br /&gt;
===MakeMission Node===&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;MakeMission(savegame_variable, fixer_sprite, start_location, end_location, click_script, &lt;br /&gt;
mission_script, mission_arguments, completion_script, dialog_dictionary, reject_node, lose_node, &lt;br /&gt;
win_node, this_node)&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===MakeCargoMission Node===&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;MakeCargoMission(savegame_variable, fixer_sprite, start_location, end_location, &lt;br /&gt;
click_script, mission_script, mission_arguments, completion_script, dialog_dictionary, &lt;br /&gt;
reject_node, lose_node, win_node, this_node)&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===MakeNoFailureCargoMission Node===&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;MakeNoFailureCargoMission(savegame_variable, fixer_sprite, start_location, end_location, &lt;br /&gt;
click_script, mission_script, mission_arguments, completion_script, dialog_dictionary, &lt;br /&gt;
reject_node, lose_node, win_node, this_node)&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Init Node===&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;NodeName.Init(savegame_variable, start_location, dialog_dictionary, fixer_sprite, &lt;br /&gt;
subnode_script, completion_script, next_node)&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Mission Arguments===&lt;br /&gt;
&lt;br /&gt;
* '''savegame_variable''' - usually ''vs''&lt;br /&gt;
* '''fixer_sprite''' - sprite file for the fixer in the form (sprite_path, display_name, full_screen_sprite), e.g. ''(&amp;quot;campaign/captain.sprite&amp;quot;,&amp;quot;Talk_To_The_Captain&amp;quot;,&amp;quot;campaign/heads/captain.sprite&amp;quot;)''&lt;br /&gt;
* '''start_location''' - a command for location checking containing a tuple with (sector/system, base), e.g. ''[InSystemCondition(&amp;quot;Crucible/Cephid_17&amp;quot;,&amp;quot;Serenity&amp;quot;)]''&lt;br /&gt;
* '''end_location''' - same format as start_location&lt;br /&gt;
* '''click_script''' - script to be run as you click on the fixer. A common use is to ''AddCredits()'' for the previous mission.&lt;br /&gt;
* '''mission_script''' - script to be run to start the mission (usually ''None'' if you don't have a script, but ambush is also common.)&lt;br /&gt;
* '''mission_arguments''' - depend on the mission. E.g. for cargo mission you will give the loaded cargo as arguments: ''(&amp;quot;Recycled_Plastics&amp;quot;,50,False)''&lt;br /&gt;
* '''completion_script''' - script to be set on completion (-1=Failure, 0=Not Accepted, 1=Succeed, 2=In progress), often just ''vs.name+&amp;quot;_mission&amp;quot;''&lt;br /&gt;
* '''dialog_dictionary''' - the lines that the fixer says: a dictionary with {dialog_type, dialog_lines_list}, see structure description further down&lt;br /&gt;
* '''reject_node''' - name of the node if you reject the mission twice. &amp;quot;None&amp;quot; means that fixer continues asking you forever until you accept&lt;br /&gt;
* '''lose_node''' - next node if you are unsuccessful in the mission&lt;br /&gt;
* '''win_node''' - next node if you successfully complete the mission&lt;br /&gt;
* '''this_node''' - name of the node for this mission, e.g. ''FirstNode''&lt;br /&gt;
&lt;br /&gt;
==Dialogs==&lt;br /&gt;
&lt;br /&gt;
The structure for the ''dialog_dictionary'' is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
dialog_dictionary = { &lt;br /&gt;
  &amp;quot;intro&amp;quot;:     [conversation],&lt;br /&gt;
  &amp;quot;reject1&amp;quot;:   [conversation],&lt;br /&gt;
  &amp;quot;reconsider&amp;quot;:[conversation],&lt;br /&gt;
  &amp;quot;reject2&amp;quot;:   [conversation],&lt;br /&gt;
  &amp;quot;accept&amp;quot;:    [conversation],&lt;br /&gt;
  &amp;quot;accept2&amp;quot;:   [conversation],&lt;br /&gt;
  &amp;quot;reminder&amp;quot;:  [conversation],&lt;br /&gt;
  &amp;quot;failure&amp;quot;:   [conversation],&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
with:&lt;br /&gt;
conversation = (speaker1, line1, ...), (speaker2, line1, ...), ..., soundfile&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For Init Nodes you will supply only one ''[conversation]''.&lt;br /&gt;
&lt;br /&gt;
=Campaigns=&lt;br /&gt;
&lt;br /&gt;
==The first major campaign written (Jenek)==&lt;br /&gt;
&lt;br /&gt;
See also the [http://vegastrike.sourceforge.net/forums/viewtopic.php?t=3246 forum thread] (comments &amp;amp; feedback) when this mission was first put into SVN.&lt;br /&gt;
{{Fixme}} Improve/expand it?&lt;br /&gt;
&lt;br /&gt;
=See Also=&lt;br /&gt;
* [[Development:Missions|Editing Missions]]&lt;br /&gt;
* [[HowTo:Add_Conversations|Adding Conversations]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
{{NAV_Manual |&lt;br /&gt;
| previous=[[HowTo:Edit faction relationships|Edit faction relationships]]&lt;br /&gt;
| up=[[HowTos]]&lt;br /&gt;
| next=[[Development:Missions|Edit Missions]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:HowTos|Edit Campaigns]]&lt;br /&gt;
[[Category:Development|Edit Campaigns]]&lt;/div&gt;</summary>
		<author><name>Railla</name></author>	</entry>

	</feed>