Members | Sign In
All Forums > Mission Scripting
avatar

Mission Script Ref 1.46

posted Jun 05, 2011 04:11:55 by ThomRobertson
-----------------------------------------------------------------------------
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.

When the Artemis game starts up, choose "Start Server". 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 diff
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.



-----------------------------------------------------------------------------
COMMAND: create (the command that creates named objects in the game)
ATTRIBUTE: type
VALID: station, player, enemy, neutral, anomaly
ATTRIBUTE: x
VALID: 0 to 100000
ATTRIBUTE: y
VALID: -100000 to 100000
ATTRIBUTE: z
VALID: 0 to 100000
ATTRIBUTE: name
VALID: text
ATTRIBUTE: hulltype
VALID: 0-? (corresponds to the unique hull ID in vesselData.xml)
ATTRIBUTE: angle
VALID: 0-360
ATTRIBUTE: fleetnumber
VALID: 1-99


-----------------------------------------------------------------------------
COMMAND: create (the command that creates UNnamed objects in the game)
ATTRIBUTE: type
VALID: nebulas, asteroids, mines

ATTRIBUTE: count
VALID: 0 to 500
ATTRIBUTE: radius
VALID: 0 to 100000
ATTRIBUTE: randomRange
VALID: 0 to 100000
ATTRIBUTE: startX
VALID: 0 to 100000
ATTRIBUTE: startY
VALID: -100000 to 100000
ATTRIBUTE: startZ
VALID: 0 to 100000
ATTRIBUTE: endX
VALID: 0 to 100000
ATTRIBUTE: endY
VALID: -100000 to 100000
ATTRIBUTE: endZ
VALID: 0 to 100000
ATTRIBUTE: randomSeed
VALID: 0 to big number
ATTRIBUTE: startAngle
VALID: 0 to 360
ATTRIBUTE: endAngle
VALID: 0 to 360


-----------------------------------------------------------------------------
COMMAND: destroy (the command that removes something named from the game)
ATTRIBUTE: name
VALID: text


-----------------------------------------------------------------------------
COMMAND: destroy_near (the command that removes unnamed objects from the game, if near a point)
ATTRIBUTE: type
VALID: nebulas, asteroids, mines
ATTRIBUTE: centerX
VALID: 0 to 100000
ATTRIBUTE: centerY
VALID: -100000 to 100000
ATTRIBUTE: centerZ
VALID: 0 to 100000
ATTRIBUTE: radius
VALID: 0 to 100000


-----------------------------------------------------------------------------
COMMAND: direct (the command that tells a neutral or enemy to go somewhere or fight something)
ATTRIBUTE: name
VALID: text

ATTRIBUTE: targetName
VALID: text

ATTRIBUTE: pointX
VALID: 0 to 100000
ATTRIBUTE: pointY
VALID: -100000 to 100000
ATTRIBUTE: pointZ
VALID: 0 to 100000

ATTRIBUTE: scriptThrottle
VALID: 0.0 to 1.0


-----------------------------------------------------------------------------
COMMAND: set_variable (makes or sets a named value)
ATTRIBUTE: name
VALID: text
ATTRIBUTE: value
VALID: 0 to big number

-----------------------------------------------------------------------------
COMMAND: set_timer (makes or sets a named timer)
ATTRIBUTE: name
VALID: text
ATTRIBUTE: seconds
VALID: 0 to big number


-----------------------------------------------------------------------------
COMMAND: incoming_message (creates a Comms button to play a media file on the main screen)
ATTRIBUTE: from
VALID: text
ATTRIBUTE: fileName (all media files belong in the mission subdirectory, alongside the mission script XML file)
VALID: text
ATTRIBUTE: mediaType
VALID: 0 (for OGG audio files)


-----------------------------------------------------------------------------
COMMAND: big_message (creates a chapter title on the main screen)
ATTRIBUTE: title
VALID: text
ATTRIBUTE: subtitle1
VALID: text
ATTRIBUTE: subtitle2
VALID: text

-----------------------------------------------------------------------------
COMMAND: end_mission (stops the mission)



-----------------------------------------------------------------------------
COMMAND: incoming_comms_text (sends a block of text to the Comms station)
ATTRIBUTE: from
VALID: text
BODY:
VALID: multiple lines of text

