v50 Steam/Premium information for editors
  • v50 information can now be added to pages in the main namespace. v0.47 information can still be found in the DF2014 namespace. See here for more details on the new versioning policy.
  • Use this page to report any issues related to the migration.
This notice may be cached—the current version can be found here.

Difference between revisions of "Utility:Obsidian/Cell definition files"

From Dwarf Fortress Wiki
Jump to navigation Jump to search
(Added the fortress definition file)
(Added the map definition file)
Line 40: Line 40:
  
 
==Map==
 
==Map==
[[File:Map.xml]]
+
This just a a collection of cells that describes the current map. Maps have a timestamp, so a fortress can hold multiple map instances to represent the development of the fortress over time
This just a a collection of cells that describes the map
+
<pre>
 +
<class name="Map" api="yes">
 +
<ctor/>
 +
 
 +
<reference name="Fortress" type="Fortress">
 +
<get/>
 +
</reference>
 +
 
 +
<property name="TimeStamp" type="ROString">
 +
<get/>
 +
</property>
 +
 
 +
<array name="Cells" type="Cell">
 +
<dimension name="x" size="Fortress.SizeX"/>
 +
<dimension name="y" size="Fortress.SizeY"/>
 +
<dimension name="z" size="Fortress.SizeZ"/>
 +
<get_index/>
 +
<set_index/>
 +
</array>
 +
 
 +
<property name="OpenSpace" type="Cell">
 +
<note>This is a readonly cell representing the default OpenSpace cell</note>
 +
<get/>
 +
</property>
 +
</class>
 +
</pre>
  
 
==Cell==
 
==Cell==
 
[[File:Cell.xml]]
 
[[File:Cell.xml]]
 
Each cell holds everything that you need to know about a specific tile in the fortress, including the terrain information, lists of buildings, constructions, items, contaminants, liquids and creatures in that tile.
 
Each cell holds everything that you need to know about a specific tile in the fortress, including the terrain information, lists of buildings, constructions, items, contaminants, liquids and creatures in that tile.

Revision as of 03:35, 30 May 2010

Cell definition files

This list of files represent the internal representation of the Cell engine, to be exposed to Lua and used by other modules (like the geometry generator)

Fortress

This describes the top level object that holds all of the components like terrain, creatures, etc., as well as static information about the fortress.

	<class name="Fortress" api="yes">
		<ctor/>
		
		<!-- TODO: Need a good default fortress size. How many tiles is the default 4x4 embark? -->

		<property name="SizeX" type="Int32" default="16">
			<get/>
		</property>

		<property name="SizeY" type="Int32" default="16">
			<get/>
		</property>

		<property name="SizeZ" type="Int32" default="16">
			<get/>
		</property>

		<vector name="Maps" type="Map">
			<note>A fortress can have multiple maps, to represent timestamps of the fortress terrain over time</note>
			<get_index/>
			<size/>
			<push_back/>
		</vector>

		<vector name="Materials" type="Material">
			<get_index/>
		</vector>

		<method name="LoadFromDF">
			<return type="Void"/>
		</method>
	</class>

Map

This just a a collection of cells that describes the current map. Maps have a timestamp, so a fortress can hold multiple map instances to represent the development of the fortress over time

	<class name="Map" api="yes">
		<ctor/>

		<reference name="Fortress" type="Fortress">
			<get/>
		</reference>

		<property name="TimeStamp" type="ROString">
			<get/>
		</property>

		<array name="Cells" type="Cell">
			<dimension name="x" size="Fortress.SizeX"/>
			<dimension name="y" size="Fortress.SizeY"/>
			<dimension name="z" size="Fortress.SizeZ"/>
			<get_index/>
			<set_index/>
		</array>

		<property name="OpenSpace" type="Cell">
			<note>This is a readonly cell representing the default OpenSpace cell</note>
			<get/>
		</property>
	</class>

Cell

File:Cell.xml Each cell holds everything that you need to know about a specific tile in the fortress, including the terrain information, lists of buildings, constructions, items, contaminants, liquids and creatures in that tile.