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   1 2 3 4 next last
58 replies
avatar
Vorus said Apr 16, 2011 01:41:30
I hope I didn't miss the answer to this, but I have a question:

How do you know which numbers relate to which abilities for the Elite ships? And can you assign these abilities in the VesselData file, or just in mission scripts?
-----------
Khomerex nal Khesterex

The unofficial Artemis Wiki, your best source for Artemis Information
avatar
ThomRobertson said Apr 16, 2011 18:27:56
You did not miss the answer; you're the first to ask.


// 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 pr player is close)
1 = follow the nearest normal fleet around, attack the player when close
2 = ignore everything except players
Creator of Artemis
avatar
Vorus said Apr 16, 2011 21:32:43
Ah, thanks! That's a clever and simple way to do it.

One more question; Is there a way to assign these abilities to enemies (Elite and/or otherwise) in the VesselData file, or are they available in missions only? (I have yet to actually try to create a mission, but I would guess it'd be easy enough to create a mission that included a few elites and nothing else special, so it's no big deal either way.)
-----------
Khomerex nal Khesterex

The unofficial Artemis Wiki, your best source for Artemis Information
avatar
MrSquid said Apr 17, 2011 21:44:02
Hi! A couple of questions:

1. Is the ShieldStateFront/Back property an absolute value as defined in the vesselData.xml or a percentage?

2. Similarly, does this applies to all properties? E.g., does the systemDamageWarp value mean you set it to 100 to knock it completely out? I noticed in The Waning Dark the systemDamageWarp gets set to "10" when you enter one of the nebulae, but as far as I could tell when we played it, it didn't do anything. We were able to warp around just fine as far as we could tell.

3. Is there a way to create an object near the Artemis regardless of it's position? I guess I really mean can variables be used in the values place? I'm going to already assume the answer to that will be 'no' since I've tried it and it didn't work! :)

4. What are the shieldBandStrength(0-4) properties?

Thanks! The mission creator is great!
avatar
ThomRobertson said Apr 17, 2011 22:31:50
does the systemDamageWarp value mean you set it to 100 to knock it completely out?


Yes, but it will still regenerate over time and currently there's nothing you can do about that, except keep resetting it to 100.

in The Waning Dark the systemDamageWarp gets set to "10" when you enter one of the nebulae, but as far as I could tell when we played it, it didn't do anything


IT should damage the warp system (a system is damaged up to 20; any more and it's broken. In the case of warp that means half-speed warp. Are you sure that wasn't happening?

I guess I really mean can variables be used in the values place?


Nope, not now. Later? Maybe.

What are the shieldBandStrength(0-4) properties?


Those are the 5 shield bands for enemy shields, the ones you can effect by having the weapons station set beam Freq to A-E. The proper values are 0.0 to 1.0, 1.0 = strongest against player beams.

Is the ShieldStateFront/Back property an absolute value as defined in the vesselData.xml or a percentage?


An absolute number.



Creator of Artemis
avatar
MrSquid said Apr 17, 2011 23:17:32
Thanks! So here's my issue:

<event>
<if_object_property name="Artemis" property="shieldStateRear" comparator="LESS" value="40"/>

<set_variable name="warpoffline" value="1"/>
<set_object_property name="Artemis" property="systemDamageWarp" value="99"/>
</event>


I'm trying to get it so that when the shields get down to 40, the warp drives get knocked out. When I run with the above code, the warp drives get knocked out as soon as the game starts. I've also tried it with GREATER than 40 to see if I got it backwards, with the same result.
[Last edited Apr 17, 2011 23:19:45]
avatar
ThomRobertson said Apr 17, 2011 23:49:42
You're using shieldStateRear, not shieldStateBack like you should.
Creator of Artemis
avatar
MrSquid said Apr 18, 2011 00:52:30
Hmmrm, okay I tried shieldStateBack. I think I was using the correct one, I had just changed it to Rear the last time I tried something. But in any event, it's still triggering the event as soon as the game starts.
avatar
ThomRobertson said Apr 18, 2011 05:29:03
the ShieldStateFront/Back property is an absolute value. For the Artemis, it starts at 80 (100%) and drops to 0 (0%) if damaged enough. Try using the GREATER comparator.
Creator of Artemis
avatar
MrSquid said Apr 18, 2011 15:05:40
It tried both these lines:
<if_object_property name="Artemis" property="shieldStateBack" comparator="GREATER" value="75"/>

and

<if_object_property name="Artemis" property="shieldStateBack" comparator="LESS" value="75"/>

In both cases, when I started up the game, the warp drives were damaged immediately. Currently, this is the only place in the script where the shieldStateBack and systemDamageWarp properties are referenced, so I don't think anything else is interfering. Maybe the shields need to be raised before this item can be properly evaluated? Or is there something more sinister at work here (other than my own incompetence)?


avatar
ThomRobertson said Apr 18, 2011 17:25:31
I don't know; it could very well be a bug I need to fix. Post your entire script, or email it to me if you'd rather, and I'll test it. Thanks!
Creator of Artemis
avatar
ThomRobertson said Apr 18, 2011 18:48:14
I got your script. thank you!

First, it did show me that there's a big bug in the way the if_object_property command is functioning. I've fixed it, and will release an upgrade soonest (probably tonight).

Second, you create three normal (non-elite enemies) and then:

<set_object_property name="KS1" property="eliteAIType" value="2"/>
<set_object_property name="KS2" property="eliteAIType" value="2"/>
<set_object_property name="KS3" property="eliteAIType" value="2"/>

These commands only apply to elite ship types. However, the way you've got your mission setup, the ships should chase and attack the Artemis even without these lines.

Creator of Artemis
avatar
ThomRobertson said Apr 18, 2011 19:22:51
You also helped me find another bug, making the enemies you created chase ghosts instead of the Artemis. That's now also fixed and will be up soon.
Creator of Artemis
avatar
MrSquid said Apr 18, 2011 19:39:59
I was going to ask you about that too actually, since the ships seemed fire at Artemis but not chase her until she fired upon them. But thanks so much! I'm very excited to be able to help!
avatar
Eric said Apr 19, 2011 22:31:49
This feels like a silly question, but what is the Z direction here since we're not in 3D? I'm imagining the lower left corner of the screen as the point X = 0, Y = -100000. Is that true?
Login below to reply: