Difference between revisions of "HowTo:Edit Systems:System Files"

From VsWiki
Jump to: navigation, search
 
(21 intermediate revisions by 9 users not shown)
Line 1: Line 1:
 
{{parent_link|parent=[[HowTo:Edit_Systems|Edit Systems]]}}
 
{{parent_link|parent=[[HowTo:Edit_Systems|Edit Systems]]}}
 
----
 
----
 
 
="Hand-made" System Files=
 
="Hand-made" System Files=
  
These systems take much longer, because you have to do all of the generator's work by hand. Although you may think that using the '''[http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/vegastrike/data4.x/universe/milky_way.xml?rev=HEAD&content-type=text/vnd.viewcvs-markup milky_way.xml]''' file is so much better for that reason, think about systems like Sol (sol_sector/sol) where you want exact exactness to occur in the system file because adventurers who explore it will look at every detail that can not be perfected with even random numbers. I used this method for the starting system in the 3.x releases, enigma_sector/heavens_gate.system
+
These systems take much longer, because you have to do all of the generator's work by hand. Although you may think that using the <code>[http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/vegastrike/data4.x/universe/milky_way.xml?rev=HEAD&content-type=text/vnd.viewcvs-markup milky_way.xml]</code> file is so much better for that reason, think about systems like Sol (<code>sol_sector/sol</code>) where you want exact exactness to occur in the system file because adventurers who explore it will look at every detail that can not be perfected with even random numbers. I used this method for the starting system in the 3.x releases, <code>enigma_sector/heavens_gate.system</code>
  
 +
==XML schema description==
  
 
+
<code><'''system'''> ... </system></code> -- Marks the beginning and end of the XML file.
==Example - heavens_gate.system==
+
* <code>name</code> -- The name of the system.  
+
* <code>ScaleSystem</code> - The scale of the system.
(I know it is long ;-) ):
+
** = 1 (default)
 
+
{{fixme}}: ScaleSystem is an optional parameter, but this is not indicated. Besides indicating which parameters are optional, versus mandatory; for optional parameters there needs to be information about their default values. (chuck_starchaser)
<pre>
+
* <code>reflectivity</code> [float] - ??? Not actually used.
<system name="Heavens Gate" background="backgrounds/plasma_galaxy" nearstars="500" ScaleSystem="1" stars="1000" starspread="150">
+
** = (<code>graphics/reflectivity</code>=.2)
  <Light>
+
* <code>background</code> - The background cube map to use (NO extension like .png, .jpg, etc.)
    <ambient red="0" green="0" blue="0"/>
+
** = "cube"
    <diffuse  red="0.7" green=".7" blue="0.7"/>
+
* <code>backgroundColor</code> (r g b a)
    <specular  red="0.7" green=".7" blue="0.7"/>
+
** = 1.0, 1.0, 1.0, 1.0 (default)
  </Light>
+
* <code>backgroundDegamma</code> [bool] - ? Not actually used.
  <Light>
+
** = false (default)
    <ambient red="0" green="0" blue="0"/>
+
* <code>fadestars</code> - ? Not actually used.
    <diffuse  red="0.5" green=".3" blue=".1"/>
+
** = ! (<code>physics/game_speed_affects_autogen_systems</code> = false) = true
    <specular  red="0.5" green=".3" blue=".1"/>
+
* <code>nearstars</code> - The number of near stars at a given time.  
  </Light>
+
* <code>stars</code> - The number of (far?) stars at a given time.  
 
+
* <code>starspread</code> - The distance between the stars (?).  
  <planet name="Heavens Gate A" file="stars/orange_star.png" radius="5100000" x="-26000000" y="0" z="-26000000" gravity="2000" Red="1" Green="0.44" Blue=".13" ReflectNoLight="true" light="1" >
+
* <code>x</code>, <code>y</code>, <code>z</code> - The coordinates of the system. Implemented long ago for possible use with a map, but not used yet.  
    <planet name="Heavens Gate B" file="stars/white_star.png" radius="4333333"
+
* <code><'''light'''> ... </light></code> - <small>(''repeatable'')</small> Creates a light that can be referenced later.
          gravity="2000" ri="86000000" rj="0" rk="0" si="0" sj="0" sk="67700000" day="85800000" year="85800000" Red="1" Green="1" Blue="1" ReflectNoLight="true" light="0">
+
** <code><'''attenuated'''> ... </attenuated></code> - Specifies the color of attenuated light that is generated.
    </planet>
+
*** red, green, blue, alfa -- Specify the value (between <code>0</code> and <code>1</code>) of the color.  
    <planet name="Barnoose" file="planets/m_class3.png" radius="1281005" gravity="18" ri="26000000.0" rj="0" rk="26000000" si="26000000.0" sj="0" sk="-26000000.0" year="13661700" day="950" position="0">
+
** <code><'''ambient'''> ... </ambient></code> - Specifies the color of ambient light that is generated.
      <Atmosphere file="sol/earthcloudmaptrans.png" alpha="SRCALPHA INVSRCALPHA" radius="1335830"/>
+
*** red, green, blue, alfa -- Specify the value (between <code>0</code> and <code>1</code>) of the color.  
      <Ring file="planets/ring.png" innerradius="2259608" outerradius="2460058" ri="-0.714508" rj="0.436248" rk="0.546960" si="-0.669016" sj="-0.197311" sk="-0.716580" wrapx="180" wrapy="2" year="3081"/>
+
** <code><'''diffuse'''> ... </diffuse></code> - Specifies the color of diffuse light that is generated.
      <Ring file="planets/ring.png" innerradius="1966615" outerradius="2177051"  wrapx="220" wrapy="2" year="-3081"/>
+
*** red, green, blue, alfa -- Specify the value (between <code>0</code> and <code>1</code>) of the color.  
      <Unit name="Inner Rings" file="MiningBase" ri="2059833" rj="-400" rk="0" si="0" sj="-400" sk="2059833" faction="confed"  year="1118260" day="20700" />
+
** <code><'''specular'''> ... </specular></code> - Specifies the color of specular light that is generated.
      <jump name="JumpToNovayaKiev" file="jump.png" ri="2059833" rj="0" rk="-8462" si="-8462" sj="0" sk="2059833" radius="200" year="1118260" day="16020" alpha="ONE ONE" destination="enigma_sector/novaya_kiev"/>
+
*** red, green, blue, alfa -- Specify the value (between <code>0</code> and <code>1</code>) of the color.  
      <jump name="JumpToAdams" file="jump.png" ri="2059833" rj="6086" rk="6086" si="6086" sj="6086" sk="2059833" radius="200" year="34154250" day="16020" alpha="ONE ONE" destination="enigma_sector/adams"/>
+
* <code><'''planet'''> ... </planet></code> - <small>(''repeatable'')</small> (ALIAS: jump) This tag creates a planet (or sun if it generates light).
      <jump name="JumpToAxis" file="jump.png" ri="2065362" rj="0" rk="14376" si="2065362" sj="0" sk="14376" radius="200" year="2405000" day="18500" alpha="ONE ONE" destination="enigma_sector/axis"/>
+
** NOTE: planets and jumps can have any (not light) tags nested inside. This creates the nested tag orbiting around the planets.
      <jump name="JumpToCallimachius" file="jump.png" ri="2065362" rj="0" rk="6299" si="6299" sj="0" sk="2065362" radius="200" year="1118260" day="16020" alpha="ONE ONE" destination="enigma_sector/callimachius"/>
+
** <code>name</code> - The name of the planet.  
      <Unit name="Outer Rings" file="MiningBase" ri="2071742" rj="400" rk="0" si="0" sj="400" sk="2071742" faction="confed"  year="1118260" day="16700" />
+
** <code>file</code> - The texture of the planet (also used to decide which products are sold).  
      <jump name="JumpToTesla" file="jump.png" ri="2082021" rj="5360" rk="0" si="0" sj="5360" sk="2082021" radius="200" year="1118260" day="16020" alpha="ONE ONE" destination="enigma_sector/tesla"/>
+
** <code>radius</code> - The radius of the planet.  
      <jump name="JumpToSterling" file="jump.png" ri="2076881" rj="2680" rk="6724" si="2076881" sj="2680" sk="6724" radius="200" year="1118260" day="16020" alpha="ONE ONE" destination="enigma_sector/sterling"/>
+
** <code>alpha</code> - The blend mode of the texture  
      <jump name="JumpToVespus" file="jump.png" ri="2071742" rj="0" rk="8247" si="8247" sj="0" sk="2071742" radius="200" year="1118260" day="16020" alpha="ONE ONE" destination="enigma_sector/vespus"/>
+
** <code>gravity</code> - The gravity of the planet. I think that it only affects other planets orbiting it, not units.  
      <planet name="Nief" file="planets/Snow2.png" ri="2553705" rj="-481963" rk="0" si="0" sj="-481963" sk="2553705" radius="416000" gravity="5" year="7161700" day="950" position="0"/>
 
    </planet>
 
  </planet>
 
</system>
 
</pre>
 
 
 
 
 
 
 
==XML Schema Description==
 
 
 
So always put the <system> tags first. Next, add X lights in the system, where X is the number of stars in the system. After that, insert one object inside the system that has x,y,z coordinates. Give it ReflectNoLight"true" and light"some_light_number" to make it be a sun. The sun should have one of the textures inside the stars/ directory. Inside that, maybe put another sun orbitting the first sun if the system is binary. Then add a bunch of planets, and add units or more planets around those. Planets' textures should be inside the planets directory. You can also have a nebula or an asteroid field if you want.
 
 
 
Note that for a completely circular orbit, make ri=sk, rj=sj and rk=si. <ri,rj,rk> Is the relative position to the planet when position=0. <si,sj,sk> is the relative position to the planet when position=1.57 (PI/2). Then make position 0 (normally) and set day to a fairly high number and year to be extremely high.
 
 
 
 
 
<system> ... </system> -- Marks the beginning and end of the XML file.
 
 
 
* name -- The name of the system.
 
* ScaleSystem -- The scale of the system.  
 
* reflectivity -- ???
 
* background -- The background cube map to use (NO extension like .png, .jpg, etc.)  
 
* nearstars -- The number of near stars at a given time.  
 
* stars -- The number of (far?) stars at a given time.  
 
* starspread -- The distance between the stars (?).  
 
* x, y, z -- The coordinates of the system. Implemented long ago for possible use with a map, but not used yet. **
 
* <light> ... </light> -- (repeatable) Creates a light that can be referenced later.
 
** <attenuated> ... </attenuated> -- Specifies the color of attenuated light that is generated.
 
: red, green, blue, alfa -- Specify the value (between 0 and 1) of the color.  
 
** <ambient> ... </ambient> -- Specifies the color of ambient light that is generated.
 
:red, green, blue, alfa -- Specify the value (between 0 and 1) of the color.  
 
**<diffuse> ... </diffuse> -- Specifies the color of diffuse light that is generated.
 
:red, green, blue, alfa -- Specify the value (between 0 and 1) of the color.  
 
**<specular> ... </specular> -- Specifies the color of specular light that is generated.
 
:red, green, blue, alfa -- Specify the value (between 0 and 1) of the color.  
 
* <planet> ... </planet> -- (repeatable) (ALIAS: jump) This tag creates a planet (or sun if it generates light).
 
:NOTE: planets and jumps can have any (not light) tags nested inside. This creates the nested tag orbiting aroung the planets.  
 
** name -- The name of the planet.  
 
** file -- The texture of the planet (also used to decide which products are sold).  
 
** radius -- The radius of the planet.  
 
** alpha -- The blend mode of the texture  
 
** gravity -- The gravity of the planet. I think that it only affects other planets orbiting it, not units.  
 
 
** red, green, blue, alfa -- The color of the planet (not the color of the light it generates). I think that "alfa" is correct, not "alpha".  
 
** red, green, blue, alfa -- The color of the planet (not the color of the light it generates). I think that "alfa" is correct, not "alpha".  
** ReflectNoLight -- does the planet not reflect light? Defaults to false, do you shouldn't have to worry about this most of the time.  
+
** <code>ReflectNoLight</code> - does the planet not reflect light? Defaults to false, do you shouldn't have to worry about this most of the time.  
** light -- A reference to one of the lights above that this sun generates. This is the criteria for a planet becoming a sun.  
+
** <code>light</code> - A reference to one of the lights above that this sun generates. This is the criteria for a planet becoming a sun.  
** destinations -- A space seperated list of the destinations that this jump point will take you to. (usually only one, but more will make the jump point random). NOTE that the presence of this attribute is the only criteria for the planet being a jump point, not the name of the tag, which is just to make it clearer.  
+
** <code>destinations</code> - A space separated list of the destinations that this jump point will take you to. (usually only one, but more will make the jump point random). NOTE that the presence of this attribute is the only criteria for the planet being a jump point, not the name of the tag, which is just to make it clearer.
** citylights -- A texture for using city lights (looks like [Texturefile]wrapx[WrapXValue]wrapy[WrapYValue])  
+
** <code>citylights</code> - A texture for using city lights (looks like [Texturefile]wrapx[WrapXValue]wrapy[WrapYValue])  
insideout -- Is the texture inside out? (?)  
+
** <code>insideout</code> - Is the texture inside out? (?)  
 
** For "suns" that do not orbit:
 
** For "suns" that do not orbit:
***x, y, z -- The position of the planet.  
+
*** <code>x</code>, <code>y</code>, <code>z</code> - The position of the planet.  
**For Planets that orbit around another planet:
+
** For Planets that orbit around another planet:
*** ri, rj, rk -- the farthest point of the orbit (vector x,y,z in meters) (see [http://vegastrike.sourceforge.net/forums/viewtopic.php?p=4391#4391 here])  
+
*** <code>ri</code>, <code>rj</code>, <code>rk</code> - the farthest point of the orbit (vector x,y,z in meters) (see [http://forums.vega-strike.org/viewtopic.php?p=4391#4391 here])  
*** si, sj, sk -- the nearest point of the orbit (vector x,y,z in meters)  
+
*** <code>si</code>, <code>sj</code>, <code>sk</code> - the nearest point of the orbit (vector x,y,z in meters)  
** year -- The amount of time for a year (?)  
+
** <code>year</code> - The amount of time for a year (?)  
** day -- The amount of time for a day (?)  
+
** <code>day</code> - The amount of time for a day (?)  
** position -- The current position on the orbiting elipse (in radians).  
+
** <code>position</code> - The current position on the orbiting ellipse (in radians).
** <citylights ... /> -- Lights that appear on a planet.
+
** <code><'''citylights''' ... /></code> - Lights that appear on a planet. The parent object must have planet type.
*** file -- The texture.  
+
*** <code>file</code> - The texture.  
*** alpha -- The blend mode of the texture  
+
*** <code>alpha</code> - The blend mode of the texture  
*** radius -- A radius of the lights (only if different than the planet).  
+
*** <code>radius</code> - A radius of the lights (only if different than the planet).  
*** wrapx, wrapy -- How much the texture wraps.  
+
*** <code>wrapx</code>, <code>wrapy</code> - How much the texture wraps.  
*** insideout -- Is the texture inside out? (?)  
+
*** <code>insideout</code> - Is the texture inside out? (?)
** <atmosphere ... /> -- The atmosphere of the planet (if any)
+
*** <code>VarName</code> [string], <code>VarValue</code> [float] - {{fixme}} seems to be a [[Manual:Config:Advanced:Variables#.22graphics.22_section|graphics/VarName]] confvar based spawn condition (i.e. "add eye-candy only on certain settings").
*** file -- The texture.  
+
** <code><'''atmosphere''' ... /></code> - The clouds of the planet (if any). The parent object must have planet type.
*** alpha -- The blend mode of the texture  
+
*** <code>file</code> - The texture.
*** radius -- the radius of the atmosphere (should be greater than planet's).  
+
**** = "sol/earthcloudmaptrans.png"
** <ring ... /> -- (repeatable) A planetary ring.
+
*** <code>alpha</code> - The blend mode of the texture  
*** file -- The texture.  
+
*** <code>radius</code> - the radius of the atmosphere (should be greater than planet's).  
*** alpha -- The blend mode of the texture  
+
*** <code>insideout</code> - Is the texture inside out? (?)
*** innerradius, outerradius -- the inner/outer radii of the ring (should be greater than planet's and outer should be more than inner).  
+
*** <code>VarName</code> [string], <code>VarValue</code> [float]
*** wrapx, wrapy -- How much the texture wraps.  
+
** <code><'''Terrain''', '''ContinuousTerrain''' ... /></code> - Planet terrains.
*** ri, rj, rk -- the farthest point of the orbit (vector x,y,z in meters) (see [http://vegastrike.sourceforge.net/forums/viewtopic.php?p=4391#4391 here])  
+
*** <code>NumWraps</code>, <code>ScaleX</code>, <code>ScaleAtmosphereHeight</code> - for Continuous Terrain.
*** si, sj, sk -- the nearest point of the orbit (vector x,y,z in meters)  
+
*** <code>file</code> - The texture file. Currently, none are available, even though there are references in system files. {{fixme}}
*** numslices -- ???  
+
*** <code>gravity</code>
** <SpaceElevator> -- (repeatable) An elevator to space (?)
+
*** <code>Mass</code> - Defines position.
*** file -- The file for the elevator.  
+
*** <code>radius</code> - For Terrain.
*** direction -- The direction the elevator goes in. Can be 'd'own, 'u'p, 'l'eft, 'r'ight, 'b'ack or 'f'ront (default).  
+
*** <code>x</code>, <code>y</code>, <code>z</code> - The position.
*** faction -- The faction that owns the elevator.  
+
*** <code>ri</code>, <code>rj</code>, <code>rk</code>
**<unit, building, enhancement, vehicle, asteroid, nebula ... /> -- (repeatable) An object.
+
*** <code>qi</code>, <code>qj</code>, <code>qk</code>
:NOTE that these can NOT have anything orbiting them.  
+
** <code><'''Fog''' ... /></code> - The atmospheric scattering of the planet (if any). <code>graphics/usePlanetFog</code> must be = true. The parent object must have planet type.
*** name -- The name of the unit.  
+
*** <code>OpticalIllusion</code> [boolean] [=true] - Uses halo system instead of making an unit.
*** file -- The name of the unit file.  
+
** <code><'''FogElement''' ... /></code> - Used for stellar atmospheres, in pairs ("atmXatm.bfxm"+"atmXhalo.bfxm"), or even without (in Modelview system - with different alpha), and some test systems.
*** faction -- The name of the unit's faction.  
+
*** Red, Green, Blue, Alfa | alpha -- Specify the value (between <code>0</code> and <code>1</code>) of the color. Emission?
*** destinations -- A space seperated list of the destinations that this will take you to. (usually only one, but more will make the jump point random).  
+
*** DRed, DGreen, DBlue, DAlfa -- Specify the value (between <code>0</code> and <code>1</code>) of the color. Diffuse?
*** insideout -- Is the texture inside out? (?)  
+
*** <code>file</code> - Mesh file.
*** difficulty -- A scaling factor???  
+
*** <code>MinAlpha</code>, <code>MaxAlpha</code>
 +
*** <code>Concavity</code>, <code>Focus</code>
 +
*** <code>TailModeStart</code>, <code>TailModeEnd</code>
 +
*** <code>ScaleAtmosphereHeight</code>
 +
** <code><'''ring''' ... /></code> - <small>(''repeatable'')</small> A planetary ring. The parent object must have planet type.
 +
*** <code>file</code> - The texture.  
 +
*** <code>alpha</code> - The blend mode of the texture  
 +
*** <code>innerradius</code>, <code>outerradius</code> - the inner/outer radii of the ring (should be greater than planet's and outer should be more than inner).  
 +
*** <code>wrapx</code>, <code>wrapy</code> - How much the texture wraps.  
 +
*** <code>ri</code>, <code>rj</code>, <code>rk</code> - the farthest point of the orbit (vector x,y,z in meters) (see [http://forums.vega-strike.org/viewtopic.php?p=4391#4391 here])  
 +
*** <code>si</code>, <code>sj</code>, <code>sk</code> - the nearest point of the orbit (vector x,y,z in meters)  
 +
*** <code>numslices</code> - ???  
 +
*** <code>VarName</code> [string], <code>VarValue</code> [float]
 +
** <code><'''SpaceElevator''' ... /></code> - <small>(''repeatable'')</small> An elevator to space (?) The parent object must have planet type.
 +
*** <code>file</code> - The file for the elevator.  
 +
*** <code>direction</code> - The direction the elevator goes in. Can be <code>d</code>(own), <code>u</code>(p), <code>l</code>(eft), <code>r</code>(ight), <code>b</code>(ack) or <code>f</code>(ront [default]).  
 +
*** <code>faction</code> - The faction that owns the elevator.  
 +
*** <code>VarName</code> [string], <code>VarValue</code> [float]
 +
** <code><'''unit''', '''building''', '''vehicle''', '''asteroid''', '''nebula''', '''enhancement''' ... /></code> - <small>(''repeatable'')</small> An object.
 +
*** NOTE: that these can NOT have anything orbiting them.  
 +
*** <code>name</code> - The name of the unit.  
 +
*** <code>file</code> - The name of the unit file.  
 +
*** <code>faction</code> - The name of the unit's faction.  
 +
*** <code>destinations</code> - A space separated list of the destinations that this will take you to. (usually only one, but more will make the jump point random).
 +
*** <code>insideout</code> - Is the texture inside out? (?)  
 +
*** <code>difficulty</code> - A scaling factor???  
 
*** For units that do not orbit:
 
*** For units that do not orbit:
**** x, y, z -- The position of the planet.  
+
**** <code>x</code>, <code>y</code>, <code>z</code> - The position of the planet.  
 
*** For units that orbit around another planet:
 
*** For units that orbit around another planet:
**** ri, rj, rk -- the farthest point of the orbit (vector x,y,z in meters) (see [http://vegastrike.sourceforge.net/forums/viewtopic.php?p=4391#4391 here])  
+
**** <code>ri</code>, <code>rj</code>, <code>rk</code> - the farthest point of the orbit (vector x,y,z in meters) (see [http://forums.vega-strike.org/viewtopic.php?p=4391#4391 here])  
**** si, sj, sk -- the nearest point of the orbit (vector x,y,z in meters)  
+
**** <code>si</code>, <code>sj</code>, <code>sk</code> - the nearest point of the orbit (vector x,y,z in meters)  
*** year -- The amount of time for a year (?)  
+
*** <code>year</code> - The amount of time for a year (?)  
*** day -- The amount of time for a day (?)  
+
*** <code>day</code> - The amount of time for a day (?)  
*** position -- The current position on the orbiting elipse (in radians).  
+
*** <code>position</code> - The current position on the orbiting ellipse (in radians).
 +
*** <code>VarName</code> [string], <code>VarValue</code> [float] - for asteroid | nebula | enhancement only.
 +
*** <code><Condition ... /></code>
 +
**  <code><'''Condition''' ... /></code> Spawn condition?
 +
*** <code>expression</code>
  
 
==Building a System==
 
==Building a System==
 
To manually create a system, follow these steps;
 
To manually create a system, follow these steps;
* So always put the <system> tags first.  
+
* Always put the <code><system></code> tags first.  
* Next, add X lights in the system, where X is the number of stars in the system.  
+
* Next, add X <code><light></code> tags in the system, where X is the number of stars in the system.  
* After that, insert one object inside the system that has x,y,z coordinates. Give it ReflectNoLight"true" and light "some_light_number" to make it be a sun. The sun should have one of the textures inside the stars/ directory.
+
* After that, insert one object inside the system that has <code>x,y,z</code> coordinates. Give it <code>ReflectNoLight="true"</code> and <code>light="some_light_number"</code> to make it be a sun. The sun should have one of the textures inside the <code>stars/</code> directory.
* Inside that, maybe put another sun orbitting the first sun if the system is binary.  
+
* Inside that, maybe put another sun orbiting the first sun if the system is binary.
* Add a bunch of planets, and add units or more planets around those. Planets' textures should be inside the planets directory. You can also have a nebula or an asteroid field if you want.
+
* Add a bunch of planets, and add units or more planets around those. Planets' textures should be inside the <code>planets</code> directory. You can also have a nebula or an asteroid field if you want.
 +
* Finally, close with the <code></system></code> tag.
  
 
Note that for a completely circular orbit, make ri=sk, rj=sj and rk=si. <ri,rj,rk> Is the relative position to the planet when position=0. <si,sj,sk> is the relative position to the planet when position=1.57 (PI/2). Then make position 0 (normally) and set day to a fairly high number and year to be extremely high.
 
Note that for a completely circular orbit, make ri=sk, rj=sj and rk=si. <ri,rj,rk> Is the relative position to the planet when position=0. <si,sj,sk> is the relative position to the planet when position=1.57 (PI/2). Then make position 0 (normally) and set day to a fairly high number and year to be extremely high.
  
[[Category:HowTo|Edit Systems]]
+
==Examples==
 +
 +
* For a simple example, see the '''[http://vegastrike.svn.sourceforge.net/viewvc/vegastrike/trunk/data/sectors/Crucible/Cephid_17.system?revision=HEAD&view=markup Cephid_17.system]'''
 +
* For a more complex system, see '''[http://vegastrike.svn.sourceforge.net/viewvc/vegastrike/trunk/data/sectors/Sol/Sol.system?revision=HEAD&view=markup Sol.system]'''
 +
 
 +
=See also=
 +
* [[HowTo:Edit Systems:Milkyway|Editing systems using Milky_way.XML]]
 +
 
 +
[[Category:HowTos|Edit Systems]]
 
[[Category:Development|Edit Systems]]
 
[[Category:Development|Edit Systems]]

Latest revision as of 15:12, 9 February 2014

thumb_arrow_up.png Edit Systems

"Hand-made" System Files

These systems take much longer, because you have to do all of the generator's work by hand. Although you may think that using the milky_way.xml file is so much better for that reason, think about systems like Sol (sol_sector/sol) where you want exact exactness to occur in the system file because adventurers who explore it will look at every detail that can not be perfected with even random numbers. I used this method for the starting system in the 3.x releases, enigma_sector/heavens_gate.system

XML schema description

<system> ... </system> -- Marks the beginning and end of the XML file.

  • name -- The name of the system.
  • ScaleSystem - The scale of the system.
    • = 1 (default)

FIXME : ScaleSystem is an optional parameter, but this is not indicated. Besides indicating which parameters are optional, versus mandatory; for optional parameters there needs to be information about their default values. (chuck_starchaser)

  • reflectivity [float] - ??? Not actually used.
    • = (graphics/reflectivity=.2)
  • background - The background cube map to use (NO extension like .png, .jpg, etc.)
    • = "cube"
  • backgroundColor (r g b a)
    • = 1.0, 1.0, 1.0, 1.0 (default)
  • backgroundDegamma [bool] - ? Not actually used.
    • = false (default)
  • fadestars - ? Not actually used.
    • = ! (physics/game_speed_affects_autogen_systems = false) = true
  • nearstars - The number of near stars at a given time.
  • stars - The number of (far?) stars at a given time.
  • starspread - The distance between the stars (?).
  • x, y, z - The coordinates of the system. Implemented long ago for possible use with a map, but not used yet.
  • <light> ... </light> - (repeatable) Creates a light that can be referenced later.
    • <attenuated> ... </attenuated> - Specifies the color of attenuated light that is generated.
      • red, green, blue, alfa -- Specify the value (between 0 and 1) of the color.
    • <ambient> ... </ambient> - Specifies the color of ambient light that is generated.
      • red, green, blue, alfa -- Specify the value (between 0 and 1) of the color.
    • <diffuse> ... </diffuse> - Specifies the color of diffuse light that is generated.
      • red, green, blue, alfa -- Specify the value (between 0 and 1) of the color.
    • <specular> ... </specular> - Specifies the color of specular light that is generated.
      • red, green, blue, alfa -- Specify the value (between 0 and 1) of the color.
  • <planet> ... </planet> - (repeatable) (ALIAS: jump) This tag creates a planet (or sun if it generates light).
    • NOTE: planets and jumps can have any (not light) tags nested inside. This creates the nested tag orbiting around the planets.
    • name - The name of the planet.
    • file - The texture of the planet (also used to decide which products are sold).
    • radius - The radius of the planet.
    • alpha - The blend mode of the texture
    • gravity - The gravity of the planet. I think that it only affects other planets orbiting it, not units.
    • red, green, blue, alfa -- The color of the planet (not the color of the light it generates). I think that "alfa" is correct, not "alpha".
    • ReflectNoLight - does the planet not reflect light? Defaults to false, do you shouldn't have to worry about this most of the time.
    • light - A reference to one of the lights above that this sun generates. This is the criteria for a planet becoming a sun.
    • destinations - A space separated list of the destinations that this jump point will take you to. (usually only one, but more will make the jump point random). NOTE that the presence of this attribute is the only criteria for the planet being a jump point, not the name of the tag, which is just to make it clearer.
    • citylights - A texture for using city lights (looks like [Texturefile]wrapx[WrapXValue]wrapy[WrapYValue])
    • insideout - Is the texture inside out? (?)
    • For "suns" that do not orbit:
      • x, y, z - The position of the planet.
    • For Planets that orbit around another planet:
      • ri, rj, rk - the farthest point of the orbit (vector x,y,z in meters) (see here)
      • si, sj, sk - the nearest point of the orbit (vector x,y,z in meters)
    • year - The amount of time for a year (?)
    • day - The amount of time for a day (?)
    • position - The current position on the orbiting ellipse (in radians).
    • <citylights ... /> - Lights that appear on a planet. The parent object must have planet type.
      • file - The texture.
      • alpha - The blend mode of the texture
      • radius - A radius of the lights (only if different than the planet).
      • wrapx, wrapy - How much the texture wraps.
      • insideout - Is the texture inside out? (?)
      • VarName [string], VarValue [float] - FIXME seems to be a graphics/VarName confvar based spawn condition (i.e. "add eye-candy only on certain settings").
    • <atmosphere ... /> - The clouds of the planet (if any). The parent object must have planet type.
      • file - The texture.
        • = "sol/earthcloudmaptrans.png"
      • alpha - The blend mode of the texture
      • radius - the radius of the atmosphere (should be greater than planet's).
      • insideout - Is the texture inside out? (?)
      • VarName [string], VarValue [float]
    • <Terrain, ContinuousTerrain ... /> - Planet terrains.
      • NumWraps, ScaleX, ScaleAtmosphereHeight - for Continuous Terrain.
      • file - The texture file. Currently, none are available, even though there are references in system files. FIXME
      • gravity
      • Mass - Defines position.
      • radius - For Terrain.
      • x, y, z - The position.
      • ri, rj, rk
      • qi, qj, qk
    • <Fog ... /> - The atmospheric scattering of the planet (if any). graphics/usePlanetFog must be = true. The parent object must have planet type.
      • OpticalIllusion [boolean] [=true] - Uses halo system instead of making an unit.
    • <FogElement ... /> - Used for stellar atmospheres, in pairs ("atmXatm.bfxm"+"atmXhalo.bfxm"), or even without (in Modelview system - with different alpha), and some test systems.
      • Red, Green, Blue, Alfa | alpha -- Specify the value (between 0 and 1) of the color. Emission?
      • DRed, DGreen, DBlue, DAlfa -- Specify the value (between 0 and 1) of the color. Diffuse?
      • file - Mesh file.
      • MinAlpha, MaxAlpha
      • Concavity, Focus
      • TailModeStart, TailModeEnd
      • ScaleAtmosphereHeight
    • <ring ... /> - (repeatable) A planetary ring. The parent object must have planet type.
      • file - The texture.
      • alpha - The blend mode of the texture
      • innerradius, outerradius - the inner/outer radii of the ring (should be greater than planet's and outer should be more than inner).
      • wrapx, wrapy - How much the texture wraps.
      • ri, rj, rk - the farthest point of the orbit (vector x,y,z in meters) (see here)
      • si, sj, sk - the nearest point of the orbit (vector x,y,z in meters)
      • numslices - ???
      • VarName [string], VarValue [float]
    • <SpaceElevator ... /> - (repeatable) An elevator to space (?) The parent object must have planet type.
      • file - The file for the elevator.
      • direction - The direction the elevator goes in. Can be d(own), u(p), l(eft), r(ight), b(ack) or f(ront [default]).
      • faction - The faction that owns the elevator.
      • VarName [string], VarValue [float]
    • <unit, building, vehicle, asteroid, nebula, enhancement ... /> - (repeatable) An object.
      • NOTE: that these can NOT have anything orbiting them.
      • name - The name of the unit.
      • file - The name of the unit file.
      • faction - The name of the unit's faction.
      • destinations - A space separated list of the destinations that this will take you to. (usually only one, but more will make the jump point random).
      • insideout - Is the texture inside out? (?)
      • difficulty - A scaling factor???
      • For units that do not orbit:
        • x, y, z - The position of the planet.
      • For units that orbit around another planet:
        • ri, rj, rk - the farthest point of the orbit (vector x,y,z in meters) (see here)
        • si, sj, sk - the nearest point of the orbit (vector x,y,z in meters)
      • year - The amount of time for a year (?)
      • day - The amount of time for a day (?)
      • position - The current position on the orbiting ellipse (in radians).
      • VarName [string], VarValue [float] - for asteroid | nebula | enhancement only.
      • <Condition ... />
    • <Condition ... /> Spawn condition?
      • expression

Building a System

To manually create a system, follow these steps;

  • Always put the <system> tags first.
  • Next, add X <light> tags in the system, where X is the number of stars in the system.
  • After that, insert one object inside the system that has x,y,z coordinates. Give it ReflectNoLight="true" and light="some_light_number" to make it be a sun. The sun should have one of the textures inside the stars/ directory.
  • Inside that, maybe put another sun orbiting the first sun if the system is binary.
  • Add a bunch of planets, and add units or more planets around those. Planets' textures should be inside the planets directory. You can also have a nebula or an asteroid field if you want.
  • Finally, close with the </system> tag.

Note that for a completely circular orbit, make ri=sk, rj=sj and rk=si. <ri,rj,rk> Is the relative position to the planet when position=0. <si,sj,sk> is the relative position to the planet when position=1.57 (PI/2). Then make position 0 (normally) and set day to a fairly high number and year to be extremely high.

Examples

See also