The following will enable the comms officer to launch and dock three small drone ships. Launch with "L", dock with "K". This requires adding scripts to whatever missions you wish to use it in.
The following ship goes in vesseldata.xml
<vessel uniqueID="1502" side="1" classname="Drone" broadType="fast">
<!-- TSN Drone -->
<art meshfile="dat/ENE_Matt3A.dxs" diffuseFile="dat/ship4A_diffuse.png"
glowFile="dat/ship4A_glow.png" specularFile="dat/ship4A_specular.png" scale="0.05" pushRadius="50"/>
<shields front="80" back="80" />
<performance turnrate="0.01" topspeed="5" />
<fleet_ai commonality="100" />
<beam_port x=" 111" y="-1" z="217" damage="1" arcwidth="0.3" cycletime="3.0" range="800"/>
<beam_port x="-111" y="-1" z="217" damage="1" arcwidth="0.3" cycletime="3.0" range="800"/>
<engine_port x="0" y="0" z="-230" />
<engine_port x="92" y="-7" z="-240" />
<engine_port x="-92" y="-7" z="-240" />
<impulse_point x="-124" y="-6" z="-248" />
<impulse_point x=" 124" y="-6" z="-248" />
<maneuver_point x="-177" y="-6" z="-132" />
<maneuver_point x=" 177" y="-6" z="-132" />
</vessel>
The rest needs to be merged with the relevant missions.
<!-- mission_data is the big wrapper for all the parts of a mission -->
<mission_data version="1.70">
<!-- all the things that exist at the start of the mission -->
<start>
<create type ="player" x="5000" y="0" z="95000" name="Artemis" angle="325"/>
<set_variable name="carrier_cooldown" value="0"/>
<set_variable name="clotho_launched" value="0"/>
<set_variable name="clotho_launched" value="0"/>
<set_variable name="lachesis_launched" value="0"/>
<set_variable name="atropos_launched" value="0"/>
<start_getting_keypresses_from consoles="C" />
</start>
<!-- ************************************ CARRIER BAY ******************************* -->
<!-- Launch ships -->
<event>
<if_object_property name="Artemis" property="positionX" comparator=">" value="1000"/>
<if_object_property name="Artemis" property="positionZ" comparator=">" value="1000"/>
<if_object_property name="Artemis" property="positionX" comparator="<" value="99000"/>
<if_object_property name="Artemis" property="positionZ" comparator="<" value="99000"/>
<!--<if_inside_box name="Artemis" leastx="1000" leastz="1000" mostx="99000" mostz="99000"/>-->
<if_client_key keyText="L" />
<if_variable name="carrier_cooldown" comparator="=" value="0"/>
<if_variable name="clotho_launched" comparator="=" value="0"/>
<set_variable name="clotho_launched" value="1"/>
<log text="Creating launch ship Clotho."/>
<incoming_comms_text from="Clotho">
Clotho launched.
</incoming_comms_text>
<play_sound_now filename="shiplaunch.wav"/>
<create type="neutral" hullID="1502" x="0" y="-5" z="0" angle="0" name="Clotho"/>
<set_relative_position name1="Artemis" name2="Clotho" angle="0" distance="300"/>
<copy_object_property name1="Artemis" name2="Clotho" property="angle"/>
<clear_ai name="Clotho"/>
<add_ai name="Clotho" type="FOLLOW_COMMS_ORDERS"/>
<add_ai type="TARGET_THROTTLE" targetName="Artemis" value1="1" name="Clotho" />
<set_timer name="carrier_timer" seconds="1"/>
<set_variable name="carrier_cooldown" value="3"/>
</event>
<event>
<if_object_property name="Artemis" property="positionX" comparator=">" value="1000"/>
<if_object_property name="Artemis" property="positionZ" comparator=">" value="1000"/>
<if_object_property name="Artemis" property="positionX" comparator="<" value="99000"/>
<if_object_property name="Artemis" property="positionZ" comparator="<" value="99000"/>
<!--<if_inside_box name="Artemis" leastx="1000" leastz="1000" mostx="99000" mostz="99000"/>-->
<if_client_key keyText="L" />
<if_variable name="carrier_cooldown" comparator="=" value="0"/>
<if_variable name="clotho_launched" comparator="=" value="1"/>
<if_variable name="lachesis_launched" comparator="=" value="0"/>
<set_variable name="lachesis_launched" value="1"/>
<log text="Creating launch ship Lachesis."/>
<incoming_comms_text from="Lachesis">
Lachesis launched.
</incoming_comms_text>
<play_sound_now filename="shiplaunch.wav"/>
<create type="neutral" hullID="1502" x="0" y="-5" z="0" angle="0" name="Lachesis"/>
<set_relative_position name1="Artemis" name2="Lachesis" angle="90" distance="300"/>
<copy_object_property name1="Artemis" name2="Lachesis" property="angle"/>
<clear_ai name="Lachesis"/>
<add_ai name="Lachesis" type="FOLLOW_COMMS_ORDERS"/>
<add_ai type="TARGET_THROTTLE" targetName="Artemis" value1="1" name="Lachesis" />
<set_timer name="carrier_timer" seconds="1"/>
<set_variable name="carrier_cooldown" value="3"/>
</event>
<event>
<if_object_property name="Artemis" property="positionX" comparator=">" value="1000"/>
<if_object_property name="Artemis" property="positionZ" comparator=">" value="1000"/>
<if_object_property name="Artemis" property="positionX" comparator="<" value="99000"/>
<if_object_property name="Artemis" property="positionZ" comparator="<" value="99000"/>
<!--<if_inside_box name="Artemis" leastx="1000" leastz="1000" mostx="99000" mostz="99000"/>-->
<if_client_key keyText="L" />
<if_variable name="carrier_cooldown" comparator="=" value="0"/>
<if_variable name="lachesis_launched" comparator="=" value="1"/>
<if_variable name="atropos_launched" comparator="=" value="0"/>
<set_variable name="atropos_launched" value="1"/>
<create type="neutral" hullID="1502" x="0" y="-5" z="0" angle="0" name="Atropos"/>
<log text="Creating launch ship Atropos."/>
<incoming_comms_text from="Atropos">
Atropos launched.
</incoming_comms_text>
<set_relative_position name1="Artemis" name2="Atropos" angle="270" distance="300"/>
<copy_object_property name1="Artemis" name2="Atropos" property="angle"/>
<clear_ai name="Atropos"/>
<add_ai name="Atropos" type="FOLLOW_COMMS_ORDERS"/>
<add_ai type="TARGET_THROTTLE" targetName="Artemis" value1="1" name="Atropos" />
<set_timer name="carrier_timer" seconds="1"/>
<set_variable name="carrier_cooldown" value="3"/>
</event>
<event>
<if_timer_finished name="carrier_timer"/>
<if_variable name="carrier_cooldown" comparator="!=" value="0"/>
<set_variable name="carrier_cooldown" value="0"/>
</event>
<event>
<if_client_key keyText="K" />
<if_variable name="clotho_launched" comparator="=" value="1"/>
<if_exists name="Clotho"/>
<if_distance name1="Artemis" name2="Clotho" comparator="LESS_EQUAL" value="500"/>
<set_variable name="clotho_launched" value="0"/>
<log text="Docking launch ship Clotho."/>
<incoming_comms_text from="Clotho">
Clotho docked.
</incoming_comms_text>
<play_sound_now filename="shipdock.wav"/>
<destroy name="Clotho"/>
</event>
<event>
<if_client_key keyText="K" />
<if_variable name="lachesis_launched" comparator="=" value="1"/>
<if_exists name="Lachesis"/>
<if_distance name1="Artemis" name2="Lachesis" comparator="<" value="500"/>
<set_variable name="lachesis_launched" value="0"/>
<log text="Docking launch ship Lachesis."/>
<incoming_comms_text from="Lachesis">
Lachesis docked.
</incoming_comms_text>
<play_sound_now filename="shipdock.wav"/>
<destroy name="Lachesis"/>
</event>
<event>
<if_client_key keyText="K" />
<if_variable name="atropos_launched" comparator="=" value="1"/>
<if_exists name="Atropos"/>
<if_distance name1="Artemis" name2="Atropos" comparator="<" value="500"/>
<set_variable name="atropos_launched" value="0"/>
<log text="Docking launch ship Atropos."/>
<incoming_comms_text from="Atropos">
Atropos docked.
</incoming_comms_text>
<play_sound_now filename="shipdock.wav"/>
<destroy name="Atropos"/>
</event>
<!-- ************************************ /CARRIER BAY ****************************** -->
</mission_data>
Thanks so much to Mike_Substelny and TreChipman for their help!
[Last edited Jan 12, 2013 05:22:37]