Difference between revisions of "Development:Missions"

From VsWiki
Jump to: navigation, search
 
m (Switched SVN URLs to GH)
 
(34 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{Wiki_Nav_Index}}
+
{{NAV_Manual |
 
+
| previous=[[Development:Campaigns|Edit Campaigns]]
=EDITING MISSIONS=
+
| up=[[HowTos]]
 +
| next=[[HowTo:Edit News|Edit News]]
 +
}}
 +
----
 +
==EDITING MISSIONS==
 
{{attention}}
 
{{attention}}
  
==Introduction==
+
===Introduction===
 
Vega Strike has a powerful missions scripting interface that allows you to nearly modify Vega Strike at whatever level you choose, from the AI scripts (and the physics thereof) to the missions... to the overall plot and goal of the game.
 
Vega Strike has a powerful missions scripting interface that allows you to nearly modify Vega Strike at whatever level you choose, from the AI scripts (and the physics thereof) to the missions... to the overall plot and goal of the game.
  
==Basic XML integration==
+
===[[HowTo:Edit_Missions:XML_integration|Basic XML integration]]===
First let me start by explaining how to run a python class... in this case we start with the prebuild "privateer.py" script to run our mission. Open up mission/explore_universe.mission First come the variables that designate how the mission should normally start. By normally I mean if they don't have any save game present.
 
 
 
===Variables Section===
 
It loads Crucible/Cephid_17.system as the star system (which is in XML and stores all present planets) After this, comes the actors in the mission, the flightgroups of fighters. If a mission has more than one player, then each player is the leader (first ship) in each respective flightgroup.
 
 
 
Notice that so far there are a lot of values you don't see for long in the default vegastrike game. Credits, System, first flightgroup fighter, difficulty--these are all initial values but can change.... since there is specified a savegame. The savegame makes the mission more of a campaign type mission where things may be saved to disk and reloaded at a later point.  If no savegame variable is specified (this is where the autosave goes) then the mission will not save and will be a one time play mission.
 
 
 
<pre>
 
<mission>
 
<settings>
 
<origin  planet="earth" x="0000" y="100" z="000.0"/>
 
</settings>
 
 
 
<variables>
 
<!-- <var name="continuousterrain" value="continuousterrain.txt"/>-->
 
<var name="credits" value="13500"/>
 
<var name="defaultplayer" value="blue"/>
 
<var name="mission_name" value="Privateer Mission" />
 
<var name="difficulty" value=".05"/><!--starting difficulty-->
 
<var name="system" value="Crucible/Cephid_17" />
 
<var name="description" value="Like, as if." />
 
<var name="savegame" value="explore_universe_difficulty" />
 
</variables>
 
</pre>
 
 
 
 
 
===Flightgroup Section===
 
The rot flag is ignored, and the position specifies the x,y,z coords of the Shlimazel flightgroup, which is of type llama.begin.
 
 
 
<pre>
 
        <flightgroups>
 
                <flightgroup name="Shlimazel" faction="privateer" type="llama.begin"
 
                                  ainame="default" waves="1" nr_ships="1">
 
<pos x="-95124024.543917" y="412089916.256812"
 
                            z="-110779667.398050"/> 
 
<rot x="180.0" y="180.0" z="180.0"/>
 
<order order="tmptarget" target="omikron"/>
 
<order priority="0" order="superiority" target="enemy"/>
 
<order priority="1" order="bomber" target="omikron"/>
 
<order priority="2" order="escort" target="blue"/>
 
</flightgroup>
 
        </flightgroups>
 
</pre>
 
 
 
===Python Section===
 
Future note: If you wanted to add a campaign to the privateer mission you would most likely modify privateer.py to have a campaign module get loaded.... so you wouldn't necessarily need to modify explore_universe.mission just to add a campaign... lets dig further into the meat of the scripting.
 
 
 
If a mission has python tags...then it is a python mission and may have some embedded python in it. In this case the python makes a new python object of type privateer in the privateer.py module in the modules/ directory.
 
 
 
 
 
<pre>
 
<python>
 
                from privateer import privateer
 
                my_obj=privateer(8000,40000,500,3,2,.6,.25,.1,400000,2000)
 
</python>
 
<!-- <module name="director">
 
<import name="privateer"/>
 
