Difference between revisions of "Equipment.plist"
Eric Walch (talk | contribs) (Removed info about old Oolite versions) |
Eric Walch (talk | contribs) (Added some missing conditions, removed the XMl examples) |
||
Line 7: | Line 7: | ||
The following equipment data are read in by Oolite. |
The following equipment data are read in by Oolite. |
||
− | In XML: |
||
− | <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> |
||
− | |||
− | In ascii |
||
( |
( |
||
( |
( |
||
Line 50: | Line 32: | ||
6) This is a dictionary that can contain several special features like: |
6) This is a dictionary that can contain several special features like: |
||
− | In XML: |
||
− | <key>available_to_all</key> |
||
− | <true/> |
||
− | |||
− | <key>conditions</key> |
||
− | <array> |
||
− | <string>systemGovernment_number morethan 3</string> |
||
− | </array> |
||
− | |||
− | <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>portable_between_ships</key> |
||
− | <true/> |
||
− | |||
− | <key>script</key> |
||
− | <string>myCustomScript.js</string> |
||
− | |||
− | <key>script_info</key> |
||
− | <dict> |
||
− | <key>myCustomProperty</key> |
||
− | <string>0</string> |
||
− | </dict> |
||
− | In ascii: |
||
{ |
{ |
||
− | "available_to_all" = |
+ | "available_to_all" = yes; |
+ | "available_to_NPCs" = yes; |
||
+ | "available_to_player" = no; |
||
conditions = ( |
conditions = ( |
||
"systemGovernment_number morethan 3" |
"systemGovernment_number morethan 3" |
||
); |
); |
||
"incompatible_with_equipment" = "EQ_FUEL_SCOOPS"; |
"incompatible_with_equipment" = "EQ_FUEL_SCOOPS"; |
||
− | "portable_between_ships" = 1; |
||
+ | "is_external_store" = no; // is missile or mine and added to pylon. |
||
+ | "portable_between_ships" = yes; |
||
"requires_cargo_space" = 5; |
"requires_cargo_space" = 5; |
||
− | "requires_clean" = |
+ | "requires_clean" = yes; |
− | "requires_empty_pylon" = |
+ | "requires_empty_pylon" = yes; |
"requires_equipment" = "EQ_FUEL_SCOOPS"; |
"requires_equipment" = "EQ_FUEL_SCOOPS"; |
||
− | "requires_mounted_pylon" = 1; |
||
+ | "requires_free_passenger_berth" = no; |
||
− | " |
+ | "requires_full_fuel" = no; |
+ | "requires_mounted_pylon" = yes; |
||
+ | "requires_not_clean" = yes; |
||
+ | "requires_non_full_fuel" = no; |
||
"script" = "myCustomScript.js"; |
"script" = "myCustomScript.js"; |
||
− | "script_info" = { myCustomProperty = 0 |
+ | "script_info" = { myCustomProperty = 0; |
+ | "strict_mode_only" = no; |
||
+ | "strict_mode_compatible" = yes; |
||
+ | "visible" = yes; // listed on the F5F5 screen. |
||
+ | }; |
||
} |
} |
||
Revision as of 13:28, 17 August 2011
using equipment
Player buyable equipment is stored in a file named equipment.plist 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.
( ( 1, 300, Missile, "EQ_MISSILE", "Faulcon de Lacy HM3 homing missile, fast and accurate when used in conjunction with standard targetting scanners.", { "available_to_all" = YES; } ) )
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. Please note that the number entered here should be one less than the level you wish it to apply for in the game. So if you want a type of equipment to be available at Technical Level 15 (the highest for a system in the strict version of Oolite) you must use the number 14 for this entry.
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:
{ "available_to_all" = yes; "available_to_NPCs" = yes; "available_to_player" = no; conditions = ( "systemGovernment_number morethan 3" ); "incompatible_with_equipment" = "EQ_FUEL_SCOOPS"; "is_external_store" = no; // is missile or mine and added to pylon. "portable_between_ships" = yes; "requires_cargo_space" = 5; "requires_clean" = yes; "requires_empty_pylon" = yes; "requires_equipment" = "EQ_FUEL_SCOOPS"; "requires_free_passenger_berth" = no; "requires_full_fuel" = no; "requires_mounted_pylon" = yes; "requires_not_clean" = yes; "requires_non_full_fuel" = no; "script" = "myCustomScript.js"; "script_info" = { myCustomProperty = 0; "strict_mode_only" = no; "strict_mode_compatible" = yes; "visible" = yes; // listed on the F5F5 screen. }; }
Most names will explain themselves. In this list the empty/mounted pylons are not necessary when the equipment ends on MINE or MISSILE.
Conditions 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.
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.
NOTE2: "script_info" is added with test release 1.74. It contains a directory of custom entries that become properties of EquipmentInfo.scriptInfo
NOTE3: "script" is added with test release 1.75. It contains a name of a script file used by the equipment. Equipment that contains a script is put on a special list. The player than can cycle through that list by pressing "shift-N". (similar as selecting a missile). The primed script is than the active script. Whenever a player now presses "n", the "this.activated()" event handler of the primed equipment is executed.
this.activated = function() { // your code }