Members | Sign In
All Forums > Mission Scripting
avatar

Mission Script Ref 1.50

posted Jul 19, 2011 16:47:02 by ThomRobertson
-----------------------------------------------------------------------------
MISSION SCRIPT DOCS FOR ARTEMIS SBS V1.50
7/17/2011
rev 5

-----------------------------------------------------------------------------
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, blackHole
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

If you use a fleet number that's illegal, crashes and wierd graphical glitches will occur.


-----------------------------------------------------------------------------
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


-----------------------------------------------------------------------------
COMMAND: set_difficulty_level (overrides the difficulty level set on the server control screen)
ATTRIBUTE: value
VALID: 1-10







-----------------------------------------------------------------------------
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_not_exists (tests if named object does NOT exist 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
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
Creator of Artemis
page   1 2 next last
24 replies
avatar
edmundrw said Oct 13, 2011 10:18:36
Does every station need the mission files or just the the server computer?
avatar
EricWethington said Oct 17, 2011 16:46:45
just the server
"... ooops!"
Last words of Captain Phour Phazier Phred from Phremont
avatar
Bill said Oct 31, 2011 23:30:06
is it currently possible to integrate new skyboxes into Artemis to be specified in a mission script or will the program only use the ones included with the game?
avatar
Martok42 said Nov 03, 2011 18:37:09
What if the mission had a new ship model or something? Then I assume every client would need that model and vesseldata?
A vital mission, impossible odds and a ruthless enemy, what more could we ask for?

Follow the Star Trek, Into The Breach mod for Artemis: NegativeZone
avatar
ThomRobertson said Nov 07, 2011 17:04:47
What if the mission had a new ship model or something? Then I assume every client would need that model and vesseldata?


Yes, if they want to look out the window at it (on their own consoles). I suppose I could set the INI file to torn off the ability to look outside...

is it currently possible to integrate new skyboxes into Artemis to be specified in a mission script or will the program only use the ones included with the game?


Sure, but the skyboxes are referenced by number, so just replace one of the skybox art sets with your own art.
Creator of Artemis
avatar
Martok42 said Nov 07, 2011 19:14:03
I suppose I could set the INI file to torn off the ability to look outside...


It's certainly not worth the trouble of whatever that would entail. I was just making sure that is how it worked, no sense in unnecessarily putting files on computers.
A vital mission, impossible odds and a ruthless enemy, what more could we ask for?

Follow the Star Trek, Into The Breach mod for Artemis: NegativeZone
avatar
DrTwitch said Dec 07, 2011 01:05:26
This ref document is great - as you are updating it to 1.55 could you be willing to add a couple of additional things to help a novice get oriented and spend a little less time tinkering and experimenting in order to get some intended effects.

The basic idea: "$100? is that a lot?"

Everything else that follows is just some examples that could be of use for editing and helping the novice.

I need a better sense of "scale" and think that others just coming into the game would be able to grasp things faster.
For example,
I have no idea what the distance units would mean in terms of scale or distance.
if you have some guide posts based on the stock game like:

artimus is 100 units long.
a standard asteroid is 50 units
a planet is 500
It will take 200 units of energy to move X units, and take 1 minute at warp 1 (with some other conversions)
Throttle will move X units per second.

What are some reasonable combat ranges:
shorter than artimus' weapons
artimus range
longer range than artimus' weapons

Some examples of what the various values for shielded ships relative to the artimus.

This would help when setting up a script we can basically make a quick decision like: this ship is twice as fast, half as manuverable, etc. as the default player ship
(This could also be added to the vessel.xml as well for things that are not part of the scripting system, if you want to make it a little easier for scripters and modders.)

Please i hope that you take these suggestions in the spirit they are intended, and do appricate all the work already in the game.
---- ---- ----
here come the drums
avatar
ThomRobertson said Dec 07, 2011 01:33:37
I can certainly fill in some of these blanks:

The Artemis is about 100 meters long.
The entire sector is 100,000 meters on a side (100 kilometers)
The beam range of the Artemis is currently 100m.

For info on ships, always look in the vesselData.xml file.
Creator of Artemis
avatar
DwayneShaffer said May 03, 2012 00:22:25
Thom will you be updating the mission script reference here for v1.65
Dwayne Shaffer C.O.
Vidar GSR 3701
C.D.F. 7th Fleet
http://vidar-gsr-3701.webs.com/
avatar
MatthewWhiteacre said May 29, 2012 16:11:01
What does the bit value for eliteAbililtyBits ELITE_HET stand for/do? The others are obvious to me, but this one I can't figure out.

Also, if you set the teleport bit, do you also have to set a range, or is that fixed, and if it is fixed, what is the range?
avatar
CaptainZach said May 29, 2012 16:51:30
As I understand, ELITE_HET is high-energy-turn, elites with this bit can pull a turn that would shear any other ship in half.

As for the teleport bit, you don't set the range, it seems to be anywhere from 10,000 to 20,000 km.
avatar
RaphaelHaas said Jul 20, 2012 13:55:13
Is there a way to load into another custom mission triggered by the mission script?
I have an Idea of trying a bigger scale rpg experience(inspired by pen&paper) and it would be great if the Artemis could travel between several maps/missions.
avatar
Mike_Substelny said Jul 20, 2012 19:43:04
No, you can't have one script load another. But there is no limit to the length of a script, so you can probably just make a really big RPG mission.
"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
Hissatsu said Jul 29, 2012 20:35:01
You can travel between maps. You just need to program a jump from map to map. I actually wanted to make such map to demonstrate that, but i got distracted, and then my group stopped playing Artemis with me :(

Basically what you do is have Artemis teleported from one edge of map to another when you "go from one sector to another". At the same time, you destroy all objects on the map that represent the world they were in, and create new world. You can throw in some sound effect or even some animation into the mix. This will look like Artemis really went from sector to sector.

In your mission file, you make two events for each persistent "world" that:
- Create world (its nameless objects and all basic named objects that are always there, like stations and stuff)
- Destroy world (clears all nameless objects and all named objects that might remain by the time world needs cleaning)

You then make two pairs of variables:
- need_to_destroy_world
- world_id_to_destroy
- need_to_create_world
- world_id_to_create

That way, each create world and destroy world event would trigger when corresponding flag (need_to) is set to 1 and world id matches. So, for each world (sector) those two events look like this

Event CREATE WORLD 08
- if need_to_create_world = 1
- if world_id_to_create = 8
- set need_to_create_world = 0
- set world_id_to_create = 0
- (create world)

Event DESTROY WORLD 08
- if need_to_destroy_world = 1
- if world_id_to_destroy = 8
- set need_to_destroy_world = 0
- set need_to_create_world = 1
- set world_id_to_destroy = 0
- (destroy world)

This way, when you need to move from World X to World Y, you add the following to the event triggering the world change:

- set need_to_destroy_world = 1
- set world_id_to_destroy = X
- set world_id_to_create = Y

This in turn will fire Destroy World X event, which will execute and will then fire Create World Y event.

If at any point you only need to destroy a world without creating one (like, you need a pause between destroying and creating, or somethinge lse) , you could make an event that does:
- if need_to_create_world = 1
- if world_id_to_create = 0
- set need_to_create_world = 0
This would effectively set "need to create flag" back to 0 if no world id was specified, after it was set to 1 by destroy world event

You can also have any sort of animation you can think of. I actually made a "warp" animation by creating a world consisting of a tunnel full of asteroids on the sides, artemis moving forward at high speed (ship maneuver is kept 100% damaged so that player cannot turn), with sound effect playing in the background, which kinda looks like your generic "wormhole hyperspace jump". So, when i change worlds X to Y, i change world X to my hyperspace tunnel, then align Artemis correctly, let it fly down the tunnel, play sound, then change this world to world Y after sound has played.

If you want, i can share my mission code. It does all that - going from world to world, playing warp animation when doing so. Its unfinished but seeing as i probably will never finish it...
[Last edited Jul 29, 2012 20:42:43]
avatar
DwayneShaffer said Aug 04, 2012 05:49:49
Hissatsu

If at all possible I would love to check out this code.
Dwayne Shaffer C.O.
Vidar GSR 3701
C.D.F. 7th Fleet
http://vidar-gsr-3701.webs.com/
Login below to reply: