Modding:Maps: Difference between revisions

1,650 bytes added ,  10:20, 21 April 2020
→‎Adding something to an existing map: I added some sample code for modifying worlds.xml and objectblueprints.xml as i got stuck here
(adding some information on editing the world map and what Load="Merge" exactly does)
(→‎Adding something to an existing map: I added some sample code for modifying worlds.xml and objectblueprints.xml as i got stuck here)
Line 13: Line 13:
In the following example only a single cell is defined in the rpm.  It also defines <code>Load="Merge"</code> on the map which tells the map reader to append the content to the cell without deleting what is already there (a floor tile, or other object for instance).  You name the rpm file the same as the version from StreamingAssets/Base/.
In the following example only a single cell is defined in the rpm.  It also defines <code>Load="Merge"</code> on the map which tells the map reader to append the content to the cell without deleting what is already there (a floor tile, or other object for instance).  You name the rpm file the same as the version from StreamingAssets/Base/.


'''Example Joppa.rpm from Two Ctesiphus tutorial mod'''
'''Example Joppa.rpm from [https://steamcommunity.com/sharedfiles/filedetails/?id=1333296306 Two Ctesiphus tutorial mod]'''
<syntaxhighlight lang="xml">
<syntaxhighlight lang="xml">
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
Line 44: Line 44:
</syntaxhighlight>
</syntaxhighlight>


<code>My_TerrainEastJoppa</code> would be an object you define in the object blueprints to render the cell however you want, and you can then define your own "sub zone" within <code>Worlds.xml</code> attached to that Terrain tile via <code>&lt;cell ApplyTo="My_TerrainEastJoppa"%gt</code>
<code>My_TerrainEastJoppa</code> would be an object you define in the object blueprints to render the cell however you want, and you can then define your own "sub zone" within <code>Worlds.xml</code> attached to that Terrain tile via <code>&lt;cell ApplyTo="My_TerrainEastJoppa"></code>
 
Example of edited <code>ObjectBlueprints.xml</code><syntaxhighlight>
<objects>
 
  <object Name="My_TerrainEastJoppa" Inherits="Terrain">
  <part Name="Render"
        DisplayName="your display name here"
        Tile="Terrain/yourcustomtile.png" <!-- put in a subfolder of your mod folder -->
        ColorString="&amp;G^k"  <!-- colour of the tile -->
        DetailColor="r"> <!-- highlight colour of the tile -->
  </part>
  <part Name="Description" Short="your description here"></part>
  <tag Name="NoBiomes" Value="1"></tag>
  <tag Name="OverlayColor" Value="&amp;W"></tag>
 
</object>
</syntaxhighlight>Example of edited <code>Worlds.xml</code><syntaxhighlight>
<worlds>
  <world Name="JoppaWorld" Load="Merge">
 
 
    <cell Name="some name" Inherits="WatervineCell"
          ApplyTo="My_TerrainEastJoppa"
          Mutable="false" > <!--sets whether or not procgen functions here -->
   
      <zone Level="10" x="0-2" y="0-2" Name="outskirts, Joppa" NameContext="Joppa">
        <builder Class="JoppaOutskirts"></builder>
        <encounter Table="JoppaOutskirtsEncounters" Amount="minimum"></encounter>
      </zone> <!-- this first part is borrowed from Joppa in this example -->
 
      <zone Level="10" x="1" y="1" Name="somename" ProperName="true">
        <map FileName="yournewmap.rpm"></map> <!-- put this map file in your mod folder -->
        <builder Class="Music" Track="MehmetsMorning" Chance="100"></builder>
      </zone>
     
      <!-- more zones such as underground could be added here -->
 
    </cell>
 
  </world>
</worlds>
</syntaxhighlight>


== Using the Map Editor ==
== Using the Map Editor ==
Anonymous user