Modding:Maps: Difference between revisions

1,132 bytes added ,  07:19, 21 April 2020
adding some information on editing the world map and what Load="Merge" exactly does
m (Teamtoto moved page Modding/Maps to Modding:Maps)
(adding some information on editing the world map and what Load="Merge" exactly does)
Line 1: Line 1:
[[Category:Modding]]{{Modding Info}}
[[Category:Modding]]{{Modding Info}}


==.rpm files==
==.rpm files==
RPM files are stores of static map content. They are a simple xml format. RPM files can be overriden from your mod folder.


RPM files can represent a particular zone (such as the Grit Gate complex), but an RPM file is also used for the world map (currently <code>JoppaWorldNew4.rpm</code>), which is generated in similar fashion to other zones.
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 the .rpm xml format.
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.


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.
RPM files can represent a particular zone (such as the Grit Gate complex), but an RPM file is also used for the world map (currently <code>JoppaWorldNew4.rpm</code>), which is generated in similar fashion to other zones.


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.
===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.RMP from Two Ctesiphus tutorial mod'''
'''Example Joppa.rpm from 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 25: Line 26:
</Map>
</Map>
</syntaxhighlight>
</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 terrian 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"
  Hight="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"%gt</code>


== Using the Map Editor ==
== Using the Map Editor ==