Difference between revisions of "Equipment.plist"

From Elite Wiki
(Added to "available to all")
(added requires_cargo_space explanation.)
Line 55: Line 55:
 
   
 
   
 
  <key>requires_equipment</key>
 
  <key>requires_equipment</key>
<string>EQ_FUEL_SCOOPS</string>
 
 
<key>requires_any_equipment</key>
 
 
  <string>EQ_FUEL_SCOOPS</string>
 
  <string>EQ_FUEL_SCOOPS</string>
 
   
 
   
Line 75: Line 72:
  
  
Most names will explain themselves. In this list the '''empty/mounted pylons''' are not necessary when the equipment ends on MINE or MISSILE. All keys are already available in version 1.65.
+
Most names will explain themselves. In this list the empty/mounted pylons are not necessary when the equipment ends on MINE or MISSILE. All keys are already available in version 1.65.
  
'''Conditions''' is new since Oolite 1.69. It can contain a single string with one condition or an array of condition strings. Conditions are only checked when the equipment would be available by the other criteria.
+
Conditions is new since Oolite 1.69. It can contain a single string with one condition or an array of condition strings. Conditions are only checked when the equipment would be available by the other criteria.
  
'''available_to_all''' means all ships can buy the item. When not set it is only buyable when the equipment is defined in the [[shipyard.plist]] under optional_equipment. The content of this key is ignored. Only the existence is enough to make the equipment available to all (Even when set to false)
+
available_to_all means all ships can buy the item. When not set it is only buyable when the equipment is defined in the [[shipyard.plist]] under optional_equipment.  
 
 
'''requires_equipment''', '''requires_any_equipment''' and '''incompatible_with_equipment''' can be a single item or an array of items. All items in '''requires_equipment''' must be installed, at least one item in '''requires_any_equipment''' must be installed, and no items in '''incompatible_with_equipment''' may be installed for this equipment to be permitted.
 
  
 
There is only a bug in versions until 1.71: requires_equipment triggers the incompatible_with_equipment key. This bug can be bypassed by also defining a EQ_DUMMY equipment for incompatible_with_equipment when using the requires_equipment.
 
There is only a bug in versions until 1.71: requires_equipment triggers the incompatible_with_equipment key. This bug can be bypassed by also defining a EQ_DUMMY equipment for incompatible_with_equipment when using the requires_equipment.
  
== missile icons ==
+
NOTE: requires_cargo_space is only used to determine a condition to show an item on the list. Currently it uses no cargo space when bought. This makes it probably useless for other equipment than internal Oolite equipment that used this key.  
Equipment ending on MINE or MISSILE can have an icon. To create this icon one must define a key in descriptions.plist with the name of the missile. Than define sets of x,y-coordinates how the icon should be drawn. Numbers must range  between 2 and -2. Next example in acsii format draws a box as icon
 
 
 
    "EQ_MY_MISSILE" = (2,2, 2,"-2", "-2","-2", "-2",2 );
 
 
 
  
[[Category:Oolite]]
+
[[Category:Oolite scripting]]

Revision as of 11:03, 12 April 2009

using equipment

Player buyable equipment is stored in a equipment.plist file that resides in the config folder of a OXP. You can add equipment by adding arrays to this plist file. Every equipment array is build of an array of entries.

equipment structure

The following equipment data are read in by oolite.

<plist version="1.0">
<array>
    <array>
         <integer>1</integer>
         <integer>300</integer>
         <string>Missile</string>
         <string>EQ_MISSILE</string>
         <string>Faulcon de Lacy HM3 homing missile, fast and accurate when used in conjunction with standard targetting scanners.</string>
         <dict>
              <key>available_to_all</key>
              <true/>
         </dict>
    </array>
</array>
</plist>


1) The first entry is an integer that determines the technical level from witch the equipment can be bought. A level of 99 has a special meaning. Only this value can be changed by script.

2) The second entry is the costs of the equipment in tenths of a credit.

3) This is a string that shows the name of the equipment as seen by the player.

4) This is a string that shows the name of the equipment that is used by scripting. Must start with EQ_ and endings like _MISSILE or _MINE give it a special handling.

5) This string gives a short description of the item.

6) This is a dictionary that can contain several special features like:

<key>available_to_all</key>
<true/>

<key>requires_empty_pylon</key>
<true/>

<key>requires_mounted_pylon</key>
<true/>

<key>requires_clean</key>
<true/>

<key>requires_not_clean</key>
<true/>

<key>requires_cargo_space</key>
<integer>5</integer>

<key>requires_equipment</key>
<string>EQ_FUEL_SCOOPS</string>

<key>incompatible_with_equipment</key>
<string>EQ_FUEL_SCOOPS</string>

<key>conditions</key>
<string>systemGovernment_number morethan 3</string>

<key>conditions</key>
      <array>
              <string>systemGovernment_number morethan 3</string>
      </array>

<key>portable_between_ships</key>
<true/>


Most names will explain themselves. In this list the empty/mounted pylons are not necessary when the equipment ends on MINE or MISSILE. All keys are already available in version 1.65.

Conditions is new since Oolite 1.69. It can contain a single string with one condition or an array of condition strings. Conditions are only checked when the equipment would be available by the other criteria.

available_to_all means all ships can buy the item. When not set it is only buyable when the equipment is defined in the shipyard.plist under optional_equipment.

There is only a bug in versions until 1.71: requires_equipment triggers the incompatible_with_equipment key. This bug can be bypassed by also defining a EQ_DUMMY equipment for incompatible_with_equipment when using the requires_equipment.

NOTE: requires_cargo_space is only used to determine a condition to show an item on the list. Currently it uses no cargo space when bought. This makes it probably useless for other equipment than internal Oolite equipment that used this key.