Advertisement
hilaupreppaji-1841

X4: Foundations Sector Creation Tutorial 1.00

Nov 25th, 2022
460
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 48.42 KB | Gaming | 0 0
  1. X4: Foundations Sector Creation Tutorial 1.00
  2.  
  3.  
  4.  
  5. This is a tutorial for adding a new sector to the game.
  6.  
  7. I will be using the initialism xymn a lot here, it stands for x your mod name, replace it with the
  8. name of your mod.
  9.  
  10. If you haven't already then unpack your game files. https://forum.egosoft.com/viewtopic.php?t=402452
  11.  
  12. I recommend reading and editing your .xml files with Notepad++ https://notepad-plus-plus.org/
  13.  
  14.  
  15.  
  16. Credit to:
  17.  
  18. enenra for this tutorial https://github.com/enenra/x4modding/wiki/Universe-Creation
  19.  
  20. Dr Reed for their mod New Horizons / Old Lands I learned from https://forum.egosoft.com/viewtopic.php?t=441685
  21.  
  22. Sheglov for their mod XPANed Sectors Advanced I also learned from https://forum.egosoft.com/viewtopic.php?t=441236
  23.  
  24. Roguey for their brilliant site https://roguey.co.uk/x4/universe/
  25.  
  26. euclid for this mod that sped up checking sectors in-game https://forum.egosoft.com/viewtopic.php?t=406885
  27.  
  28. iseeu0 for cheatz https://www.moddb.com/mods/iseeu0-cheat/downloads/x4-foundations-cheat-menu-no-player-mods
  29.  
  30. This site for converting between quaternions and Euler angles https://quaternions.online/
  31.  
  32.  
  33.  
  34.  
  35. Part 0: The absolutely necessary content.xml file
  36.  
  37. Create a content.xml file under extensions\xymn\ and put this in it:
  38.  
  39. <?xml version="1.0" encoding="utf-8"?>
  40. <content id="xymn" name="X Your Mod Name" description="Adds a cluster and sector" author="You" version="1.00" date="20XX-XX-XX" save="1" enabled="1">
  41. </content>
  42.  
  43.  
  44.  
  45.  
  46. Part 1: Adding a cluster, a sector, a zone, and naming them.
  47.  
  48. Create the following files in the root directory:
  49.  
  50. extensions\xymn\index\macros.xml
  51. extensions\xymn\libraries\mapdefaults.xml
  52. extensions\xymn\maps\xu_ep2_universe\galaxy.xml
  53. extensions\xymn\maps\xu_ep2_universe\xymn_clusters.xml
  54. extensions\xymn\maps\xu_ep2_universe\xymn_sectors.xml
  55. extensions\xymn\maps\xu_ep2_universe\xymn_zones.xml
  56. extensions\xymn\t\0001.xml
  57.  
  58. 1.1
  59.  
  60. In galaxy.xml add the following:
  61.  
  62. <?xml version="1.0" encoding="utf-8"?>
  63. <diff>
  64.   <add sel="/macros/macro[@name='XU_EP2_universe_macro']/connections">
  65.     <!-- XYMN Cluster -->
  66.     <connection name="xymn_cluster_xymnc001_connection" ref="clusters">
  67.       <offset>
  68.         <position x="-240000000" y="0" z="0"/>
  69.       </offset>
  70.       <macro ref="xymn_cluster_xymnc001_macro" connection="galaxy"/>
  71.     </connection>
  72.   </add>
  73. </diff>
  74.  
  75. This is an XML patch, it will add in this section of code when the mod is turned on, you can learn
  76. more about XML patches here https://forum.egosoft.com/viewtopic.php?t=354310 and here
  77. https://forum.egosoft.com/viewtopic.php?t=347831.
  78.  
  79. In short, 'diff' means you're making some difference to the base game's files, and 'add' means
  80. you're adding something, 'sel' is the location of the base game file as well as the location in
  81. that file that will be temporarily altered when the mod is turned on.
  82.  
  83. Anything between a <!-- and a --> is a comment and will be ignored by the game, useful for keeping
  84. a note on what bits of code mean.
  85.  
  86. In the line under the comment is the connection alias for the cluster we're adding, basically it's
  87. a code name for the cluster we use when we're "connecting" the universe together, clusters "connect"
  88. to sectors, sectors "connect" to zones. The base game and DLC files all use the _connection suffix
  89. to distinguish them and I'll be doing the same here.
  90.  
  91. What is the rest of the name before the suffix though? The first part is something to mark these
  92. entries as something we're adding, xymn here standing for x your mod name, change this to something
  93. else short that relates to the name of your mod. For the second part I simply write out what it is
  94. we're talking about, in this case a cluster. Lastly (aside from the suffix) I've put xymn followed
  95. by c001, which to me tells me it's the first cluster I'm adding in the xymn mod, if this was the
  96. first sector in this first cluster I'd use xymnc001xymns001, why use xymn there twice? Well,
  97. sometimes I'm adding a zone to a vanilla sector already in the game, and when I do that, I would use
  98. something like the specification vanc001vans001xymnz001, for a zone added to a DLC sector I might
  99. use splc001spls001xymnz001, terc001ters001xymnz001, or pirc001pirs001xymnz001, depending on the DLC.
  100. At a glance I can then see where these zones reside.
  101.  
  102. Position is the location on the map the cluster will appear, but because the map uses hexagons the
  103. co-ordinates can be a little unintuitive to work with. To make it as simple as possible: for every
  104. step east (north-east or south-east) or west (north-west or south-west) you want to move away from
  105. 0,0 (Grand Exchange) multiply it by 15000 to get the X value, and for every step north or south
  106. multiply it by 8860 to get the Z value; moving directly north or south counts as two steps; a change
  107. of 17320 (2 * 8860).
  108.  
  109. The map co-ordinates are actually just an every-other-column offset of a simple x/y plot.
  110.  
  111.            -4      -3      -2      -1       0       1       2       3       4
  112.  
  113.                 [-3 , 2]        [-1 , 2]        [+1 , 2]        [+3 , 2]
  114. 2
  115.         [-4 , 2]        [-2 , 2]        [ 0 , 2]        [+2 , 2]        [+4 , 2]
  116.  
  117.                 [-3 , 1]        [-1 , 1]        [+1 , 1]        [+3 , 1]
  118. 1
  119.         [-4 , 1]        [-2 , 1]        [ 0 , 1]        [+2 , 1]        [+4 , 1]
  120.                                             |
  121.                 [-3 , 0]        [-1 , 0]    |   [+1 , 0]        [+3 , 0]
  122. 0                                      \    |   /
  123.         [-4 , 0]        [-2 , 0]        [ 0 , 0]        [+2 , 0]        [+4 , 0]
  124.                                        /    |   \
  125.                 [-3 ,-1]        [-1 ,-1]    |   [+1 ,-1]        [+3 ,-1]
  126. -1                                          |
  127.         [-4 ,-1]        [-2 ,-1]        [ 0 ,-1]        [+2 ,-1]        [+4 ,-1]
  128.  
  129.                 [-3 ,-2]        [-1 ,-2]        [+1 ,-2]        [+3 ,-2]
  130. -2
  131.         [-4 ,-2]        [-2 ,-2]        [ 0 ,-2]        [+2 ,-2]        [+4 ,-2]
  132.  
  133. If you want to move from 0,0 which is <position x="0" y="0" z="0"/> to 3,1 then you'd move 3 * 15000
  134. = 45000 for X, and 1 * 8860 = 8860 for Z giving you <position x="45000" y="0" z="8860"/>.
  135.  
  136. <position x="-240000000" y="0" z="0"/> as I've used is -12,0 in the far west near the terran DLC
  137. sectors.
  138.  
  139. The next line of interest after position mentions a macro and a connection, this is similar to the
  140. connection alias, and you can see the difference is simply that I've put a _macro suffix on the end
  141. instead of a _connection suffix, I believe this alias directs the game to look in the macros.xml file
  142. to tell it where to look for things related to the cluster.
  143.  
  144. 1.2
  145.  
  146. In xymn_clusters.xml add the following:
  147.  
  148. <?xml version="1.0" encoding="utf-8"?>
  149. <macros>
  150.   <!-- XYMN Cluster -->
  151.   <macro name="xymn_cluster_xymnc001_macro" class="cluster">
  152.     <component ref="standardcluster"/>
  153.     <connections>
  154.       <!-- XYMN Sector -->
  155.       <connection name="xymn_sector_xymnc001xymns001_connection" ref="sectors">  
  156.         <macro ref="xymn_sector_xymnc001xymns001_macro" connection="cluster"/>
  157.       </connection>
  158.       <connection ref="content">
  159.         <macro>
  160.           <component connection="space" ref="xymn_cluster_xymnc001"/>
  161.         </macro>
  162.       </connection>
  163.     </connections>
  164.   </macro>
  165. </macros>
  166.  
  167. You'll notice we seem to be adding the cluster again; for clusters, sectors, zones, and regions,
  168. there will be two corresponding entries that "connect" together, notice we're adding the first
  169. half of the code we need to add for the sector in this xymn_clusters.xml file, in the sectors file
  170. we'll be adding the second half, and also the first half of the zones code for zones in that sector.
  171.  
  172. The second <connection> block connects the sector to... space? Without this block your sector wont
  173. appear on the map, that's about as much as I know.
  174.  
  175. 1.3
  176.  
  177. In xymn_sectors.xml add the following:
  178.  
  179. <?xml version="1.0" encoding="utf-8"?>
  180. <macros>
  181.   <!-- XYMN Sector -->
  182.   <macro name="xymn_sector_xymnc001xymns001_macro" class="sector">
  183.     <component ref="standardsector"/>
  184.     <connections>
  185.       <!-- XYMN Zone -->
  186.       <connection name="xymn_zone_xymnc001xymns001xymnz001_connection" ref="zones">
  187.         <offset>
  188.           <position x="0" y="0" z="0"/>
  189.         </offset>
  190.         <macro ref="xymn_zone_xymnc001xymns001xymnz001_macro" connection="sector"/>
  191.       </connection>
  192.     </connections>
  193.   </macro>
  194. </macros>
  195.  
  196. Very much the same as xymn_clusters.xml, but here we get to define where the zone will be, 0,0,0
  197. being the centre, these numbers are in meters, if you want to place your gates in the middle of
  198. your zones you may want to place your zone accordingly. 100000 is a good distance from the centre,
  199. +x is east, -x is west, +z is north, -z is south, +y is upwards, -y is downwards.
  200.  
  201. 1.4
  202.  
  203. In xymn_zones.xml add the following:
  204.  
  205. <?xml version="1.0" encoding="utf-8"?>
  206. <macros xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  207.   <!-- XYMN Zone -->
  208.   <macro name="xymn_zone_xymnc001xymns001xymnz001_macro" class="zone">
  209.     <component ref="standardzone"/>
  210.     <connections>
  211.     </connections>
  212.   </macro>
  213. </macros>
  214.  
  215. Similar again, just without anything smaller to connect to.
  216.  
  217. 1.5
  218.  
  219. In macros.xml add the following:
  220.  
  221. <?xml version="1.0" encoding="utf-8"?>
  222. <index>
  223.   <entry name="xymn_galaxy_macro" value="extensions\xymn\maps\XU_ep2_universe\galaxy"/>
  224.   <entry name="xymn_cluster*" value="extensions\xymn\maps\XU_ep2_universe\xymn_clusters"/>
  225.   <entry name="xymn_sector*" value="extensions\xymn\maps\XU_ep2_universe\xymn_sectors"/>
  226.   <entry name="xymn_zone*" value="extensions\xymn\maps\XU_ep2_universe\xymn_zones"/>
  227. </index>
  228.  
  229. This file helps connect things together, or something, I think when the game reads a line like
  230. <macro ref="xymn_zone_xymnc001xymns001xymnz001_macro" connection="sector"/> then it knows to look at
  231. the macros.xml file to find where xymn_zone_xymnc001xymns001xymnz001_macro points to, in this case
  232. reading xymn_zone... in xymn_clusters sends it to xymn_zones.xml.
  233. The * is a wildcard, use this so it doesn't require an exact match, xymn_zone* will match anything
  234. that starts with xymn_zone.
  235.  
  236. 1.6
  237.  
  238. In mapdefaults.xml add the following:
  239.  
  240. <?xml version="1.0" encoding="utf-8"?>
  241. <defaults xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="libraries.xsd">
  242.   <!-- XYMN Cluster -->
  243.   <dataset macro="xymn_cluster_xymnc001_macro">
  244.     <properties>
  245.       <identification name="{900001,100001}" description="{900001,100002}"/>
  246.       <area sunlight="1.0" economy="0.0" security="0.0"/>
  247.       <system>
  248.       </system>
  249.     </properties>
  250.   </dataset>
  251.   <!-- XYMN Sector -->
  252.   <dataset macro="xymn_sector_xymnc001xymns001_macro">
  253.     <properties>
  254.       <identification name="{900001,100003}" description="{900001,100004}"/>
  255.       <area sunlight="1.0" economy="0.0" security="0.0"/>
  256.       <system>
  257.       </system>
  258.     </properties>
  259.   </dataset>
  260. </defaults>
  261.  
  262. You can see the first bit is for the cluster, and the second bit is for the sector, this file partly
  263. names each, but also defines its sunlight, economy, and security numbers in the encyclopaedia.
  264. 900001,100001 isn't much of a name though, right? These numbers point to something in the 0001.xml
  265. file, so let's open that up.
  266.  
  267. 1.7
  268.  
  269. In 0001.xml add the following:
  270.  
  271. <?xml version="1.0" encoding="utf-8"?>
  272. <diff>
  273.   <add sel="/language">
  274.     <page id="900001" voice="no">
  275.       <t id="100001">Cluster Name</t>
  276.       <t id="100002">Description for Cluster.</t>
  277.       <t id="100003">Sector Name</t>
  278.       <t id="100004">Description for Sector.</t>
  279.     </page>
  280.   </add>
  281. </diff>
  282.  
  283. Replace 'Cluster Name' with what you want to call your cluster, and 'Sector Name' with what you want
  284. to call your sector, and fill in the descriptions too.
  285.  
  286.  
  287.  
  288.  
  289. Part 2: Gates
  290.  
  291. Open up these files:
  292.   xymn\maps\xu_ep2_universe\galaxy.xml
  293.   xymn\maps\xu_ep2_universe\xymn_zones.xml
  294.  
  295. Create and open this:
  296.   xymn\md\setup_xymn.xml
  297.  
  298. 2.1
  299.  
  300. In xymn_zones.xml we're going to insert the following:
  301.  
  302.       <!-- XYMN Gate to ??? -->
  303.       <connection name="xymn_gate_xymnc001xymns001xymnz001_???_connection" ref="gates">
  304.         <offset>
  305.           <position x="0" y="0" z="0"/>
  306.           <rotation yaw="0" pitch="0" roll="0"/>
  307.         </offset>
  308.         <macro ref="props_gates_anc_gate_macro" connection="space"/>
  309.       </connection>
  310.  
  311. ... and we're going to insert it between <connections> and </connections> ...
  312.  
  313. <?xml version="1.0" encoding="utf-8"?>
  314. <macros xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  315.   <!-- XYMN Zone -->
  316.   <macro name="xymn_zone_xymnc001xymns001xymnz001_macro" class="zone">
  317.     <component ref="standardzone"/>
  318.     <connections>
  319.  
  320.     </connections>
  321.   </macro>
  322. </macros>
  323.  
  324. ... to get ...
  325.  
  326. <?xml version="1.0" encoding="utf-8"?>
  327. <macros xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  328.   <!-- XYMN Zone -->
  329.   <macro name="xymn_zone_xymnc001xymns001xymnz001_macro" class="zone">
  330.     <component ref="standardzone"/>
  331.     <connections>
  332.       <!-- XYMN Gate to ??? -->
  333.       <connection name="xymn_gate_xymnc001xymns001xymnz001_???_connection" ref="gates">
  334.         <offset>
  335.           <position x="0" y="0" z="0"/>
  336.           <rotation yaw="0" pitch="0" roll="0"/>
  337.         </offset>
  338.         <macro ref="props_gates_anc_gate_macro" connection="space"/>
  339.       </connection>
  340.     </connections>
  341.   </macro>
  342. </macros>
  343.  
  344. Now we have a gate in the zone we made earlier, this gate however is going nowhere, we need to make
  345. another one to connect it to, before that you might want to change the direction this gate faces;
  346. the numbers of yaw="0" pitch="0" roll="0" are in degrees. 0 yaw for a south gate, 90 yaw for a west
  347. gate, 180 for north, 270 for east. Also, you can turn gates into accelerators; simply switch out
  348. props_gates_anc_gate_macro with props_gates_orb_accelerator_01_macro.
  349.  
  350. 2.2
  351.  
  352. Where do you want to link your sector to? If it's a vanilla sector then create these files:
  353. extensions\xymn\maps\xu_ep2_universe\sectors.xml
  354. extensions\xymn\maps\xu_ep2_universe\zones.xml
  355.  
  356. If it's a Split Vendetta sector then create these files:
  357. extensions\xymn\extensions\ego_dlc_split\maps\xu_ep2_universe\dlc4_sectors.xml
  358. extensions\xymn\extensions\ego_dlc_split\maps\xu_ep2_universe\dlc4_zones.xml
  359.  
  360. If it's a Cradle of Humanity sector then create these files:
  361. extensions\xymn\extensions\ego_dlc_terran\maps\xu_ep2_universe\dlc_terran_sectors.xml
  362. extensions\xymn\extensions\ego_dlc_terran\maps\xu_ep2_universe\dlc_terran_zones.xml
  363.  
  364. If it's a Tides of Avarice sector then create these files:
  365. extensions\xymn\extensions\ego_dlc_pirate\maps\xu_ep2_universe\dlc_pirate_sectors.xml
  366. extensions\xymn\extensions\ego_dlc_pirate\maps\xu_ep2_universe\dlc_pirate_zones.xml
  367.  
  368. How can you tell which DLC a sector belongs to? There are a few ways if you search around, but one
  369. way is to look up the sector on Roguey's incredibly helpful site https://roguey.co.uk/x4/universe/
  370. and look at the url, if the cluster is a three digit number such as 104 then it's a DLC sector, if
  371. that three digit number starts with a 1 then it's a Cradle of Humanity cluster, if it starts with a
  372. 4 it's a Split Vendetta cluster, and if it starts with a 5 then it's a Tides of Avarice cluster.
  373.  
  374. 2.3
  375.  
  376. Open up the sectors.xml/dlc4_sectors.xml/dlc_terran_sectors.xml/dlc_pirate_sectors.xml file you
  377. just made and add:
  378.  
  379. <?xml version="1.0" encoding="utf-8"?>
  380. <diff xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
  381.   <!-- Grand Exchange I Sector -->
  382.   <add sel="//macros/macro[@name='Cluster_01_Sector001_macro']/connections">
  383.     <!-- Grand Exchange I Zone -->
  384.     <connection name="xymn_zone_vanc001vans001xymnz001_connection" ref="zones">
  385.       <offset>
  386.         <position x="0" y="0" z="0"/>
  387.       </offset>
  388.       <macro ref="xymn_zone_vanc001vans001xymnz001_macro" connection="sector"/>
  389.     </connection>
  390.   </add>
  391. </diff>
  392.  
  393. This will add a zone to Grand Exchange I, you will likely want to change it to another sector,
  394. look up the sector you want on Roguey's fantastically amazing site https://roguey.co.uk/x4/universe/
  395. and note down the url; for example, Getsu Fune's sector's url is:
  396. https://roguey.co.uk/x4/universe/cluster_48_macro/cluster_48_sector001_macro/
  397.  
  398. To change where we're putting this zone, we need to change this line:
  399. <add sel="//macros/macro[@name='Cluster_01_Sector001_macro']/connections">
  400. Specifically, this part: Cluster_01_Sector001_macro, or even more specifically: Cluster_01_Sector001.
  401. You can probably already see what we'll change it to, if we want the zone to be in Getsu Fune.
  402. Replace Cluster_01_Sector001 with Cluster_48_Sector001 and we get:
  403. <add sel="//macros/macro[@name='Cluster_48_Sector001_macro']/connections">
  404.  
  405. Adjust the connection and macro entries beneath this; for Getsu Fune I would enter:
  406. xymn_zone_vanc048vans001xymnz001_connection and xymn_zone_vanc001vans048xymnz001_macro
  407.  
  408. 2.4
  409.  
  410. Now open the zones.xml file and add:
  411.  
  412. <?xml version="1.0" encoding="utf-8"?>
  413. <diff>
  414.   <!-- Grand Exchange I Zone -->
  415.   <add sel="/macros" silent="true">
  416.     <macro name="xymn_zone_vanc001vans001xymnz001_macro" class="zone">
  417.       <component ref="standardzone"/>
  418.       <connections>
  419.       <!-- Grand Exchange I Gate to XYMN Sector -->
  420.         <connection name="xymn_gate_vanc001vans001xymnz001_xymnc001xymns001xymnz001_connection" ref="gates">
  421.           <offset>
  422.             <position x="0" y="0" z="0"/>
  423.             <rotation yaw="0" pitch="0" roll="0"/>
  424.           </offset>
  425.           <macro ref="props_gates_anc_gate_macro" connection="space"/>
  426.         </connection>
  427.       </connections>
  428.     </macro>
  429.   </add>
  430. </diff>
  431.  
  432. Can you see what to change here? If we're creating a gate in Getsu Fune let's change each instance
  433. of vanc001 to vanc048. Let's look at why that connection name is so long too, it seems to specify
  434. two zones, well, the first long string is where I'm putting the gate, and the second string is the
  435. destination zone, it makes it easy to understand at a glance what's going on, you don't have to use
  436. this naming convention, I just find it intuitive.
  437.  
  438. 2.5
  439.  
  440. Let's go back to xymn_zones.xml, If we want to go to Grand Exchange I let's change those ???s:
  441.  
  442. <?xml version="1.0" encoding="utf-8"?>
  443. <macros xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  444.   <!-- XYMN Zone -->
  445.   <macro name="xymn_zone_xymnc001xymns001xymnz001_macro" class="zone">
  446.     <component ref="standardzone"/>
  447.     <connections>
  448.       <!-- XYMN Gate to Grand Exchange I -->
  449.       <connection name="xymn_gate_xymnc001xymns001xymnz001_vanc001vans001xymnz001_connection" ref="gates">
  450.         <offset>
  451.           <position x="0" y="0" z="0"/>
  452.           <rotation yaw="0" pitch="0" roll="0"/>
  453.         </offset>
  454.         <macro ref="props_gates_anc_gate_macro" connection="space"/>
  455.       </connection>
  456.     </connections>
  457.   </macro>
  458. </macros>
  459.  
  460. Remember to change vanc001vans001 to vanc048vans001 for Getsu Fune, or to whatever number is right
  461. for the sector you're using.
  462.  
  463. 2.6
  464.  
  465. These gates are as yet unconnected, so let's connect them in galaxy.xml, insert this:
  466.  
  467.     <!-- Gate Connection: XYMN Sector to Grand Exchange I -->
  468.     <connection name="xymn_gate_xymnc001xymns001xymnz001_vanc001vans001xymnz001" ref="destination" path="../xymn_cluster_xymnc001_connection/xymn_sector_xymnc001xymns001_connection/xymn_zone_xymnc001xymns001xymnz001_connection/xymn_gate_xymnc001xymns001xymnz001_vanc001vans001xymnz001_connection">
  469.       <macro connection="destination" path="../../../../../Cluster_01_connection/Cluster_01_Sector001_connection/xymn_zone_vanc001vans001xymnz001_connection/xymn_gate_vanc001vans001xymnz001_xymnc001xymns001xymnz001_connection"/>
  470.     </connection>
  471.  
  472. ... between </connection> and </add> ...
  473.  
  474. <?xml version="1.0" encoding="utf-8"?>
  475. <diff>
  476.   <add sel="/macros/macro[@name='XU_EP2_universe_macro']/connections">
  477.     <!-- XYMN Cluster -->
  478.     <connection name="xymn_cluster_xymnc001_connection" ref="clusters">
  479.       <offset>
  480.         <position x="-240000000" y="0" z="0"/>
  481.       </offset>
  482.       <macro ref="xymn_cluster_xymnc001_macro" connection="galaxy"/>
  483.     </connection>
  484.  
  485.   </add>
  486. </diff>
  487.  
  488. ... to get ...
  489.  
  490. <?xml version="1.0" encoding="utf-8"?>
  491. <diff>
  492.   <add sel="/macros/macro[@name='XU_EP2_universe_macro']/connections">
  493.     <!-- XYMN Cluster -->
  494.     <connection name="xymn_cluster_xymnc001_connection" ref="clusters">
  495.       <offset>
  496.         <position x="-240000000" y="0" z="0"/>
  497.       </offset>
  498.       <macro ref="xymn_cluster_xymnc001_macro" connection="galaxy"/>
  499.     </connection>
  500.     <!-- Gate Connection: XYMN Sector to Grand Exchange I -->
  501.     <connection name="xymn_gate_xymnc001xymns001xymnz001_vanc001vans001xymnz001" ref="destination" path="../xymn_cluster_xymnc001_connection/xymn_sector_xymnc001xymns001_connection/xymn_zone_xymnc001xymns001xymnz001_connection/xymn_gate_xymnc001xymns001xymnz001_vanc001vans001xymnz001_connection">
  502.       <macro connection="destination" path="../../../../../Cluster_01_connection/Cluster_01_Sector001_connection/xymn_zone_vanc001vans001xymnz001_connection/xymn_gate_vanc001vans001xymnz001_xymnc001xymns001xymnz001_connection"/>
  503.     </connection>
  504.   </add>
  505. </diff>
  506.  
  507. 2.7
  508.  
  509. We need to connect them in setup_xymn.xml too, so add this:
  510.  
  511. <?xml version="1.0" encoding="utf-8"?>
  512. <mdscript name="Setup_xymn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="md.xsd">
  513.   <cues>
  514.     <!-- Find Clusters -->
  515.     <cue name="xymn_Start" checktime="0.1s" checkinterval="0.5s" version="2">
  516.       <check_all>
  517.         <event_game_loaded/>
  518.       </check_all>
  519.       <actions>
  520.         <find_zone name="md.$xymn_zone_xymnc001xymns001xymnz001" macro="macro.xymn_zone_xymnc001xymns001xymnz001_macro"/>
  521.         <find_zone name="md.$xymn_zone_vanc001vans001xymnz001" macro="macro.xymn_zone_vanc001vans001xymnz001_macro"/>
  522.       </actions>
  523.     </cue>
  524.     <!-- Activate Gates between XYMN Sector and Grand Exchange I -->
  525.     <cue name="ActivateGate_xymnc001xymns001xymnz001_vanc001vans001xymnz001">
  526.       <conditions>
  527.         <check_all>
  528.           <event_cue_signalled cue="xymn_Start"/>
  529.         </check_all>
  530.       </conditions>
  531.       <cues>
  532.         <cue name="ActivateGate_Wait" checkinterval="0.1s">
  533.           <actions>
  534.             <find_object groupname="$Gates" class="class.gate" space="md.$xymn_zone_xymnc001xymns001xymnz001" required="true"/>
  535.             <find_object groupname="$Gates" class="class.gate" space="md.$xymn_zone_vanc001vans001xymnz001" required="true"/>
  536.             <do_all exact="$Gates.count" counter="$i">
  537.               <set_value name="$Gate" exact="$Gates.{$i}"/>
  538.               <do_if value="not $Gate.isactive and $Gate.exit.exists">
  539.                 <debug_text text="player.module + ': Activating Jumpgate between ' + $Gate.cluster.knownname + ' and ' + $Gate.exit.cluster.knownname"/>
  540.                 <set_object_active object="$Gate" activate="true"/>
  541.               </do_if>
  542.             </do_all>
  543.           </actions>
  544.         </cue>
  545.       </cues>
  546.     </cue>
  547.   </cues>
  548. </mdscript>
  549.  
  550. Change what you need to; the <find_zone> name value and <find_object> space value must be the same,
  551. the <find_zone> macro value is your zones' macro alias. If you want to add more gates you can add
  552. more <find_zone> entries within the same <actions> block, but you also need to add a new 22 line cue
  553. block (23 including a comment) too, it would look something like this:
  554.  
  555. <?xml version="1.0" encoding="utf-8"?>
  556. <mdscript name="Setup_xymn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="md.xsd">
  557.   <cues>
  558.     <!-- Find Clusters -->
  559.     <cue name="xymn_Start" checktime="0.1s" checkinterval="0.5s" version="2">
  560.       <check_all>
  561.         <event_game_loaded/>
  562.       </check_all>
  563.       <actions>
  564.         <find_zone name="md.$xymn_zone_xymnc001xymns001xymnz001" macro="macro.xymn_zone_xymnc001xymns001xymnz001_macro"/>
  565.         <find_zone name="md.$xymn_zone_vanc001vans001xymnz001" macro="macro.xymn_zone_vanc001vans001xymnz001_macro"/>
  566.         <find_zone name="md.$xymn_zone_xymnc001xymns001xymnz002" macro="macro.xymn_zone_xymnc001xymns001xymnz002_macro"/>
  567.         <find_zone name="md.$xymn_zone_vanc001vans002xymnz001" macro="macro.xymn_zone_vanc001vans002xymnz001_macro"/>
  568.       </actions>
  569.     </cue>
  570.     <!-- Activate Gates between XYMN Sector and Grand Exchange I -->
  571.     <cue name="ActivateGate_xymnc001xymns001xymnz001_vanc001vans001xymnz001">
  572.       <conditions>
  573.         <check_all>
  574.           <event_cue_signalled cue="xymn_Start"/>
  575.         </check_all>
  576.       </conditions>
  577.       <cues>
  578.         <cue name="ActivateGate_Wait" checkinterval="0.1s">
  579.           <actions>
  580.             <find_object groupname="$Gates" class="class.gate" space="md.$xymn_zone_xymnc001xymns001xymnz001" required="true"/>
  581.             <find_object groupname="$Gates" class="class.gate" space="md.$xymn_zone_vanc001vans001xymnz001" required="true"/>
  582.             <do_all exact="$Gates.count" counter="$i">
  583.               <set_value name="$Gate" exact="$Gates.{$i}"/>
  584.               <do_if value="not $Gate.isactive and $Gate.exit.exists">
  585.                 <debug_text text="player.module + ': Activating Jumpgate between ' + $Gate.cluster.knownname + ' and ' + $Gate.exit.cluster.knownname"/>
  586.                 <set_object_active object="$Gate" activate="true"/>
  587.               </do_if>
  588.             </do_all>
  589.           </actions>
  590.         </cue>
  591.       </cues>
  592.     </cue>
  593.     <!-- Activate Gates between XYMN Sector and Grand Exchange II -->
  594.     <cue name="ActivateGate_xymnc001xymns001xymnz002_vanc001vans002xymnz001">
  595.       <conditions>
  596.         <check_all>
  597.           <event_cue_signalled cue="xymn_Start"/>
  598.         </check_all>
  599.       </conditions>
  600.       <cues>
  601.         <cue name="ActivateGate_Wait" checkinterval="0.1s">
  602.           <actions>
  603.             <find_object groupname="$Gates" class="class.gate" space="md.$xymn_zone_xymnc001xymns001xymnz002" required="true"/>
  604.             <find_object groupname="$Gates" class="class.gate" space="md.$xymn_zone_vanc001vans002xymnz001" required="true"/>
  605.             <do_all exact="$Gates.count" counter="$i">
  606.               <set_value name="$Gate" exact="$Gates.{$i}"/>
  607.               <do_if value="not $Gate.isactive and $Gate.exit.exists">
  608.                 <debug_text text="player.module + ': Activating Jumpgate between ' + $Gate.cluster.knownname + ' and ' + $Gate.exit.cluster.knownname"/>
  609.                 <set_object_active object="$Gate" activate="true"/>
  610.               </do_if>
  611.             </do_all>
  612.           </actions>
  613.         </cue>
  614.       </cues>
  615.     </cue>
  616.   </cues>
  617. </mdscript>
  618.  
  619.  
  620. Part 3: Background
  621.  
  622. 3.1
  623.  
  624. Create these files:
  625. extensions\xymn\assets\environments\cluster\xymn_env_cluster_xymnc001.xml
  626. extensions\xymn\assets\environments\cluster\macros\xymn_env_cluster_xymnc001_macro.xml
  627. extensions\xymn\index\components.xml
  628.  
  629. Create this directory:
  630. extensions\xymn\assets\environments\cluster\xymn_env_cluster_xymnc001_data\
  631.  
  632. Put this in xymn_env_cluster_xymnc001.xml:
  633.  
  634. <?xml version="1.0"?>
  635. <components>
  636.   <component name="xymn_cluster_xymnc001" class="celestialbody">
  637.     <source geometry="extensions\xymn\assets\environments\cluster\xymn_env_cluster_xymnc001_data"/>
  638.   </component>
  639. </components>
  640.  
  641. Put this in xymn_env_cluster_xymnc001_macro.xml:
  642.  
  643. <?xml version="1.0" encoding="utf-8"?>
  644. <macros>
  645.   <macro name="xymn_cluster_xymnc001_macro" class="celestialbody">
  646.     <component ref="xymn_cluster_xymnc001"/>
  647.     <properties>
  648.       <identification unique="0"/>
  649.     </properties>
  650.   </macro>
  651. </macros>
  652.  
  653. Remember to change the numbers.
  654.  
  655. 3.2
  656.  
  657. Open components.xml and add:
  658.  
  659. <?xml version="1.0" encoding="utf-8"?>
  660. <diff>
  661.   <add sel="/index">  
  662.     <entry name="xymn_cluster_xymnc001" value="extensions\xymn\assets\environments\cluster\xymn_env_cluster_xymnc001"/>
  663.   </add>
  664. </diff>
  665.  
  666. 3.3
  667.  
  668. Let's go shopping.
  669.  
  670. See any sectors you like the look of? I'm going to copy Getsu Fune's look. Let's look in this
  671. directory unpacked\assets\environments\cluster for some files related to cluster 48.
  672.  
  673. We'll need:
  674. unpacked\assets\environments\cluster\Cluster_48.xml
  675. unpacked\assets\environments\cluster\Cluster_48_data\anim_moon_v1-collision.xmf
  676. unpacked\assets\environments\cluster\Cluster_48_data\anim_moon_v1-lod0.xmf
  677. unpacked\assets\environments\cluster\Cluster_48_data\assets_environments_cluster_cluster_48-collision.xmf
  678. unpacked\assets\environments\cluster\Cluster_48_data\assets_environments_cluster_cluster_48-lod0.xmf
  679. unpacked\assets\environments\cluster\Cluster_48_data\atmosphere001-collision.xmf
  680. unpacked\assets\environments\cluster\Cluster_48_data\atmosphere001-lod0.xmf
  681. unpacked\assets\environments\cluster\Cluster_48_data\background-collision.xmf
  682. unpacked\assets\environments\cluster\Cluster_48_data\background-lod0.xmf
  683. unpacked\assets\environments\cluster\Cluster_48_data\bigstar001-collision.xmf
  684. unpacked\assets\environments\cluster\Cluster_48_data\bigstar001-lod0.xmf
  685. unpacked\assets\environments\cluster\Cluster_48_data\mediumstar001-collision.xmf
  686. unpacked\assets\environments\cluster\Cluster_48_data\mediumstar001-lod0.xmf
  687. unpacked\assets\environments\cluster\Cluster_48_data\nebula001-collision.xmf
  688. unpacked\assets\environments\cluster\Cluster_48_data\nebula001-lod0.xmf
  689. unpacked\assets\environments\cluster\Cluster_48_data\part_c14_bg-collision.xmf
  690. unpacked\assets\environments\cluster\Cluster_48_data\part_c14_bg-lod0.xmf
  691. unpacked\assets\environments\cluster\Cluster_48_data\planet001c-collision.xmf
  692. unpacked\assets\environments\cluster\Cluster_48_data\planet001c-lod0.xmf
  693. unpacked\assets\environments\cluster\Cluster_48_data\smallstar001-collision.xmf
  694. unpacked\assets\environments\cluster\Cluster_48_data\smallstar001-lod0.xmf
  695.  
  696. First let's copy all those .xmf files into the directory you made:
  697. extensions\xymnn\assets\environments\cluster\xymn_env_cluster_xymnc001_data\
  698.  
  699. Now let's open up both Cluster_48.xml and xymn_env_cluster_xymnc001.xml
  700.  
  701. Copy everything in Cluster_48.xml from line 5 ...
  702.  
  703.     <layers>
  704.  
  705. ... to line 217 ...
  706.  
  707.     </connections>
  708.  
  709. ... and insert it into xymn_env_cluster_xymnc001.xml after the 'source' line ...
  710.  
  711. <?xml version="1.0"?>
  712. <components>
  713.   <component name="xymn_cluster_xymnc001" class="celestialbody">
  714.     <source geometry="extensions\xymn\assets\environments\cluster\xymn_env_cluster_xymnc001_data"/>
  715.  
  716.   </component>
  717. </components>
  718.  
  719. ... to get ...
  720.  
  721. <?xml version="1.0"?>
  722. <components>
  723.   <component name="xymn_cluster_xymnc001" class="celestialbody">
  724.     <source geometry="extensions\xymn\assets\environments\cluster\xymn_env_cluster_xymnc001_data"/>
  725.     <layers>
  726.       lots of stuff here
  727.     </connections>
  728.   </component>
  729. </components>
  730.  
  731. Have a look at each block of code, at the top you can see between <lights> and </lights> is the
  732. lighting, there are values for the colour, the range, the range it creates shadows, and some other
  733. effects.
  734.  
  735. Between <connection> and </connection> after that you can see various stars and moons you'll be able
  736. to see in your sector, try moving them around or making them bigger or smaller by adjusting their
  737. values. The 'ref' value refers to the .xmf file, if you want a star or planet etc. from another
  738. cluster then copy the .xmf files from another unpacked\assets\environments\cluster\Cluster_??_data\
  739. directory and copy the related code from unpacked\assets\environments\cluster\Cluster_??.xml.
  740.  
  741.  
  742.  
  743.  
  744. Part 4: An Image
  745.  
  746. 4.1
  747.  
  748. Create a directory here: extensions\xymn\assets\fx\gui\textures\encyclopedia\systems\ and add an
  749. image called something like xymn_img_xymnc001.tga to it, you can use a progam like GIMP 2 to turn
  750. an image into a .tga, just save it as a .tga when exporting the image.
  751.  
  752. 4.2
  753.  
  754. Create the file icons.xml in extensions\xymn\libraries\ and add this to it
  755. <?xml version="1.0" encoding="utf-8"?>
  756. <!DOCTYPE icons SYSTEM "icons.dtd" >
  757. <icons>
  758.     <icon name="xymn_img_xymnc001" texture="extensions\xymn\assets\fx\gui\textures\encyclopedia\systems\xymn_img_xymnc001.tga" height="256" width="256"/>
  759. </icons>
  760.  
  761. 4.3
  762.  
  763. Open mapdefaults.xml and after the description parts of the identification lines add
  764. image="xymn_img_xymnc001".
  765.  
  766. Before:
  767.  
  768. <?xml version="1.0" encoding="utf-8"?>
  769. <defaults xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="libraries.xsd">
  770.   <!-- XYMN Cluster -->
  771.   <dataset macro="xymn_sector_xymnc001_macro">
  772.     <properties>
  773.       <identification name="{900001,100001}" description="{900001,100002}"/>
  774.       <area sunlight="1.0" economy="0.0" security="0.0"/>
  775.       <system>
  776.       </system>
  777.     </properties>
  778.   </dataset>
  779.   <!-- XYMN Sector -->
  780.   <dataset macro="xymn_sector_xymnc001xymns001_macro">
  781.     <properties>
  782.       <identification name="{900001,100003}" description="{900001,100004}"/>
  783.       <area sunlight="1.0" economy="0.0" security="0.0"/>
  784.       <system>
  785.       </system>
  786.     </properties>
  787.   </dataset>
  788. </defaults>
  789.  
  790. After:
  791.  
  792. <?xml version="1.0" encoding="utf-8"?>
  793. <defaults xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="libraries.xsd">
  794.   <!-- XYMN Cluster -->
  795.   <dataset macro="xymn_cluster_xymnc001_macro">
  796.     <properties>
  797.       <identification name="{900001,100001}" description="{900001,100002}" image="xymn_img_xymnc001"/>
  798.       <area sunlight="1.0" economy="0.0" security="0.0"/>
  799.       <system>
  800.       </system>
  801.     </properties>
  802.   </dataset>
  803.   <!-- XYMN Sector -->
  804.   <dataset macro="xymn_sector_xymnc001xymns001_macro">
  805.     <properties>
  806.       <identification name="{900001,100003}" description="{900001,100004}" image="xymn_img_xymnc001"/>
  807.       <area sunlight="1.0" economy="0.0" security="0.0"/>
  808.       <system>
  809.       </system>
  810.     </properties>
  811.   </dataset>
  812. </defaults>
  813.  
  814.  
  815.  
  816.  
  817. Part 5: Regions, asteroids, fog, and debris
  818.  
  819. 5.1
  820.  
  821. Create these files:
  822. extensions\xymn\libraries\region_definitions.xml
  823. extensions\xymn\libraries\regionobjectgroups.xml
  824. extensions\xymn\libraries\regionyields.xml
  825. extensions\xymn\assets\environments\asteroids\xymn_env_ast_ore_xxl_01.xml
  826. extensions\xymn\assets\environments\asteroids\macros\xymn_env_ast_ore_xxl_01_macro.xml
  827. extensions\xymn\assets\environments\fog\xymn_env_fog_01.xml
  828. extensions\xymn\assets\environments\fog\macros\xymn_env_fog_01_macro.xml
  829. extensions\xymn\assets\environments\debris\xymn_env_debris_xenon_xxl_01.xml
  830. extensions\xymn\assets\environments\debris\macros\xymn_env_debris_xenon_xxl_01_macro.xml
  831.  
  832. Create these directories:
  833. extensions\xymn\assets\environments\asteroids\xymn_env_ast_ore_xxl_01_data
  834. extensions\xymn\assets\environments\fog\xymn_env_fog_01_data
  835. extensions\xymn\assets\environments\debris\xymn_env_debris_xenon_xxl_01_data
  836.  
  837. I've picked xxl sized ore asteroids and xenon debris here, you can pick a different size, just
  838. remember to change it from xxl consistently, the naming scheme here doesn't actually change the
  839. sizes that will appear in the game, but you probably want what it's called to match what it looks
  840. like.
  841.  
  842. 5.2
  843.  
  844. Open xymn_clusters.xml and create a new region by inserting this:
  845.  
  846.       <connection name="xymn_region_xymnc001xymnr001_connection" ref="regions">
  847.         <offset>
  848.           <position x="0" y="0" z="0"/>
  849.         </offset>
  850.         <macro name="xymn_region_xymnc001xymnr001_macro">
  851.           <component connection="cluster" ref="standardregion"/>
  852.           <properties>
  853.             <region ref="xymn_region_xymnc001xymnr001"/>
  854.           </properties>
  855.         </macro>
  856.       </connection>
  857.  
  858. ... as a new <connection> block between </connection> and <connection ref="content"> ...
  859.  
  860. <?xml version="1.0" encoding="utf-8"?>
  861. <macros>
  862.   <!-- XYMN Cluster -->
  863.   <macro name="xymn_cluster_xymnc001_macro" class="cluster">
  864.     <component ref="standardcluster"/>
  865.     <connections>
  866.       <!-- XYMN Sector -->
  867.       <connection name="xymn_sector_xymnc001xymns001_connection" ref="sectors">  
  868.         <macro ref="xymn_sector_xymnc001xymns001_macro" connection="cluster"/>
  869.       </connection>
  870.  
  871.       <connection ref="content">
  872.         <macro>
  873.           <component connection="space" ref="xymn_cluster_xymnc001"/>
  874.         </macro>
  875.       </connection>
  876.     </connections>
  877.   </macro>
  878. </macros>
  879.  
  880. ... to get ...
  881.  
  882. <?xml version="1.0" encoding="utf-8"?>
  883. <macros>
  884.   <!-- XYMN Cluster -->
  885.   <macro name="xymn_cluster_xymnc001_macro" class="cluster">
  886.     <component ref="standardcluster"/>
  887.     <connections>
  888.       <!-- XYMN Sector -->
  889.       <connection name="xymn_sector_xymnc001xymns001_connection" ref="sectors">  
  890.         <macro ref="xymn_sector_xymnc001xymns001_macro" connection="cluster"/>
  891.       </connection>
  892.       <connection name="xymn_region_xymnc001xymnr001_connection" ref="regions">
  893.         <offset>
  894.           <position x="0" y="0" z="0"/>
  895.         </offset>
  896.         <macro name="xymn_region_xymnc001xymnr001_macro">
  897.           <component connection="cluster" ref="standardregion"/>
  898.           <properties>
  899.             <region ref="xymn_region_xymnc001xymnr001"/>
  900.           </properties>
  901.         </macro>
  902.       </connection>
  903.       <connection ref="content">
  904.         <macro>
  905.           <component connection="space" ref="xymn_cluster_xymnc001"/>
  906.         </macro>
  907.       </connection>
  908.     </connections>
  909.   </macro>
  910. </macros>
  911.  
  912. 5.3
  913.  
  914. Open region_definitions.xml and add:
  915.  
  916. <?xml version="1.0" encoding="utf-8"?>
  917. <diff>
  918.   <add sel="/regions">
  919.     <region name="xymn_region_xymnc001xymnr001" density="0.1" rotation="0" noisescale="0" seed="0" minnoisevalue="0" maxnoisevalue="1">
  920.       <boundaries>
  921.         <boundary class="sphere">
  922.           <position x="0" y="0" z="0"/>
  923.           <size r="100000"/>
  924.         </boundary>
  925.       </boundaries>
  926.       <falloff>
  927.         <radial>
  928.           <step position="0.0" value="0.0"/>
  929.           <step position="0.1" value="0.0"/>
  930.           <step position="0.1" value="1.0"/>
  931.           <step position="1.0" value="1.0"/>
  932.         </radial>
  933.       </falloff>
  934.       <fields>
  935.         <asteroid groupref="xymn_asteroid_ore_xxl" lodrule="asteroidxl" densityfactor="1" rotation="360" rotationvariation="0" noisescale="1" seed="0" minnoisevalue="0" maxnoisevalue="1"/>
  936.         <nebula ref="xymn_env_fog_01_macro" localred="0" localgreen="0" localblue="0" localdensity="0" uniformred="0" uniformgreen="0" uniformblue="0" uniformdensity="0" backgroundfog="false" resources="hydrogen"/>
  937.         <debris groupref="xymn_debris_xenon_xxl" densityfactor="1" rotation="360" rotationvariation="0" noisescale="1" seed="1" minnoisevalue="0" maxnoisevalue="1"/>
  938.       </fields>
  939.       <resources>
  940.         <resource ware="ore" yield="xymnyield"/>
  941.         <resource ware="hydrogen" yield="xymnyield"/>
  942.         <resource ware="rawscrap" yield="xymnyield"/>
  943.       </resources>
  944.     </region>
  945.   </add>
  946. </diff>
  947.  
  948. Look in region_definitions.xsd for useful information on what some of these fields do. Falloff
  949. controls where the asteroids will appear within the region, here there are no asteroids from 0.0
  950. to 0.1 (ten percent) between the centre of the sphere and 10% of its radius in all directions, then
  951. from 0.1 to 1.0 (90%) is full of asteroids to the specified density level - this means that you'll
  952. get a ball of an asteroid field with a small area right in the middle that's empty.
  953.  
  954. 5.4
  955.  
  956. Open macros.xml and insert:
  957.  
  958.   <entry name="xymn_region*" value="extensions\xymn\libraries\region_definitions"/>
  959.   <entry name="xymn_env_ast_ore_xxl_01*" value="extensions\xymn\assets\environments\asteroids\macros\xymn_env_ast_ore_xxl_01_macro"/>
  960.   <entry name="xymn_env_debris_xenon_xxl_01*" value="extensions\xymn\assets\environments\debris\macros\xymn_env_debris_xenon_xxl_01_macro"/>
  961.  
  962. ... as a new entry block ...
  963.  
  964. <?xml version="1.0" encoding="utf-8"?>
  965. <index>
  966.   <entry name="xymn_galaxy_macro" value="extensions\xymn\maps\XU_ep2_universe\galaxy"/>
  967.   <entry name="xymn_cluster*" value="extensions\xymn\maps\XU_ep2_universe\xymn_clusters"/>
  968.   <entry name="xymn_sector*" value="extensions\xymn\maps\XU_ep2_universe\xymn_sectors"/>
  969.   <entry name="xymn_zone*" value="extensions\xymn\maps\XU_ep2_universe\xymn_zones"/>
  970.  
  971. </index>
  972.  
  973. ... to get ...
  974.  
  975. <?xml version="1.0" encoding="utf-8"?>
  976. <index>
  977.   <entry name="xymn_galaxy_macro" value="extensions\xymn\maps\XU_ep2_universe\galaxy"/>
  978.   <entry name="xymn_cluster*" value="extensions\xymn\maps\XU_ep2_universe\xymn_clusters"/>
  979.   <entry name="xymn_sector*" value="extensions\xymn\maps\XU_ep2_universe\xymn_sectors"/>
  980.   <entry name="xymn_zone*" value="extensions\xymn\maps\XU_ep2_universe\xymn_zones"/>
  981.   <entry name="xymn_region*" value="extensions\xymn\libraries\region_definitions"/>
  982.   <entry name="xymn_env_ast_ore_xxl_01*" value="extensions\xymn\assets\environments\asteroids\macros\xymn_env_ast_ore_xxl_01_macro"/>
  983.   <entry name="xymn_env_debris_xenon_xxl_01*" value="extensions\xymn\assets\environments\debris\macros\xymn_env_debris_xenon_xxl_01_macro"/>
  984. </index>
  985.  
  986. 5.5
  987.  
  988. Open regionobjectgroups.xml and add:
  989.  
  990. <?xml version="1.0" encoding="utf-8"?>
  991. <diff>
  992.   <add sel="//groups">
  993.     <group name="xymn_asteroid_ore_xxl" resource="ore" yield="1" yieldvariation="0">
  994.       <select macro="xymn_env_ast_ore_xxl_01_macro"/>
  995.     </group>
  996.     <group name="xymn_debris_xenon_xxl" resource="rawscrap" yield="1" yieldvariation="0">
  997.       <select macro="xymn_env_debris_xenon_xxl_01_macro"/>
  998.     </group>
  999.   </add>
  1000. </diff>
  1001.  
  1002. The <group> name value here is the <asteroid>/<debris> groupref value from region_definitions.xml.
  1003.  
  1004. Yield is the minimum amount of... well... yield something will spawn with, if you set it higher you
  1005. can concentrate higher yields into fewer asteroids or debris, but other asteroids and debris will
  1006. become empty, the overall amount of resources stays the same, to raise the overall amount you need
  1007. to change the next file. Gas resources don't use this file.
  1008.  
  1009. 5.6
  1010.  
  1011. Open regionyields.xml and add:
  1012.  
  1013. <?xml version="1.0" encoding="utf-8"?>
  1014.  
  1015. <diff>
  1016.   <add sel="/regionyields/resource[@ware='ore']">
  1017.     <yield name="xymnyield" resourcedensity="0.999" replenishtime="10000" scaneffect="scfx_dynamic_highyield_01" scaneffectdensity="0.01" scaneffectintensity="1.0"/>
  1018.   </add>
  1019.   <add sel="/regionyields/resource[@ware='helium']">
  1020.     <yield name="xymnyield" resourcedensity="100000" replenishtime="10000" gatherspeedfactor="5.0" scaneffect="scfx_dynamic_highyield_01" scaneffectdensity="0.01" scaneffectintensity="1.0"/>
  1021.   </add>
  1022.   <add sel="/regionyields/resource[@ware='rawscrap']">
  1023.     <yield name="xymnyield" resourcedensity="0.999 " replenishtime="10000" scaneffect="scfx_dynamic_highyield_01" scaneffectdensity="0.01" scaneffectintensity="1.0"/>
  1024.   </add>
  1025. </diff>
  1026.  
  1027. The <yield> name value here is the <resource> yield value in region_definitions.xml, you could skip
  1028. the step of making this file and just use the presets from lowest to veryhigh in the
  1029. region_definitions.xml file if you want.
  1030.  
  1031. Change resourcedensity to change the... well you get it, the density of resources, a bigger number
  1032. is more overall resources, the numbers I've used create a field with asteroids and debris with
  1033. 1000/2000 yield each respectively, gas resources work differently, which is why their numbers are so
  1034. different in scale.
  1035.  
  1036. 5.7.1
  1037.  
  1038. Put this in xymn_env_ast_ore_xxl_01.xml:
  1039.  
  1040. <?xml version="1.0"?>
  1041. <components>
  1042.   <component name="xymn_env_ast_ore_xxl_01" class="asteroid">
  1043.     <source geometry="extensions\xymn\assets\environments\asteroids\xymn_env_ast_ore_xxl_01_data"/>
  1044.   </component>
  1045. </components>
  1046.  
  1047. 5.7.2
  1048.  
  1049. Put this in xymn_env_ast_ore_xxl_01_macro.xml:
  1050.  
  1051. <?xml version="1.0" encoding="utf-8"?>
  1052. <macros>
  1053.   <macro name="xymn_env_ast_ore_xxl_01_macro" class="asteroid">
  1054.     <component ref="xymn_env_ast_ore_xxl_01"/>
  1055.     <properties>
  1056.       <identification name="{20001,801}" description="{20001,802}"/>
  1057.       <hull max="100000"/>
  1058.     </properties>
  1059.   </macro>
  1060. </macros>
  1061.  
  1062. 5.7.3
  1063.  
  1064. Put this in xymn_env_debris_xenon_xxl_01.xml:
  1065.  
  1066. <?xml version="1.0"?>
  1067. <components>
  1068.   <component name="xymn_env_debris_xenon_xxl_01" class="recyclable">
  1069.     <source geometry="extensions\xymn\assets\environments\debris\xymn_env_debris_xenon_xxl_01_data"/>
  1070.   </component>
  1071. </components>
  1072.  
  1073. 5.7.4
  1074.  
  1075. Put this in xymn_env_debris_xenon_xxl_01_macro.xml:
  1076.  
  1077. <?xml version="1.0" encoding="utf-8"?>
  1078. <macros>
  1079.   <macro name="xymn_env_debris_xenon_xxl_01_macro" class="recyclable">
  1080.     <component ref="xymn_env_debris_xenon_xxl_01" />
  1081.     <properties>
  1082.       <identification name="{20109,5301}" />
  1083.     </properties>
  1084.   </macro>
  1085. </macros>
  1086.  
  1087. 5.7.5
  1088.  
  1089. Put this in xymn_env_fog_01.xml:
  1090.  
  1091. <?xml version="1.0"?>
  1092. <components>
  1093.   <component name="xymn_env_fog_01" class="fogvolume">
  1094.     <source geometry="extensions\xymn\assets\environments\fog\xymn_env_fog_01_data"/>
  1095.   </component>
  1096. </components>
  1097.  
  1098. 5.7.6
  1099.  
  1100. Put this in xymn_env_fog_01_macro.xml:
  1101.  
  1102. <?xml version="1.0" encoding="utf-8"?>
  1103. <macros>
  1104.   <macro name="xymn_env_fog_01_macro" class="fogvolume">
  1105.     <component ref="xymn_env_fog_01"/>
  1106.   </macro>
  1107. </macros>
  1108.  
  1109. 5.8
  1110.  
  1111. Open components.xml and add
  1112.  
  1113.     <entry name="xymn_env_ast_ore_xxl_01" value="extensions\xymn\assets\environments\asteroids\xymn_env_ast_ore_xxl_01"/>
  1114.     <entry name="xymn_env_fog_01" value="extensions\xymn\assets\environments\fog\xymn_env_fog_01"/>
  1115.     <entry name="xymn_env_debris_xenon_xxl_01" value="extensions\xymn\assets\environments\debris\xymn_env_debris_xenon_xxl_01"/>
  1116.  
  1117. ... as new <entry> blocks after the first one ...
  1118.  
  1119. <?xml version="1.0" encoding="utf-8"?>
  1120. <diff>
  1121.   <add sel="/index">  
  1122.     <entry name="xymn_cluster_xymnc001" value="extensions\xymn\assets\environments\cluster\xymn_env_cluster_xymnc001"/>
  1123.  
  1124.   </add>
  1125. </diff>
  1126.  
  1127. ... to get ...
  1128.  
  1129. <?xml version="1.0" encoding="utf-8"?>
  1130. <diff>
  1131.   <add sel="/index">  
  1132.     <entry name="xymn_cluster_xymnc001" value="extensions\xymn\assets\environments\cluster\xymn_env_cluster_xymnc001"/>
  1133.     <entry name="xymn_env_ast_ore_xxl_01" value="extensions\xymn\assets\environments\asteroids\xymn_env_ast_ore_xxl_01"/>
  1134.     <entry name="xymn_env_fog_01" value="extensions\xymn\assets\environments\fog\xymn_env_fog_01"/>
  1135.     <entry name="xymn_env_debris_xenon_xxl_01" value="extensions\xymn\assets\environments\debris\xymn_env_debris_xenon_xxl_01"/>
  1136.   </add>
  1137. </diff>
  1138.  
  1139. 5.9.1
  1140.  
  1141. Shopping time.
  1142.  
  1143. Let's have a look at unpacked\assets\environments\asteroids at all the ore xxl files.
  1144.  
  1145. unpacked\assets\environments\asteroids\macros\env_ast_ore_xxl_01.xml
  1146. unpacked\assets\environments\asteroids\macros\env_ast_ore_xxl_01_macro.xml
  1147. unpacked\assets\environments\asteroids\env_ast_ore_xxl_01_data\assets_environments_asteroids_env_ast_ore_xxl_01-collision.xmf
  1148. unpacked\assets\environments\asteroids\env_ast_ore_xxl_01_data\assets_environments_asteroids_env_ast_ore_xxl_01-lod0.xmf
  1149. unpacked\assets\environments\asteroids\env_ast_ore_xxl_01_data\part_main-collision.xmf
  1150. unpacked\assets\environments\asteroids\env_ast_ore_xxl_01_data\part_main-lod0.xmf
  1151. unpacked\assets\environments\asteroids\env_ast_ore_xxl_01_data\part_main-lod1.xmf
  1152. unpacked\assets\environments\asteroids\env_ast_ore_xxl_01_data\part_main-lod2.xmf
  1153.  
  1154. We can copy those .xmf files to extensions\xymn\assets\environments\asteroids\xymn_env_ast_ore_xxl_01_data
  1155.  
  1156. Next open up both env_ast_ore_xxl_01.xml and xymn_env_ast_ore_xxl_01.xml and copy everything in
  1157. env_ast_ore_xxl_01.xml from line 5 ...
  1158.  
  1159.     <layers>
  1160.  
  1161. ... to line 52 ...
  1162.  
  1163.     </connections>
  1164.  
  1165. ... and insert it into xymn_env_ast_ore_xxl_01.xml after the 'source' line ...
  1166.  
  1167. <?xml version="1.0"?>
  1168. <components>
  1169.   <component name="xymn_env_ast_ore_xxl_01" class="asteroid">
  1170.     <source geometry="extensions\xymn\assets\environments\asteroids\xymn_env_ast_ore_xxl_01_data"/>
  1171.  
  1172.   </component>
  1173. </components>
  1174.  
  1175. ... to get ...
  1176.  
  1177. <?xml version="1.0"?>
  1178. <components>
  1179.   <component name="xymn_env_ast_ore_xxl_01" class="asteroid">
  1180.     <source geometry="extensions\xymn\assets\environments\asteroids\xymn_env_ast_ore_xxl_01_data"/>
  1181.     <layers>
  1182.       lots of stuff here
  1183.     </connections>
  1184.   </component>
  1185. </components>
  1186.  
  1187. Open env_ast_ore_xxl_01_macro.xml and you'll see something that we don't have in our
  1188. xymn_env_ast_ore_xxl_01_macro.xml file: <drop ref="asteroid_ore_xl"/>
  1189.  
  1190. Copy that over if you want to, you'll find more information on drops in unpacked\libraries\drops.xml
  1191.  
  1192. 5.9.2
  1193.  
  1194. Do the same thing with debris, I picked env_debris_xenon_xxl_01
  1195.  
  1196. 5.9.3
  1197.  
  1198. Do the same thing with fog, I picked fogpattern_v3
  1199.  
  1200.  
  1201.  
  1202.  
  1203. Part 6: Test it and tweak it
  1204.  
  1205. I recommend using iseeu0's cheat mod (the so called "x4-foundations CHEAT MENU NO PLAYER MODS"
  1206. version) to uncover the map so you can jump to your new sector quickly to see it.
  1207. https://www.moddb.com/mods/iseeu0-cheat/downloads/x4-foundations-cheat-menu-no-player-mods
  1208.  
  1209.  
  1210.  
  1211.  
  1212. If you've spotted any mistakes in this tutorial, please don't hesitate to pick me up on it, you can
  1213. get in touch with me on the https://forum.egosoft.com website, my username is Oganesson, you can
  1214. either message me directly or post in this thread https://forum.egosoft.com/viewtopic.php?t=450155.
  1215.  
  1216. Happy modding.
  1217. Og.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement