A Blog about Living Slightly in the Future

Timing – Artemis Mission Scripting 101 – Part Three

This is a three part tutorial written for Artemis 1.702

Writing missions for the Artemis Spaceship Bridge Simulator is much different from writing the usual fan fiction. There is a heavy dose of Mary Sue, since the player ship drives the action, and you can never count on the players following your story.
In our first tutorial we laid out an exciting playfield for open action, pitting our protagonist against some predictable enemies. In our second tutorial we created an actual story with an impossible outcome that only cheating could overcome.

For this tutorial we're going to create three mission scripts, each a simple example of an important building block that can be strung together for more ambitious missions.

All story telling is about characters, events and timing. Characters move through the events in a certain structure, one thing happening after another, sometimes the end is told first, sometime we end in the middle. With Artemis each mission has the chance of being told in any order.

This part of the tutorial will be about managing timing.

The Artemis simulator uses "timers" to keep track of when things will happen. Timers can be set to begin in the "start" block, or in "events" that are set off when conditions are met. Setting timers in the "start" block is a good way to ensure important story elements are exposed to the player crew at the same time every time a mission is played. Setting timers inside events with conditions can infleunce other events, heighten drama, give the crew time to think about their next move before there are consequences and help push them in any direction.
In order to set up a compelling adventure we need something for a storyline. It doesn't need to be lengthy or complicated, but you'll usually want to be more than "go there, shoot that". Artemis already has a competent "Invasion" mode if you just want to fly around blowing up aliens.

For the purposes of this tutorial we are going to borrow from a famous scenario that is short, to the point and always ends with a bang.

As a reminder when creating a new mission you need to create a new folder in the /Program Files/Artemis/dat/Missions folder. The new folder name must start with MISS_, contain no spaces and should give a clear, but abbreviated, idea about the mission name. As an example the "Module 3 bases" folder is called "MISS_Module_3_bases". Inside the folder you only need one file, the XML mission that must be similarly named, but end with dot xml, as opposed to dot doc or dot txt.
There are many text editors that you can choose from, I personally prefer BBEdit, and the Artemis community has the fantastic Artemis Mission Editor.

We still recommend that you don't get in the habit of editing the mission files while they are in the Mission folder itself, instead work on the files somewhere else and then copy them into the Mission folder for testing. This is just good workflow habit.

<!---this will be our first timer -->
<set_timer name="distressSignal_timer" seconds="60"/-->

Now we have a timer counting down. The "time" tag has two properties, name and seconds. I try to keep a consistent naming convention so things can be told apart at a glance.

We're going to use our AJAX tutorial 2 as the starting point for experimenting with timers. We want a nice opening title, our player ship, what resources it should have at start, a friendly space station and our neutral ship. We want to keep our neutral ship from wandering off, so clear the AI stack and tell it to stay in one place. We also don't want a mischievous Comm officer accidentally ordering our "crippled" nuetral to head anywhere.
After that we'll drop in a nebula for color, a minefield to give our Helm something to think about and an asteroid field for fun.

<!-- mission_data is the big wrapper for all the parts of a mission -->
<mission version="1.22">
<!--- COMMENT: this is where we specify what appears when the mission first starts -->
<start>
<!--- have a nice big mission title appear on the main screen -->
<big_message title="AJAX tutorial 3" subtitle1="written by Michael Sweeney"/>

We have a basic story we want to encourage the player crew to follow (to their doom). In the previous tutorial we notified the player crew of our ship in distress when they left small sphere we created around them. This requires the player crew to take some action and actually move a certain distance. Since we can't count on a player crew to do anything, as they may option to just sit there, we set a timer in the "start" block so our distress signal will appear at the same time every time this mission is played.
Having a timer running is great, but it will run out eventually and does nothing on its own. We need to update our first event to accommodate the timer.

We still need the "distressSignal" variable to be set to "1" so this event will be ignored after and not fire off over and over forever. This means that we could set "distressSignal" to 0 and run our "distressSignal_timer" again to have this event block be revealed to the player again in the future.

When the mission started the neutral cargo ship was placed on the left center of the minefield. We gave it a direction of 0 and throttle of 0, so it wouldn't be moving.
This is a little boring, and might be seen as an obvious set up by a justifiable suspicious player crew.

We will change the location and "DIR_THROTTLE" for the neutral cargo ship to value1 of 0 and value2 of 5. This will make the neutral cargo ship fly straight north at high speed.

Obviously we don't want to ship to be flying away from the player crew after it has sent the distress signal, so we'll update the "DIR_THROTTLE" for the neutral cargo ship to value1 of 0 and value2 of 0 in the same event as the distress signal.

<add_ai name="TR80" type="DIR_THROTTLE" value1="0" value2="0" />
<incoming_comms_text from="TR80">
Imperative!^
This is the Transport 80 ARGUS! 19 light years out of Altair Six!^
We have struck a gravitic mine and have lost all power!^
Our hull is penetrated and we have sustained many casualties!^
Our life support system is failing!
</incoming_comms_text>
<warning_popup_message message="ALERT! Distress signal from TR80!" consoles="M"/>
<set_variable name="distressSignal" value="1"/>
</event>

We don't need to change the events that fire off as the player ship moves through our minefield, and only a small change to our conditions about how our cargo ship is revealed as a trap. We will change the fatal blow for our crew from them trying to escape, moving outside of a sphere, to a very short timer. This ensures that the crew doesn't accidentally survive without knowing how to cheat the mission.

Next, we'll change the event that has our space station chastise our crew for ignoring the distress signal to a repeating alert. This should pester our crew into action if the chose to explore the playfield instead. We already snuck the "set_timer" into the "start" block.

<incoming_comms_text from="OUTPOST ALPHA">
AJAX?^
We received a distress signal?^
Proceed to help vessel in distress!
</incoming_comms_text>
<warning_popup_message message="ORDERS: Proceed to help TR80!" consoles="M"/>

<set_timer name="admonishDistress_timer" seconds="60"/>
</event>

We also need to add a new event block with timer to our "game over" conditions so our player crew can see the homage to our stories inspiration.

With just a little polish we have an exciting adventure that should encourage our players to trust their gamemaster much less, as is appropriate.

Timers are obviously quite useful, and we have only scratched the surface. We've seen creative use of switching one kind of object for another and making bad guys appear. With creative use of events, timers and create tags you could have a minefield that contracts around a player, or an asteroid field that moves across the playfield!
One thing you can't do in version 1.702 is change the time amounts as variables. This means you can't have a timer that increases itself after each pass, but it can be faked with creative scripting.