Members | Sign In
All Forums > Mission Scripting
avatar

Code Snippet - Away Teams

posted Jun 07, 2011 19:06:57 by TreChipman
So I was playing around with the 1.46 scripting, and I think I have a way to implement away teams via scripting. Here's what I came up with. I haven't fully tested it out yet, but I do know that blowing up the enemy ship works :). My main unknown at this point is if the has_surrendered setting is correct in the event of a successful mission. Anyway, let me know what you guys think!



<!-- Send over the Away team -->

<event>
<if_variable name="awayteam" comparator="<" value="1"/>
<if_distance name1="Artemis" name2="targetShip" comparator="<" value="5000"/>
<if_object_property name="targetShip" property="shieldStateFront" comparator="<" value="20"/>
<incoming_comms_text from="Commander Ryan">
This is Commander Ryan to Artemis.^
My team is aboard the target vessel now, and^
our mission is underway. We expect it will^
only take about a minute for us to override^
the ship's central computer. Stay within^
5000 km to maintain a lock on the away team^
and be ready to beam us back in 60 seconds.^
Also, if you could not blow up the ship with^
us still aboard it, I'd appreciate it.^
Ryan out.^ ^ ^
</incoming_comms_text>
<log text="Away team deployed."/>
<set_timer name="awaytimer" seconds="60"/>
<warning_popup_message message="Away team deployed. Do not destroy targetShip" consoles="W"/>
<warning_popup_message message="Away team deployed. Stay withing 5000 km of targetShip" consoles="H"/>
<set_variable name="awayteam" value="1"/>
</event>


<!-- The target ship was blown up with the Away team aboard! -->

<event>
<if_variable name="awayteam" comparator="=" value="1"/>
<if_object_property name="targetShip" property="hullDamageFront" comparator="<" value="1"/>
<incoming_comms_text from="Commander Ryan">
She's breaking up! She's brea--**SIGNAL LOST**^ ^ ^
</incoming_comms_text>
<warning_popup_message message="Contact Lost with Away team" consoles="C"/>
<log text="Away team lost."/>
<set_variable name="awayteam" value="3"/>
<end_mission>
</event>


<!-- Too far away from Away Team to maintain contact -->

<event>
<if_variable name="awayteam" comparator="=" value="1"/>
<if distance name1="Artemis" name2="targetShip" comparator=">" value="5000"/>
<incoming_comms_text from="Commander Ryan">
... say again... temi... nder Rya...^
ost... signa... eavy fire... reques...^
...diat extractio-- **SIGNAL LOST**^ ^ ^
</incoming_comms_text>
<warning_popup_message message="Contact Lost with Away team" consoles="C"/>
<log text="Away team lost."/>
<set_variable name="awayteam" value="3"/>
<end_mission>
</event>


<!-- They've been recovered! -->

<event>
<if_variable name="awayteam" comparator="=" value="1"/>
<if_timer_finished name="awaytimer"/>

<incoming_comms_text from="Commander Ryan">
This is Commander Ryan to Artemis.^
Our mission was successful, and we're ready^
to come home, Artemis.^ ^ ^
</incoming_comms_text>
<warning_popup_message message="Away team recovered" consoles="C"/>
<set_object_property name="targetShip" property="hasSurrendered" value="1"/>
<set_object_property name="targetShip" property="willAcceptCommsOrders"/>
<set_variable name="awayteam" value="2"/>
<log text="Away team recovered."/>
</event>
[Last edited Jun 08, 2011 05:26:48]
I'm not a mad scientist. I'm an angry one. You'd be wise to fear the latter.

Visit Artemis Command!
page   1
4 replies
avatar
Mike_Substelny said Jun 08, 2011 00:03:13
This looks very clever. But will it only work if you are attacking an enemy called "targetShip?"
"Damn the torpedoes! Four bells, Captain Drayton!"

(Likely actual words of Admiral David Farragut, USN, at the battle of Mobile Bay. Four bells was the signal for the engine room to make full steam ahead).
avatar
TreChipman said Jun 08, 2011 01:37:39
Yes; it'll only work on a mission-specific target (and, of course, you'll need to change the 'targetShip' to the name of the object of your choice), but it's a start.

Oh, and also, at some point prior to this becoming an event, you'll need to work in:
<set_variable name="awayteam" value="0"/>
[Last edited Jun 08, 2011 05:44:42]
I'm not a mad scientist. I'm an angry one. You'd be wise to fear the latter.

