The Occupant Configuration File

The different types of Occupants are configured in an Occupant Configuration File which is referenced by the OccupantManager. To configure your own game you can update this XML file (or create a new one) to define new occupants, costs, etc.

 

The configuration file uses an XML format to store the data. The XML is a serialised representation of a List of OccupantTypeData.

 

 The following table lists the elements of the XML file. 

 

Parameter

Details

Sample

id

Unique id of the occupant.

 <id>SWORDSMAN</id>
 

name

Human readable name of the occupant.

 <name>Swordsman</name>

description

Human readable description of the occupant.

 <description>The standard military unit. A soldier armed with a sword.</description>
   

spriteName

Name of the sprite to use for this occupant. Looked up in the NGUI Atlas by this name.

 

cost

Cost to recruit/build.

 <cost>100</cost>

buildTime

Time to recruit/build (in seconds).

 <buildTime>15</buildTime>

recruitFromIds

List of strings containing building IDs defining buildings that can recruit/build this occupant.

 <recruitFromIds>
   <string>BARRACKS</string>
   <string>LARGE_BARRACKS</string>
 </recruitFromIds>

allowIds

Ids of the buildings and occupants that this occupant allows. This is used for UI only, requireIds is the actual constraint.

<allowIds>

  <string>ALTAR</string>

</allowIds> 

requireIds

Ids of the buildings and occupants required before this building can be built.

 

<requireIds>

  <string>TEMPLE</string>

</requireIds> 

housingIds

List of building type IDs for buildings that can hold this unit type. Note that the

building where an occupant is stored/housed can be different to the building that is required to build it. 

<housingIds>
  <string>BARRACKS</string>
</housingIds>  

occupantSize

Size of the occupant (see BuildingType.occupantStorage).

<occupantSize>1</occupantSize> 
Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.
Powered by Zendesk