Page 1 of 1

Additional escape pods on player ships

Posted: Sat Sep 15, 2012 11:45 am
by Shipbuilder
Is it possible to define a player ship that can be fitted with 2 escape pods ?

I am thinking of possibly incorporating this in to my larger ship designs, probably at the expense of some cargo capacity and probably also limited to ships with a standard cargo capacity of 100T or greater.

The reasoning is to provide the pilot with a backup escape pod should the first pod be damaged during combat.

Re: Additional escape pods on player ships

Posted: Sat Sep 15, 2012 12:11 pm
by cim
You could define a piece of equipment called "Backup escape pod", and then monitor for damage to the real escape pod. If it gets damaged, and the backup escape pod is still okay, then repair the real escape pod, and damage the backup escape pod instead.

Re: Additional escape pods on player ships

Posted: Sat Sep 15, 2012 3:08 pm
by Wildeblood
No, you can't define it to be so in shipdata, the way you can for an npc ship. But as cim says, it would be a fairly easy thing to script.

Re: Additional escape pods on player ships

Posted: Sat Sep 15, 2012 4:10 pm
by Shipbuilder
It looks like at some stage I'm going to have to try to get my head around scripting :?

Re: Additional escape pods on player ships

Posted: Sun Sep 16, 2012 12:28 am
by Shipbuilder
Is anyone able to advise me where I am going wrong ?

I am trying to define my own escape pod model on a test ship.

In the ship data.plist I have added the following to the code for the actual ship

Code: Select all

  		<key>escape_pod_model</key>
		<string>galtech_escape_pod_1.dat</string>
I have then added the following code in to the shipdata.plist

Code: Select all

		<key>>galtech_escape_pod_1</key>
		<dict>	
  			<key>model</key>
			<string>galtech_escape_pod_1.dat</string>
			<key>name</key>
			<string>GalTech Escape Pod</string>
			<key>roles</key>
			<string>escape_pod</string>
		</dict>
I have tried a number of other combinations but am only able to get a default escape capsule to appear.

Re: Additional escape pods on player ships

Posted: Sun Sep 16, 2012 12:54 am
by Wildeblood
You have to specify the role of your custom escape pod (not its entry key).
Code:
        <key>escape_pod_model</key>      <string>galtech_escape_pod_1</string> <--- this refers to...
Code:
      <key>galtech_escape_pod_1</key> <--- not this,
      <dict>
         <key>model</key>         <string>galtech_escape_pod_1.dat</string> <--- not this,
         <key>name</key>         <string>GalTech Escape Pod</string>
         <key>roles</key>         <string>escape_pod(0.1) galtech_escape_pod_1</string> <--- but this!
      </dict>

Re: Additional escape pods on player ships

Posted: Sun Sep 16, 2012 9:36 am
by Shipbuilder
Thanks Wildeblood.

What I have done is set up a test script, (well adapted a script that smivs helped me with previously to be more exact), which spawns 5 ships each time you launch from a station. The shipdata.plist code for these ships are noted below. I have given them a nullAI so that they basically just hang around in space doing nothing.

I have then tried to update the code as per your earlier reply this using the code below but Oolite is still using the standard escape pod model :?

I'm sure that this is an easy one once you know what to do but I've been messing about with this for some time and any assistance getting this to work would be much appreciated.

Code: Select all

	<key>>galtech_escape_pod_1</key>
	<dict>	
  			<key>model</key>
			<string>galtech_escape_pod_1.dat</string>
			<key>name</key>
			<string>GalTech Escape Pod</string>
			<key>roles</key>
			<string>escape_pod(0.01) galtech_escape_pod_1</string>
	</dict>

	<key>serpent</key>
	<dict>	
  		<key>escape_pod_model</key>
		<string>galtech_escape_pod_1.dat</string>
		<key>auto_ai</key>
		<string>no</string>
		<key>ai_type</key>
		<string>nullAI.plist</string>		
		<key>model</key>
		<string>serpent.dat</string>
		<key>name</key>
		<string>Serpent</string>
		<key>roles</key>
		<string>serpent</string>
		<key>scan_class</key>
		<string>CLASS_NEUTRAL</string>
		<key>has_escape_pod</key>
		<string>6.0</string>
		<key>subentities</key>
		<array>
			<string>*FLASHER* 36.5 1.6 -66.0 0 0.5 1 1.5</string>
			<string>*FLASHER* -36.5 1.6 -67.0 500 0.5 0 1.5</string>
		</array>
		<key>materials</key>
		<dict>
		<key>Serpent_auv.png</key>
		<dict>
		<key>emission_map</key>
		<string>serpent_glow.png</string>
		</dict>
		</dict>
</dict>

Re: Additional escape pods on player ships

Posted: Sun Sep 16, 2012 9:46 am
by Wildeblood
the "escape_pod_model" key in the mothership's entry has to refer to the role, not the model. You've still got <key>escape_pod_model</key>
<string>galtech_escape_pod_1[b].dat[/b]</string>
. In a nutshell, lose the .dat part.

(See above post.)

Re: Additional escape pods on player ships

Posted: Sun Sep 16, 2012 10:03 am
by Shipbuilder
Thanks Wildeblood I'll have a look at this. :wink:

EDIT - I have got this working now :D

Re: Additional escape pods on player ships

Posted: Mon Sep 17, 2012 7:15 pm
by Kaks
Excellent news! :)

By the way, if you don't want your type of escape pod to be used by any old ship, you can always do

<key>roles</key> <string> galtech_escape_pod_1</string>

and they'll be used exclusively by the ones with <key>escape_pod_model</key> <string> galtech_escape_pod_1</string>

or, in 'new money':
roles = "galtech_escape_pod_1";

&

escape_pod_model = "galtech_escape_pod_1";


Come to think of it, escape_pod_model is quite counterintuitive as a property name.
Unless anyone objects, I'm thinking of introducing escape_pod_role as the equivalent (& more intuitive) property name, while still supporting (but deprecating) escape_pod_model for the next stable release, a bit like what's already happened to a handful of other ship properties between 1.65 & 1.76.