Visit Artemis Command!
avatar
5th_Wall_Gaming said Jul 21, 2011 02:48:17
Great Job. :)

As a side note, there should be a variable that equals whatever ship is being targeted. :)
http://www.5thWallGaming.com
We make dreams reality
avatar
5th_Wall_Gaming said Jul 23, 2011 04:56:02
Improved the script for ya to include random roll of the "dice" every 4 mins. D20. If they get a 15 or higher, then they capture it.


============================

<event Name="Away Team: Send Over To Ship">
<if_variable name="AwayTeamStatus" comparator="=" value="0"/>
<if_distance name1="Artemis" name2="USS Kobiashi Maru" comparator="<" value="5000"/>
<if_object_property name="USS Kobiashi Maru" property="shieldStateFront" comparator="<" value="5"/>

<incoming_comms_text from="Commander Ryan">
This is Commander Ryan to Artemis.^
My team is aboard the target vessel now, and^
our mission is underway. We expect it will^
only take about 5 minutes for us to override^
the ship's central computer. Stay within^
5000 km to maintain a lock on the away team^
and be ready to beam us back in 5 mins.^
Also, if you could not blow up the ship with^
us still aboard it, I'd appreciate it.^
Ryan out.^ ^ ^
</incoming_comms_text>

<log text="Away team deployed."/>

<warning_popup_message message="Away team deployed. Do not destroy USS Kobiashi Maru" consoles="W"/>
<warning_popup_message message="Away team deployed. Stay withing 5000 km of USS Kobiashi Maru" consoles="H"/>

<set_variable name="AwayTeamStatus" value="1"/>
<set_timer name="AwayTeamTimer" seconds="240"/>
</event>

<event Name="Away Team: Blew Up Ship">
<if_variable name="AwayTeamStatus" comparator="=" value="1"/>
<if_object_property name="USS Kobiashi Maru" property="hullDamageFront" comparator="<" value="1"/>

<incoming_comms_text from="Commander Ryan">
She's breaking up! She's brea--**SIGNAL LOST**^ ^ ^
</incoming_comms_text>

<warning_popup_message message="Contact Lost with Away team" consoles="C"/>
<log text="Away team lost."/>

<set_variable name="AwayTeamStatus" value="10"/>
</event>

<event Name="Away Team: Moved out of range">
<if_variable name="AwayTeamStatus" comparator="=" value="1"/>
<if distance name1="Artemis" name2="USS Kobiashi Maru" comparator=">" value="5000"/>

<incoming_comms_text from="Commander Ryan">
... say again... temi... nder Rya...^
ost... signa... eavy fire... reques...^
...diat extractio-- **SIGNAL LOST**^ ^ ^
</incoming_comms_text>

<warning_popup_message message="Contact Lost with Away team" consoles="C"/>
<log text="Away team lost."/>

<set_variable name="AwayTeamStatus" value="10"/>
</event>

<event Name="Away Team: Trying to Capture Ship">
<if_variable name="AwayTeamStatus" comparator="=" value="2"/>
<if_timer_finished name="AwayTeamTimer"/>

<set_variable name="AwayTeamRoll" randomIntLow="1" randomIntHigh="20"/>
<set_variable name="AwayTeamStatus" value="3"/>
</event>


<event Name="Away Team: Trying to Capture Ship">
<if_variable name="AwayTeamStatus" comparator="=" value="3"/>
<if_variable name="awayteamRoll" comparator=">" value="14"/>

<set_timer name="AwayTeamTimer" seconds="240"/>
<set_variable name="AwayTeamStatus" value="4"/>
</event>


<event Name="Away Team: Captured Ship">
<if_variable name="AwayTeamStatus" comparator="=" value="4"/>

<incoming_comms_text from="Commander Ryan">
This is Commander Ryan to Artemis.^
Our mission was successful, and we're ready^
to come home, Artemis.^ ^ ^
</incoming_comms_text>

<warning_popup_message message="Away team recovered" consoles="C"/>

<set_object_property name="USS Kobiashi Maru" property="willAcceptCommsOrders"/>

<set_variable name="AwayTeamStatus" value="0"/>

<log text="Away team recovered."/>
</event>
http://www.5thWallGaming.com
We make dreams reality
Login below to reply: