Difference between revisions of "Misc plists"

From Elite Wiki
m (Use)
m (description.plist)
Line 1: Line 1:
=description.plist=
+
=descriptions.plist=
 +
 
 
== Structure ==
 
== Structure ==
 +
 
The file is organised as a dictionary <dict>. Every entry consists of the name <key>, followed by the text <string> or <array>. If an array is used it contains strings. It has the same structure as the [[missiontext.plist]] and it also resides in the config folder inside the OXP.
 
The file is organised as a dictionary <dict>. Every entry consists of the name <key>, followed by the text <string> or <array>. If an array is used it contains strings. It has the same structure as the [[missiontext.plist]] and it also resides in the config folder inside the OXP.
 
Example:
 
Example:
Line 12: Line 14:
 
         <string>six</string>
 
         <string>six</string>
 
     </array>
 
     </array>
</dict>
+
</dict>
  
 
== Use  ==
 
== Use  ==
Its use must be seen as a kind of variable. The key part is the variable name and the string part is the content of the variable. If you use an array of strings the variable will return a random choice of one of the strings. And this is the main use of the description.plist: Creation of text with variable content. See also [[string expansion]].
+
 
 +
Its use must be seen as a kind of variable. The key part is the variable name and the string part is the content of the variable. If you use an array of strings the variable will return a random choice of one of the strings. And this is the main use of the descriptions.plist: Creation of text with variable content. See also [[string expansion]].
  
 
The text itself is invoked by using the key-word between square brackets, like:  
 
The text itself is invoked by using the key-word between square brackets, like:  
Line 22: Line 25:
  
 
Whenever Oolite reads in a scriptline, missiontext or description, it first looks for something between brackets. If is finds something it looks if it is a mission_variable. If yes, is replaces the name of the variable with its content. Then it looks in the descriptions.plist. If it finds a key, it replaces the name with the string content. If it is an array it picks at random one of the strings.
 
Whenever Oolite reads in a scriptline, missiontext or description, it first looks for something between brackets. If is finds something it looks if it is a mission_variable. If yes, is replaces the name of the variable with its content. Then it looks in the descriptions.plist. If it finds a key, it replaces the name with the string content. If it is an array it picks at random one of the strings.
Be aware that oolite reeds in all description.plist lines on startup in one big file. This means that you can use keywords from other OXP's or from oolite itself. If there are some key's with duplicate names, it uses  the last. This means that you must use unique keywords.
+
Be aware that oolite reeds in all descriptions.plist lines on startup in one big file. This means that you can use keywords from other OXP's or from oolite itself. If there are some key's with duplicate names, it uses  the last. This means that you must use unique keywords.
  
 
[[Category:Oolite scripting]]
 
[[Category:Oolite scripting]]

Revision as of 19:29, 20 September 2007

descriptions.plist

Structure

The file is organised as a dictionary <dict>. Every entry consists of the name <key>, followed by the text <string> or <array>. If an array is used it contains strings. It has the same structure as the missiontext.plist and it also resides in the config folder inside the OXP. Example:

<dict>
   <key>parcelnumbers</key>
   <array>
       <string>two</string>
       <string>three</string>
       <string>four</string>
       <string>five</string>
       <string>six</string>
   </array>
</dict>

Use

Its use must be seen as a kind of variable. The key part is the variable name and the string part is the content of the variable. If you use an array of strings the variable will return a random choice of one of the strings. And this is the main use of the descriptions.plist: Creation of text with variable content. See also string expansion.

The text itself is invoked by using the key-word between square brackets, like:

You have to pick up [parcelnumbers] parcels.

Whenever Oolite reads in a scriptline, missiontext or description, it first looks for something between brackets. If is finds something it looks if it is a mission_variable. If yes, is replaces the name of the variable with its content. Then it looks in the descriptions.plist. If it finds a key, it replaces the name with the string content. If it is an array it picks at random one of the strings. Be aware that oolite reeds in all descriptions.plist lines on startup in one big file. This means that you can use keywords from other OXP's or from oolite itself. If there are some key's with duplicate names, it uses the last. This means that you must use unique keywords.