Shipdata and Shipyard .plist for self made ships

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

Moderators: winston, another_commander

Post Reply
User avatar
Commander Learner
Dangerous
Dangerous
Posts: 123
Joined: Thu Aug 20, 2009 12:08 pm
Location: Somewheeeeeere over the rainbooooooooooow~

Shipdata and Shipyard .plist for self made ships

Post by Commander Learner »

Can the plist be like

Code: Select all

<key>Cruiser</key>
<dict>
<key>ai_type</key>
<string>route1traderAI.plist</string>
<key>bounty</key>
<integer>150</integer>
<key>cargo_type</key>
<string>CARGO_NOT_CARGO</string>
<key>energy_recharge_rate</key>
<real>4</real>
<key>exhaust</key>
<array>
<string>0 0 -30 10 8 15</string>
</array>
<key>forward_weapon_type</key>
<string>WEAPON_BEAM_LASER</string>
<key>has_ecm</key>
<true/>
<key>has_escape_pod</key>
<true/>
<key>likely_cargo</key>
<integer>8</integer>
<key>max_cargo</key>
<integer>20</integer>
<key>max_energy</key>
<real>406</real>
<key>max_flight_pitch</key>
<real>1.85</real>
<key>max_flight_roll</key>
<real>1.85</real>
<key>max_flight_speed</key>
<real>250</real>
<key>missiles</key>
<integer>5</integer>
<key>model</key>
<string>cruiser.dat</string>
<key>name</key>
<string>Ultra Cruiser (Trader Type)</string>
<key>roles</key>
<string>trader</string>
<key>thrust</key>
<real>50</real>
<key>weapon_energy</key>
<real>50</real>
</dict>

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>cruiser-player</key>
	<dict>
		<key>chance</key>
		<real>0.8</real>
		<key>optional_equipment</key>
		<array>
			<string>EQ_ECM</string>
			<string>EQ_PASSENGER_BERTH</string>
			<string>EQ_ESCAPE_POD</string>
			<string>EQ_ENERGY_BOMB</string>
			<string>EQ_ENERGY_UNIT</string>
			<string>EQ_NAVAL_ENERGY_UNIT</string>
			<string>EQ_DOCK_COMP</string>
			<string>EQ_WEAPON_PULSE_LASER</string>
			<string>EQ_WEAPON_BEAM_LASER</string>
			<string>EQ_WEAPON_MINING_LASER</string>
			<string>EQ_WEAPON_MILITARY_LASER</string>
			<string>EQ_FUEL_INJECTION</string>
			<string>EQ_SCANNER_SHOW_MISSILE_TARGET</string>
			<string>EQ_MULTI_TARGET</string>
			<string>EQ_GAL_DRIVE</string>
			<string>EQ_ADVANCED_COMPASS</string>
			<string>EQ_SHIELD_BOOSTER</string>			
			<string>EQ_NAVAL_SHIELD_BOOSTER</string>
		</array>
		<key>price</key>
		<integer>7000</integer>
		<key>standard_equipment</key>
		<dict>
			<key>extras</key>
			<array>
                <string>EQ_FUEL_SCOOPS</string>
			</array>
			<key>forward_weapon_type</key>
			<string>EQ_WEAPON_BEAM_LASER</string>
			<key>missiles</key>
			<integer>3</integer>
		</dict>
		<key>techlevel</key>
		<integer>9</integer>
		<key>weapon_facings</key>
		<integer>15</integer>
	</dict>
</dict>
</plist>


I'm trying to create a good ship but just can't get them in game!
Shooting polygons since 2001
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Post by Thargoid »

Those are entirely different ships ("cruiser" and "cruiser-player"). Presuming there's nothing wrong with it in detail, "cruiser" should appear randomly in the trader role. However the player version will never appear, as essentially it doesn't have a shipdata.plist entry going with it.

What you need to do is make a second ship entry in the shipdata.plist for "cruiser-player", with much the same stats as the NPC one ("cruiser") but with the role "player" and perhaps some of the added bits for player ships (external views and such) and removing the NPC-specific stuff like the AI key. Have a look at the shipdata.plist and shipyard.plist in the oolite.app/resources/config folder to see how it's done for the trunk NPC/player ships as a guide example.

Oh, and probably "cruiser" is something of a generic name for a ship, you might well be better with a name that's a little more specific or singular. You might also benefit from looking into the js console and debug.oxp (look in the wiki or search here for details), that way you can spawn ships and do all sorts of other interesting stuff directly in-game.
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Post by Commander McLane »

On top of Thargoid's explanation:

Isn't 7000 a little on the cheap side?

And why a bounty on a trader? If spawned by the System populator, the value will be ignored anyway.

And, for emphasis: "Cruiser" is not a good name for the entity (we are not talking about the <key>name</key> entry, but about the opening <key>Cruiser</key>. Shipdata entries (and textures, etc., etc.) must have unique names. If they don't, another OXP's "Courier" will simply overwrite and therefore obliterate your "Courier". And you don't want that.

Therefore you need a unique name for your entity. A name which guaranteed nobody else will ever again choose for his or her ship. And "Courier" is simply not that kind of name.

A very simple way of making names unique is to preceed them with your own name, or the name of the OXP you are working on. A "Commander-Learner-Courier" is much less likely to be produced by another ship designer than a "Courier". Even a "impressingnewshipsoxp-Courier" will probably not appear twice. Your entity names are your choice, but make sure that nobody else will make the same choice.

And I repeat: the very same goes for the model, texture, and shader file-names. Ideally they are the same as the entity name, thereby making clear what belongs together.
Post Reply