Custom Beacons

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: winston, another_commander

Post Reply
Ragged
Above Average
Above Average
Posts: 28
Joined: Mon Jun 29, 2009 10:55 am

Custom Beacons

Post 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?
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Post 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.
Ragged
Above Average
Above Average
Posts: 28
Joined: Mon Jun 29, 2009 10:55 am

Post 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!
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Post 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...
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
Ragged
Above Average
Above Average
Posts: 28
Joined: Mon Jun 29, 2009 10:55 am

Post 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.
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Post 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
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
Post Reply