Page 1 of 1

Custom Beacons

Posted: Sat Oct 02, 2010 8:34 pm
by Ragged
I have a ship that has the following in its shipdata.plist entry:

Code: Select all

		<key>name</key>
		<string>The Painted Lady</string>
		<key>beacon</key>
		<string>Painted Lady</string>
		<key>roles</key>
		<string>dsr_chp1_paintedlady</string>
I also have the following entry in my descriptions.plist:

Code: Select all

	<key>dsr_chp1_paintedlady</key>
		
		<string>-2, 0, -1, 0, -1, 1, -2, 1, -2, -1, 0, -1, 1, 1, 0, -1, 2, -1</string>
As far as I can tell from the wiki - http://wiki.alioth.net/index.php/Shipdata.plist#beacon - this should give me a nice custom beacon (looking something like PL) but it doesn't - what am I doing wrong?

Posted: Sat Oct 02, 2010 9:18 pm
by Thargoid
The descriptions.plist entry should be an array, not a string.

Replace <string> by <array> and </string> by </array> . then restart with shift held down.

The wiki example (from my Fuel Station OXP) is in openStep, but () is the equivalent of the array tags.

Posted: Sat Oct 02, 2010 9:43 pm
by Ragged
Thanks Thargoid - you are half right, but you put me onto the course to find the right answer.

The equivalent of the wiki example is the almost absurdly verbose:

Code: Select all

<array>
			<integer>1</integer>
			<integer>2</integer>
			<integer>-3</integer>
			<integer>2</integer>
			<integer>-3</integer>
			<integer>-4</integer>
			<integer>3</integer>
			<integer>-4</integer>
			<integer>3</integer>
			<integer>4</integer>
			<integer>-3</integer>
			<integer>4</integer>
			<integer>-3</integer>
			<integer>3</integer>
			<integer>2</integer>
			<integer>3</integer>
			<integer>2</integer>
			<integer>-3</integer>
			<integer>1</integer>
			<integer>-3</integer>
		</array>
Edit - actually, you get all the credit anyhow - I found a working example of precisely this sort of thing in your EnergyEquipment oxp!

Posted: Mon Oct 04, 2010 1:25 pm
by Kaks
That's exactly why we recommend everybody use openstep instead of xml.

And as an extra 'bonus', xml plist parsing is broken in a few versions of gnustep, including the one shipped with ubuntu lucid, just in case you need another reason not to use xml formatted plists...

Posted: Tue Oct 05, 2010 1:42 pm
by Ragged
Kaks wrote:
That's exactly why we recommend everybody use openstep instead of xml.
Can you link to where exactly this recommendation is made, please.

Posted: Tue Oct 05, 2010 3:03 pm
by Kaks
Why, just above! :D

I can't think of any specific thread, but whenever anyone mentioned xml versus openstep, one or another member of the dev team - and sometimes 2 or 3 of us at once - does tend to mention something along these lines: yes, xml is the newer format, but openstep is easier to use & read, so we'd use that instead.

For this very reason Oolite's internal plists have been fully converted to openstep about a year or so ago ( I think: it definitely happened a while before lucid and its buggy .plist parser got released... :) )

Somewhere or other, on this forum, there was also some mention of updating the wiki - regrettably a lot of examples are still in xml as opposed to openstep - but unfortunately RL has been a bit too demanding for a lot of us...

PS: xml is still very much supported by the basic environment (gnustep & cocoa - the unfortunate snafu with lucid notwithstanding), so if you really, really want to use that as opposed to openstep format, by all means, do so! :D