<script name="initgame">
 
<exec module="privateer" name="init">
 
<const type="float" value="8000.0"/><!-- significant distance-->
 
<const type="float" value="40000.0"/><!-- detection distance-->
 
<const type="float" value="500.0"/><!-- generation distance -->
 
<const type="int" value="3"/> <!-- min ships -->
 
<const type="int" value="2"/><!--gen ships-->
 
<const type="float" value="0.6"/><!--fighter prob-->
 
<const type="float" value="0.25"/><!--enemy prob-->
 
<const type="float" value="0.02"/><!--capship prob-->
 
<const type="float" value="400000.0"/><!--Max diff credits-->
 
<const type="float" value="2000.0"/><!--capship distance-->
 
</exec>
 
</script>
 
<script name="gameloop">
 
<exec module="privateer" name="loop"/>
 
</script>
 
<script name="initstarsystem">
 
<exec name="initstarsystem" module="privateer" />
 
</script>
 
 
 
</module>-->
 
</mission>
 
</pre>
 
 
 
You have to be careful about newlines, etc in the XML, but it shoudl usually work just dandy. You notice that the mission may pass in arguments to the privateer module that can make slight changes in teh gameplay. This allows many cargo missions to use the same module in order to change the parameters of the cargo missions. In this case the values I have selected appear to work relatively well.
 
 
 
==Python Inheritance In Missions==
 
 
 
==Python Inheritance with AI Scripts ==
 
  
==Suppery about python-Vegastrike class relationships==
+
===[[HowTo:Edit_Missions:Python:Missions|Python Inheritance In Missions]]===
  
==Python - Vega Strike Bindings==
+
===Conclusions===
 +
Well this is the best I can do so far. Please read this documentation over and let me know if you have any suggestions or clarifications. And best yet give it a shot and try it out. And at least look at
 +
'''[https://github.com/vegastrike/Assets-Production/tree/master/modules/missions/cargo_mission.py modules/missions/cargo_mission.py]''' (which is called from a number of missions I think) as well as '''[https://github.com/vegastrike/Assets-Production/blob/master/modules/missions/privateer.py modules/missions/privateer.py]''' called by '''[https://github.com/vegastrike/Assets-Production/blob/master/mission/explore_universe.mission mission/explore_universe.mission]'''. And certainly try to understand '''[https://github.com/vegastrike/Assets-Production/blob/master/modules/quests/quest_drone.py modules/quests/quest_drone.py]''' before trying to write a quest (or while trying to write one).
  
==Writing Add On Adventures==
+
Please also have a look in [[Development:Quests]] for a detailed explanation on the structure of quests and an explanation on how they work.
  
==Conclusion==
+
==See also==
 +
* [[HowTo:Add_Conversations]]
 +
* [[HowTo:Edit_News]]
 +
* [[Development:Campaigns]]
  
=See also=
+
----
 +
{{NAV_Manual |
 +
| previous=[[Development:Campaigns|Edit Campaigns]]
 +
| up=[[HowTos]]
 +
| next=[[HowTo:Edit News|Edit News]]
 +
}}
  
{{Wiki_Nav_Index}}
+
[[Category:HowTos|Edit Missions]]
 +
[[Category:Development|Edit Missions]]

Latest revision as of 19:58, 22 March 2020

arrow_left.png Edit Campaigns arrow_up.png HowTos Edit News arrow_right.png

EDITING MISSIONS

Introduction

Vega Strike has a powerful missions scripting interface that allows you to nearly modify Vega Strike at whatever level you choose, from the AI scripts (and the physics thereof) to the missions... to the overall plot and goal of the game.

Basic XML integration

Python Inheritance In Missions

Conclusions

Well this is the best I can do so far. Please read this documentation over and let me know if you have any suggestions or clarifications. And best yet give it a shot and try it out. And at least look at modules/missions/cargo_mission.py (which is called from a number of missions I think) as well as modules/missions/privateer.py called by mission/explore_universe.mission. And certainly try to understand modules/quests/quest_drone.py before trying to write a quest (or while trying to write one).

Please also have a look in Development:Quests for a detailed explanation on the structure of quests and an explanation on how they work.

See also


arrow_left.png Edit Campaigns arrow_up.png HowTos Edit News arrow_right.png