Modding:Maps: Difference between revisions

Update JoppaWorld's rpm map
(add basic map editor instructions)
(Update JoppaWorld's rpm map)
 
(17 intermediate revisions by 9 users not shown)
Line 1: Line 1:
[[Category:Modding]]{{Modding Info}}
[[Category:Modding]]{{Modding Info}}
==.rpm files==
RPM files are stores of static map content. They are a simple XML format. You can create your own RPM files, or "patch" the ones shipped with the game in your mod folders by using the same filename for the .rpm file.
The in-game map editor loads and saves files in the .rpm XML format. It supports saving complete maps with all of the 80x25 cells included in the XML.
RPM files can represent a particular zone (such as the Grit Gate complex), but an RPM file is also used for the world map (<code>JoppaWorldNew8.rpm</code>{{File Reference|file=Worlds|note=world <code>JoppaWorld</code>'s <code>Map</code> value}}), which is generated in similar fashion to other zones.
===Adding something to an existing map===
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 [https://steamcommunity.com/sharedfiles/filedetails/?id=1333296306 Two Ctesiphus tutorial mod]'''
<syntaxhighlight lang="xml">
<?xml version="1.0" encoding="utf-8"?>
<Map
  Width="80"
  Height="25" Load="Merge">
  <cell
    X="41"
    Y="7">
    <object Name="Ctesiphus"></object>
  </cell>
</Map>
</syntaxhighlight>
===Replace a Terrain Tile in World Map===
This example also only defines the one cell it wants to replace, however does not use the <code>Load="Merge</code> option.  The world map expects only one terrain object per map cell, and not using <code>Load="Merge"</code> tells the game to <b>replace</b> the contents of that cell.
'''Example JoppaWorldNew4.rpm to replace a terrain tile'''
<syntaxhighlight lang="xml">
<?xml version="1.0" encoding="utf-8"?>
<Map
  Width="80"
  Height="25">
  <cell
    X="12"
    Y="22">
    <object Name="My_TerrainEastJoppa"></object>
  </cell>
</Map>
</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"></code>
Example of edited <code>ObjectBlueprints.xml</code>:
<syntaxhighlight lang="xml">
<objects>
  <object Name="My_TerrainEastJoppa" Inherits="Terrain">
    <part Name="Render"
      DisplayName="your display name here"
      Tile="Terrain/yourcustomtile.png" 
      ColorString="&amp;G^k" 
      DetailColor="r"> <!-- sets a number or attributes such as the location of your custom tile (in a sub folder of your mod folder) and the colours to be applied to it -->
    </part>
    <part Name="Description" Short="your description here"></part>
    <tag Name="NoBiomes" Value="1"></tag>
    <tag Name="OverlayColor" Value="&amp;W"></tag>
  </object>
</objects>
</syntaxhighlight>
Example of edited <code>Worlds.xml</code><syntaxhighlight lang="xml">:
<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 ==
Line 16: Line 106:
* Ctrl+click to add the selected item to the map
* Ctrl+click to add the selected item to the map
* Alt+click to select an existing item on the map
* Alt+click to select an existing item on the map
* Right-click and hold to drag the map around.
* Click and drag to move the map around.
* Shift+click to flood fill
* Shift+drag+click to select areas


When an area is selected, it will display the tiles in the selected area. Click the X button to delete all tiles of that type, and the yellow double-circle button to replace all tiles of that type with the tile on the palette.


==.rpm files==
Hold ctrl while hovering over a tile in the sidebar to show its full XML. (If this popup happens when you are trying to edit the map, hold ctrl and run your mouse over some entries in the sidebar; this usually fixes it for me.)
RPM files are stores of static map content. They are a simple xml format. RPM files can be overriden from your mod folder.


The in-game map editor loads and saves the .rpm xml format.
== Examples ==
The Brainwraith mod ([https://www.nexusmods.com/cavesofqud/mods/6?tab=bugs Nexus], [https://steamcommunity.com/sharedfiles/filedetails/?id=1239762624 Steam]) is an example of a mod that makes extensive use of map and world modifications. It modifies the world map and also creates several new RPM-based zones.


In the following example only a single cell is merged with the existing contents of Joppa.RPM. If Load="Merge" is not supplied, the contents are replaced instead.
{{Modding Navbox}}
 
The in-game map editor doesn't support cutting a section of the map out for saving, so if you'd like to replace only a subsection you'll have to edit the .rpm by hand.
 
 
'''Example Joppa.RMP from Two Ctesiphus tutorial mod'''
<syntaxhighlight lang="xml">
<?xml version="1.0" encoding="utf-8"?>
<Map
  Width="80"
  Height="25" Load="Merge">
  <cell
    X="41"
    Y="7">
    <object Name="Ctesiphus"></object>
  </cell>
</Map>
</syntaxhighlight>