-----------------------------------------------------------------------------
COMMAND: log (sends text to the mission's log file)
ATTRIBUTE: text
VALID: text


-----------------------------------------------------------------------------
COMMAND: set_object_property (sets a named space object's named property to a value)
ATTRIBUTE: name
VALID: text
ATTRIBUTE: property
VALID: text (check the big list at the bottom of this file)
ATTRIBUTE: value
VALID: signed floating point value


-----------------------------------------------------------------------------
COMMAND: set_fleet_property (sets a numbered enemy fleet's named property to a value)
ATTRIBUTE: fleetIndex
VALID: 0-99
ATTRIBUTE: property
VALID: text (fleetSpacing, fleetMaxRadius)
ATTRIBUTE: value
VALID: signed floating point value

fleetSpacing is normally 150 - 600
fleetMaxRadius is normally 1000


-----------------------------------------------------------------------------
COMMAND: addto_object_property (adds a value to a named space object's named property)
ATTRIBUTE: name
VALID: text
ATTRIBUTE: property
VALID: text (check the big list at the bottom of this file)
ATTRIBUTE: value
VALID: signed floating point value


-----------------------------------------------------------------------------
COMMAND: copy_object_property (copies a named property from one named space object to another, name1 to name2)
ATTRIBUTE: name1
VALID: text
ATTRIBUTE: name2
VALID: text
ATTRIBUTE: property
VALID: text (check the big list at the bottom of this file)


-----------------------------------------------------------------------------
COMMAND: set_relative_position (moves one named space object (name2) to a point near another (name1), relative to name1's heading)
ATTRIBUTE: name1
VALID: text
ATTRIBUTE: name2
VALID: text
ATTRIBUTE: angle
VALID: 0 to 360
ATTRIBUTE: distance
VALID: 0 100000


-----------------------------------------------------------------------------
COMMAND: set_skybox_index (sets the skybox of the main screen to 0-9)
ATTRIBUTE: index
VALID: 0-9


-----------------------------------------------------------------------------
COMMAND: warning_popup_message (sends a very short message to the screens specified)
ATTRIBUTE: message
VALID: text
ATTRIBUTE: consoles
VALID: text, a collection of the letters MHWESCO, defining which console the message appears on







-----------------------------------------------------------------------------
CONDITION: if_inside_box (tests if named object is inside a rectangle in space)
ATTRIBUTE: name
VALID: text

ATTRIBUTE: leastX
VALID: 0 to 100000
ATTRIBUTE: leastZ
VALID: 0 to 100000
ATTRIBUTE: mostX
VALID: 0 to 100000
ATTRIBUTE: mostZ
VALID: 0 to 100000

-----------------------------------------------------------------------------
CONDITION: if_outside_box (tests if named object is outside a rectangle in space)
ATTRIBUTE: name
VALID: text

ATTRIBUTE: leastX
VALID: 0 to 100000
ATTRIBUTE: leastZ
VALID: 0 to 100000
ATTRIBUTE: mostX
VALID: 0 to 100000
ATTRIBUTE: mostZ
VALID: 0 to 100000


-----------------------------------------------------------------------------
CONDITION: if_inside_sphere (tests if named object is inside a sphere in space)
ATTRIBUTE: name
VALID: text

ATTRIBUTE: centerX
VALID: 0 to 100000
ATTRIBUTE: centerY
VALID: -100000 to 100000
ATTRIBUTE: centerZ
VALID: 0 to 100000
ATTRIBUTE: radius
VALID: 0 to 100000

-----------------------------------------------------------------------------
CONDITION: if_outside_sphere (tests if named object is outside a sphere in space)
ATTRIBUTE: name
VALID: text

ATTRIBUTE: centerX
VALID: 0 to 100000
ATTRIBUTE: centerY
VALID: -100000 to 100000
ATTRIBUTE: centerZ
VALID: 0 to 100000
ATTRIBUTE: radius
VALID: 0 to 100000


-----------------------------------------------------------------------------
CONDITION: if_distance (tests the distance between two named objects against a condition)
ATTRIBUTE: name1
VALID: text

ATTRIBUTE: name2
VALID: text

ATTRIBUTE: pointX
VALID: 0 to 100000
ATTRIBUTE: pointY
VALID: -100000 to 100000
ATTRIBUTE: pointZ
VALID: 0 to 100000

ATTRIBUTE: comparator
VALID: =, !=, <, >, <=, >=, EQUALS, NOT, GREATER, LESS, GREATER_EQUAL, LESS_EQUAL
ATTRIBUTE: value
VALID: signed floating point value


-----------------------------------------------------------------------------
CONDITION: if_variable (tests a named variable against a condition)
ATTRIBUTE: name
VALID: text
ATTRIBUTE: comparator
VALID: =, !=, <, >, <=, >=, EQUALS, NOT, GREATER, LESS, GREATER_EQUAL, LESS_EQUAL
ATTRIBUTE: value
VALID: signed floating point value



-----------------------------------------------------------------------------
CONDITION: if_fleet_count (tests an indexed fleet's membership count against a condition)
ATTRIBUTE: name
VALID: text
ATTRIBUTE: comparator
VALID: =, !=, <, >, <=, >=, EQUALS, NOT, GREATER, LESS, GREATER_EQUAL, LESS_EQUAL
ATTRIBUTE: value
VALID: signed floating point value
ATTRIBUTE: fleetnumber
VALID: 0-99

if you omit the fleetnumber, this command will count every enemy in the game

-----------------------------------------------------------------------------
CONDITION: if_docked (tests if a player is docked with a named station)
ATTRIBUTE: name
VALID: text


-----------------------------------------------------------------------------
CONDITION: if_timer_finished (tests if a timer has counted down to zero yet)
ATTRIBUTE: name
VALID: text


-----------------------------------------------------------------------------
CONDITION: if_exists (tests if named object exists right now)
ATTRIBUTE: name
VALID: text


-----------------------------------------------------------------------------
CONDITION: if_object_property (tests a named space object's named property against a condition)
ATTRIBUTE: name
VALID: text
ATTRIBUTE: name
VALID: property (check the big list at the bottom of this file)
ATTRIBUTE: comparator
VALID: =, !=, <, >, <=, >=, EQUALS, NOT, GREATER, LESS, GREATER_EQUAL, LESS_EQUAL
ATTRIBUTE: value
VALID: signed floating point value



-----------------------------------------------------------------------------
NOTE: Properties you can set, add, or test against:
// values for everything
positionX
positionY
positionZ
angle --this value will be in radians (0-2*PI), NOT degrees like every other angle in the scripting parser

// values for Stations
shieldState
canBuild
missileStoresHoming
missileStoresNuke
missileStoresMine

// values for ShieldedShips
throttle
steering
topSpeed
turnRate
shieldStateFront
shieldMaxStateFront
shieldStateBack
shieldMaxStateBack
shieldsOn
hullDamageFront
hullDamageBack
systemDamageBeam
systemDamageTorpedo
systemDamageTactical
systemDamageTurning
systemDamageImpulse
systemDamageWarp
systemDamageFrontShield
systemDamageBackShield
shieldBandStrength0
shieldBandStrength1
shieldBandStrength2
shieldBandStrength3
shieldBandStrength4

// values for Enemys
targetPointX
targetPointY
targetPointZ
hasSurrendered
eliteAIType
eliteAbilityBits
eliteAbilityState

// values for Neutrals
willAcceptCommsOrders

// values for Players
countHoming
countNuke
countMine
energy

// for use in member variable 'int eliteAbilityBits'
const int ELITE_INVIS_TO_MAIN_SCREEN = 1
const int ELITE_INVIS_TO_SCIENCE = 2
const int ELITE_INVIS_TO_TACTICAL = 4
const int ELITE_CLOAKING = 8
const int ELITE_HET = 16
const int ELITE_WARP = 32
const int ELITE_TELEPORT = 64

take the number of all the abilities you want the elite enemy to have, add them together, and that's the number you should set in eliteAbilityBits.

eliteAIType?
0 = behave just like a normal ship (hunt stations, unless a neutral or player is close)
1 = follow the nearest normal fleet around, attack the player when close
2 = ignore everything except players
[Last edited Jul 19, 2011 16:55:43]
Creator of Artemis
page   first prev 1 2
26 replies
avatar
Eric said Jul 05, 2011 04:37:36
Oh, I noticed fleet_count only works on enemy vessels. Any chance of that working on neutrals and Artemis herself in the future?
avatar
ThomRobertson said Jul 05, 2011 14:15:02
No, instead I'd have you use if_exists and if_not_exists, coming in the next update.
Creator of Artemis
avatar
Eric said Jul 05, 2011 20:31:27
You are the man, Thom!
avatar
Vorus said Jul 06, 2011 04:15:04
Has anyone used set_relative_position yet? I was trying to make it look like the player ship was launching a shuttle, but it doesn't seem to work very well. The newly-created ship is always a good distance away from the player, even after I set the range to 1.

I've already deleted the code, but it was something like:

<set_relative_position name1="shuttle" name2="player" angle="180" range="1"/>

I was expecting the "shuttle" to be facing the opposite way from the player, and basically appear to fly out the shuttle bay, but the "shuttle" is always more like 200 away.
-----------
Khomerex nal Khesterex

The unofficial Artemis Wiki, your best source for Artemis Information
avatar
TreChipman said Jul 06, 2011 05:22:46
Funny you should say that; I'm working on a shuttle script, too; I figured that there's got to be some sort of collision detection system in place, so you probably can't do something at range 1 and get away with it; what I'm trying is this:

<create type ="neutral" hulltype="9" x="0" y="-200" z="0" angle="0" name="Shuttle" fleetnumber="5"/>
<copy_object_property name1="Artemis" name2="Shuttle" property ="angle"/>
<copy_object_property name1="Artemis" name2="Shuttle" property ="x"/>
<copy_object_property name1="Artemis" name2="Shuttle" property ="z"/>

but I haven't had a chance to test it out yet. Ideally, what this will do is create a shuttle at the 0,0 coordinates 200 units below the ship, then automagically move it to the ship's coordinates.
I'm not a mad scientist. I'm an angry one. You'd be wise to fear the latter.

Visit Artemis Command!
avatar
Eric said Jul 06, 2011 05:39:56
I have only used the set_relative_position to drop an anomaly out of a ship. (I called it a Mobile Energy Source in the mission and it's just supposed to be something supplemental that you can drop on the map since this particular mission only has one station in a far corner.) With the anomaly, when I set the range too small, Artemis just auto-gobbled it up instead of saving it for later. I ended up going with a range of 500 to give a comfortable buffer.
avatar
Mike_Substelny said Jul 06, 2011 13:00:07
Eric, try this for your neutral to Kralean transformation:
1) Create the Kralean.
2) Copy_object_property x,z & angle from neutral to Kralean
3) Destroy neutral

This should work for a neutral anyplace on the map. I plan on using it in a script tonight. It might give you an error if the collision detection is triggered before the neutral is destroyed. If that happens, do this:

1) Create the Kralean.
2) Copy_object_property x,z & angle from neutral to Kralean
3) set Kralean y to 1,000
4) Destroy neutral
5) set Kralean y to 0
"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
Vorus said Jul 06, 2011 14:05:25
so you probably can't do something at range 1 and get away with it; what I'm trying is this:

Yeah, I tried that too, didn't seem to help. I'm thinking, like you, that it's a collision detection thing.
-----------
Khomerex nal Khesterex

The unofficial Artemis Wiki, your best source for Artemis Information
avatar
Mike_Substelny said Jul 19, 2011 01:42:32
Thom has announced that Artemis 1.50 will be out tomorrow. I saw the beta version (1.49) over the weekend and it added some GREAT stuff for mission scripters. There is so much that I may run out of exclamation points for the month!

We get the if_not_exists condition!
We can create black holes!
We can override the player's choice of difficulty level!

The engineering station is completely remodeled and more detailed, as is the way the Artemis handles damage. The engineer can redline systems for better performance, but risk damage to Artemis . . . I saw it happen! Old mission scripts that force systems to be damaged in the old, simple system probably won't work the same anymore. But it's so worth it to have the new engineering station!
"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
Eric said Jul 19, 2011 02:34:30
When I use this code, I can make a neutral go really fast.

<create type="neutral" hulltype="6" x="35000" y="0" z="5000" name="Friar Tuck" angle="120"/>
<set_object_property name="Friar Tuck" property="topSpeed" value="7"/>
<direct name="Friar Tuck" pointX="5000" pointY="0" pointZ="35000" scriptThrottle="1"/>

However, when I change the Friar Tuck to an enemy, it won't go fast. Anybody have ideas why?
avatar
Vorus said Jul 19, 2011 02:43:33
I have had similar trouble trying to set some properties on enemies. I'm not sure that feature is completely implemented yet.
-----------
Khomerex nal Khesterex

The unofficial Artemis Wiki, your best source for Artemis Information
Login below to reply: