| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • Finally, you can manage your Google Docs, uploads, and email attachments (plus Dropbox and Slack files) in one convenient place. Claim a free account, and in less than 2 minutes, Dokkio (from the makers of PBworks) can automatically organize your content for you.

View
 

Mission Scripting

Page history last edited by Ryan McMullan 2 months ago Saved with comment

SOFTWARE

In order to create missions, it is advised that you use software that will ease the process for you.  The Artemis Mission Editor is a stand-alone mission editing environment for Artemis, developed by players, that provides advanced functionality. The Artemis Mission Wizard  is a quick way to create simple missions without being a programmer, but it only supports Artemis 2.3 and earlier.  Or, if you prefer to edit missions manually as XML files, use a notepad program that supports xml syntax highlighting and checking, like XmlPad or Notepad++.

 

DOCUMENTATION

The mission-file-docs.txt in the Artemis installation folder contains some notes, but it contains some errors whereas this wiki contains corrections.

 

GENERAL NOTES

The mission script system is designed to let anyone create, share, and play game missions for Artemis.  

 

In the Artemis install folder, there's a subfolder called 'dat'.  Inside that is another folder called 'Missions'.  Inside the Missions folder, each mission needs to have its own unique folder. Each mission folder name must start with 'MISS_'. Inside a mission folder must be 1 XML file.  It must share the same exact name as the folder it's inside, except for the .xml suffix.  This file will contain all the commands that make the mission happen.  There may be other files in the same folder.  As a general rule, any sound, video, or image files that the mission uses must be in the same folder as the XML file that references it.

 

To run a scripted mission, choose “Start Server” when the Artemis game starts up.  At that point, the game will look inside the Missions subfolder and make a list of every folder that starts with "MISS_".  On the Server control screen you can select one of those missions.  If you do, you can still set the game difficulty.  The difficulty setting won't control the amount and type of enemies (the mission will do that), but it will still control the enemy beam damage and the efficiency of the Artemis' systems.

 

When you've chosen your mission (and other settings), click the "Start Game" button.  As the game is initialized, the Artemis app will attempt to open the chosen folder and read the XML file inside.  It will read the entire XML script into memory, and keep it in memory for the entire game.

 

The XML script should contain a single <start> block.  At the start of  the mission, the commands in the start block will be immediately followed.

 

The XML script should also contain <event> blocks.  These blocks should contain both command and condition blocks.  For each event block, all of its condition blocks are checked.  If they are all TRUE, then all of the event's command blocks are immediately followed. 

 

So, when you make a mission XML file, use one start block to create all the initial conditions of the mission.  Then use event blocks to trigger parts of the story when they are supposed to occur.

 

For a more detailed description, see the Introduction to Mission Scripting.

 

SCRIPTING TUTORIALS (For Artemis v. 1.702):

Characters - Artemis Mission Scripting 101 - by Michael Sweeney

Events – Artemis Mission Scripting 101 - by Michael Sweeney

Timing - Artemis Mission Scripting 101 - by Michael Sweeney

Artemis Scripting Quick Start for Programmers PDF - by T. L. Ford

 

 

CODE SNIPPETS

The community has created some code snippets which can be added to your missions to provide new functionality or flavour to the mission.

 

COMMAND REFERENCE

 

 

Variables and Expressions

Object Properties

Brain Stacks (AI)

Default Brain Stacks (AI)

Default Ship Brain Stack (AI) PDF

 

 

 

Command Added in Version Description Doc note
add_ai  1.70 Adds an AI block to the brain stack of an object  
addto_object_property  1.70 Adds a value to a property  
big_message  1.70 Creates a chapter title on main screen  
clear_ai 2.1.1 Removes all AI blocks from the brain stack from an object  
clear_comms_button 2.5.104 Removes a button from all relevant Comms consoles  
clear_gm_button 2.4 Removes a button from the current GM console  
clear_player_station_carried 2.6 Clear replacement fighters from a station  
copy_object_property  1.70 Copies the value of a property from an object to another  
create  1.70 Creates a named object or a set of unnamed objects  
destroy  1.70 Removes object  
destroy_near  1.70 Destroys object  
direct  1.70 Direct neutral/enemy to go somewhere or fight Deprecated
end_getting_keypresses_from 1.70 Deactivate keypresses on all consoles of a given set of console types  
end_mission 1.50 Stops the mission  
get_object_property 2.7.5 Copies an object property to a variable  
gm_instructions 2.4 Sets text to be displayed by the Instructions button on the GM console  
incoming_comms_text  1.70 Sends text to Comms  
incoming_message  1.70 Makes a Comms button to play media file Deprecated 
log  1.70 Sends text to mission log file (debugging)  
play_sound_now  1.70 Plays sound  
set_comms_button 2.5.104 Adds a button to all relevant Comms consoles  
set_damcon_members 1.55 Changes the count of DamCon personnel on a player ship  
set_difficulty_level  1.70 Overrides server difficulty setting  
set_fleet_property  1.70 Sets a fleet property  
set_gm_button 2.4 Adds a button to the GM console  
set_object_property  1.70 Sets an object property  
set_monster_tag_data 2.6.3 Defines tag text for a monster  
set_named_object_tag_state 2.6.3 Defines tag info for an AI ship  
set_player_carried_type 2.5.107 Defines a single seat ship to be carried inside another player ship  
set_player_grid_damage  1.70 Changes player ship damage value  
set_player_station_carried 2.6 Adds a replacement fighter to a station  
set_relative_position  1.70 Moves object relative to another  
set_ship_text  1.70 Change name/descriptions/hail text for named object  
set_side_value 2.1.1 Change ship to neutral/friend/enemy  
set_skybox_index 1.46 Changes the skybox (background)  
set_special 2.1.1 Change captain/ship adjective  
set_timer  1.70 Makes or sets a named timer  
set_to_gm_position  1.70 Moves object to GM selection  
set_variable  1.70 Makes or sets a named value  
spawn_external_program 2.5.107 Spawns an external program  
start_getting_keypresses_from 1.70 Activate keypresses on all consoles of a given set of console types  
warning_popup_message 1.46 Sends a short message to station(s)  

 

 

Condition Added in Version Description Doc note
if_client_key 1.70 If a console has pressed a key  
if_comms_button 2.5.104 If a special button is clicked on a Comms console  
if_damcon_members 1.55 If damcon team member count meets a condition  
if_difficulty 1.65 If game difficulty meets a condition  
if_distance  1.70 If named objects are within XYZ of each other  
if_docked  1.70 If a player ship is docked with a named station  
if_exists  1.70 If a named object exists right now  
if_external_program_active 2.5.107 If a spawned external program is still executing  
if_external_program_finished 2.5.107 If a spawned external program has finished  
if_fleet_count  1.70 If fleet ship count meets a condition  
if_gm_button 2.4 If a button is clicked on a GM console  
if_gm_key  1.70 If GM has pressed a key  
if_in_nebula 2.6.3 If a player ship is in a nebula of a given type  
if_inside_box  1.70 If named object within coords  
if_inside_sphere  1.70 If named object within coords  
if_monster_tag_matches 2.6.3 If named monster has a given tag  
if_not_exists  1.70 If a named object does not exist right now  
if_object_property  1.70 If an object's property meets a condition  
if_object_tag_matches 2.6.3 If an AI ship has a given tag  
if_outside_box  1.70 If named object outside coords  
if_outside_sphere  1.70 If named object outside coords  
if_player_is_targeting  1.70 If weapons on the ship in player slot 0 are locked on a named object  
if_scan_level 2.6.3 If a named space object's scan level meets a condition  
if_timer_finished  1.70 If a timer has reached zero  
if_variable  1.70 If variable meets a condtion  

 

XML Node Added in Version Description Doc note
*_arme Ignored by Artemis  Mission Editor Use Only  
event 2.1  XML that executes on timer/triggered events  
mission_data 2.1  Overall XML wrapper  
mission_description 2.7 Body is a description displayed on the server setup screen  
start 2.1  XML that immediately executes  

 

 

OBJECT TYPES:

Objects

     Stations

     Ships

          Enemies

               Elites

          Neutrals

          Players

 

MISCELLANEOUS:

folder_arme, name_arme, id_arme, parent_id_arme  - These are generated and used by the Artemis Mission Editor to organize the XML blocks into named folders and are ignored by the Artemis engine and are not part of the mission-file-docs.txt.

 

DEBUGGING:

When Artemis is running, on the Server, press [F7] multiple times to cycle through debug information. 

 1. Latest commands executed by the script (v.2.0)

 2. Status of all scripted timers (v.2.0)

 3. Status of all scripted variables (v.2.0)

 4. Information about the latest scripted keypresses from consoles (v.2.0)

 5. Brain stack for the Science console's selected NPC ship, with its current mission (v.2.1)

 8. Brain stack for the Science console's selected monster, with its current mission (v.2.2)

 7. Return to normal main screen

 

Comments (0)

You don't have permission to comment on this page.