Members | Sign In
All Forums > Mission Scripting
avatar

Mission SCript ref V1.40

posted Apr 15, 2011 22:10:22 by ThomRobertson
-----------------------------------------------------------------------------
MISSION SCRIPT DOCS FOR ARTEMIS SBS V1.36
4/13/2011
rev 2

-----------------------------------------------------------------------------
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 everything you can think of in the game)
ATTRIBUTE: type
VALID: station, player, enemy, neutral, nebulas, asteroids, mines, 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

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 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
ATTRIBUTE: value
VALID: signed floating point value

NOTE: Properties you can set:
// values for everything
positionX
positionY
positionZ

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







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


-----------------------------------------------------------------------------
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
ATTRIBUTE: comparator
VALID: =, !=, <, >, <=, >=, EQUALS, NOT, GREATER, LESS, GREATER_EQUAL, LESS_EQUAL
ATTRIBUTE: value
VALID: signed floating point value

NOTE: Properties you can test against:
// values for everything
positionX
positionY
positionZ

// 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
Creator of Artemis
page   first prev 1 2 3 4 next last
58 replies
avatar
ThomRobertson said Apr 20, 2011 00:45:10
The Y direction is always up or down relative to Artemis. The LRS view shows the X and Z axes. Lower left is x=100,000, z=100,000.

I have the full 3D XYZ values in the script (and in the game) 'cause;

1) that's how 3D graphics are, and
2) I want to preserve the ability to try 3D movement in the future.
Creator of Artemis
avatar
Eric said Apr 20, 2011 01:00:10
Thanks. It actually hurt me to be a math teacher since I assumed the LRS was quadrant one of the coordinate plane with X-Y axes and Z would be the up down relative to Artemis. I don't have a mission done yet, but I think this tool is extremely useful and fun.
avatar
MrSquid said Apr 20, 2011 19:38:04
Three new questions (please don't hit me!):

1. How do you create elite ships? Is it just assigning them an eliteAbilltyType?

2. I just realized that the Artemis is destroyed when it takes a TOTAL of 100 points of hull damage, rather than either the front or back reaching zero. Is there a way to track this total damage?

3. Can we create monsters in our scripts?? :)
avatar
MrSquid said Apr 20, 2011 21:59:14
Nevermind, question 1. I just noticed the Skaraan in the vesselData.xml.
[Last edited Apr 23, 2011 17:13:55]
avatar
ApolloELanding said Apr 23, 2011 16:23:26
Hi Tom,

The conditional per event are not working.

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.

Also the if docked base appears to be faulty.

I will send you my script. Could be my code?

Thanks,
Dave
avatar
MrSquid said Apr 24, 2011 20:23:49
If you haven't already, try updating to v1.41. That seemed to fix the issue for me.

I do have another question though. Is it possible to set missions up for multiple player ships? I tried using <create type ="player"...> with different names, but that causes clients to crash willy nilly (assertion errors), and when I was able to get two ships online, the Artemis players' ship wouldn't respond to any commands, and the main screen wouldn't switch to anything but the forward view. The Intrepid players' ship seemed to work fine except that it was created as a new ship and placed in a location that I didn't specify in either ships <create.../> starting x/z coordinates.

Here's the error in its entirety:
Assertion Failed!
File: .\OBJShieldedShip.cpp
Line: 139

Expression: worldSSP[g].x > -SPACE_SIZE_W
avatar
ApolloELanding said Apr 25, 2011 02:18:30
Yes running v1.41. Seem all my events activate. Instructions indicate the entire condition is evaluated for TRUE.

I am setting variables up and checking them in events. I may need to check two or three variables and if all are TRUE execute the event.
Then after the event I update the variable.

<start>
<create type ="station" x="70042" y="0" z="50042" name="BASE1"/>
<create type ="station" x="20042" y="0" z="53042" name="BASE2"/>
<create type ="station" x="52042" y="0" z="12042" name="BASE3"/>
<create type ="player" x="20000" y="0" z="70000" name="Artemis"/>

<set_timer name="enemy_timer" seconds="20"/>
<set_timer name="game_timer" seconds="60"/>
<set_variable name="attack1" value="0"/>
<set_variable name="surprise" value="0"/>
<set_variable name="que_the_Raider" value="0"/>

</start>



<event>

<!-- if docking with BASE 2 plan a surprise -->
<if_docked station="BASE2"/>
<if_variable name="surprise" comparator="!=" value="1"/>
<!-- add a cloaked Skaraan to hunt the Artemis -->
<create type ="enemy" hulltype="30" x="30000" y="0" z="50000" angle="0" name="SCAR3" fleetnumber="5"/>
<set_object_property name="Skar01" property="eliteAIType" value="1"/>
<set_object_property name="Skar01" property="eliteAbilityBits" value="17"/>

<set_timer name="game_timer" seconds="10"/>

<set_object_property name="Artemis" property="systemDamageFrontShield " value="5" />

<incoming_comms_text from="ENGINEERING">
Front Shield Down. Sabotage........^
</incoming_comms_text>

<set_variable name="surprise" value="1"
/>
avatar
BenjaminAshwell said Apr 25, 2011 19:52:45
Sorry, quick question: what does the HET in ELITE_HET stand for?
avatar
ian.n.boys said Apr 26, 2011 15:20:11
One question: is there a way to modify the Artemis' energy using the mission scripts? For example, if I want to make a nebula that drains the ship's energy?

Thanks!
[Last edited Apr 26, 2011 15:20:28]
avatar
Vorus said Apr 26, 2011 21:03:02
Sorry, quick question: what does the HET in ELITE_HET stand for?

High Energy Turn. Unless it comes from elsewhere, this was a phrase originally used in the old FASA Trek board games, I believe. It was also used in the Starfleet Command series of PC games.

Basically, the ship turns really fast for a short period of time.
-----------
Khomerex nal Khesterex

The unofficial Artemis Wiki, your best source for Artemis Information
avatar
MrSquid said Apr 26, 2011 22:07:09
Yeah, It's from an old game called Star Fleet Battles (Starfleet Command was based on it). I used to play it back in my college days. In between turns, you allocate energy to different systems in your ship, and it could take a long time. One of my friends would sit on the toilet while he did this, and to this day whenever any of us have to use the bathroom we say we're going to do some energy allocation!
[Last edited Apr 26, 2011 22:07:42]
avatar
ThomRobertson said Apr 27, 2011 02:45:22
we're going to do some energy allocation!


LOL!
Creator of Artemis
avatar
ThomRobertson said Apr 27, 2011 02:49:06
One question: is there a way to modify the Artemis' energy using the mission scripts? For example, if I want to make a nebula that drains the ship's energy?

the set_object_property command can set energy to a certain value, so you could make a nebula that cuts power down to a fixed amount, but there's currently no way to ADJUST a value relative to itself. Seems like there should be a command that lets you do that, though. It's on the list.
Creator of Artemis
avatar
ThomRobertson said Apr 27, 2011 02:52:33
Your posted code looks right, apollo. Does it not work? I'll get a chance to paste it and look at it soon, and I'd like to stomp whatever bugs you guys find ASAP.
Creator of Artemis
avatar
TreChipman said Apr 27, 2011 04:32:01
Stupid question time: does this:

<if_object_property name="systemDamage(whatever)" comparator=">" value="90">

check to see if the total damage to system (whatever) is greater than 90%, or the system is more than 90% operational (therefore, its total damage is 10%)? I assume it's the former, but my bridge is packed up right now so I can't really test that theory.
I'm not a mad scientist. I'm an angry one. You'd be wise to fear the latter.

Visit Artemis Command!
Login below to reply: