Difference between revisions of "HowTo:Edit Missions:XML integration"
Line 7: | Line 7: | ||
==Basic 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 | + | First let me start by explaining how to run a python class... in this case we start with the prebuild <code>[http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/vegastrike/data4.x/modules/privateer.py?rev=HEAD&content-type=text/vnd.viewcvs-markup modules/privateer.py]</code> script to run our mission. Open up <code>[http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/vegastrike/data4.x/mission/explore_universe.mission?rev=HEAD&content-type=text/vnd.viewcvs-markup mission/explore_universe.mission]</code> 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=== | ===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. | + | It loads <code>Crucible/Cephid_17.system</code> 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. | 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. | ||
Line 34: | Line 34: | ||
===Flightgroup Section=== | ===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. | + | The <code>rot</code> flag is ignored, and the position specifies the <code>x,y,z</code> coords of the Shlimazel flightgroup, which is of type <code>llama.begin</code>. |
<pre> | <pre> | ||
Line 52: | Line 52: | ||
===Python Section=== | ===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. | + | Future note: If you wanted to add a campaign to the privateer mission you would most likely modify <code>privateer.py</code> to have a campaign module get loaded.... so you wouldn't necessarily need to modify <code>explore_universe.mission</code> 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 | + | 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 <code>[http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/vegastrike/data4.x/modules/privateer.py?rev=HEAD&content-type=text/vnd.viewcvs-markup privateer.py]</code> module in the <code>[http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/vegastrike/data4.x/modules/ modules]</code> directory. |
Line 65: | Line 65: | ||
</pre> | </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 | + | 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 the 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. |
+ | |||
---- | ---- | ||
{{NAV_Manual | | {{NAV_Manual | | ||
Line 72: | Line 73: | ||
| next=[[HowTo:Edit Missions:Python:Missions|Python Inheritance]] | | next=[[HowTo:Edit Missions:Python:Missions|Python Inheritance]] | ||
}} | }} | ||
− | [[Category: | + | [[Category:HowTos|Edit Missions:XML integration]] |
[[Category:Development|Edit Missions:XML integration]] | [[Category:Development|Edit Missions:XML integration]] |
Revision as of 19:30, 28 May 2005
Add Conversations | Edit Missions | Python Inheritance |
Basic XML integration
First let me start by explaining how to run a python class... in this case we start with the prebuild modules/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.
<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>
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
.
<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>
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.
<python> from privateer import privateer my_obj=privateer(8000,40000,500,3,2,.6,.25,.1,400000,2000) </python> </mission>
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 the 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.
Add Conversations | Edit Missions | Python Inheritance |