Members | Sign In
All Forums > Development
avatar

Suggestions for Mission Scripting in 2.0

posted May 07, 2013 19:18:31 by XHawk87
According to the brief overview on the Artemis 2.0 to do list, there will likely be updates to Mission Scripting.

One thing I didn't understand in it was this line:
procedural "scenarios" using NPC ships and stations

It sounds like its about mission scripting although that could be just wishful thinking. Clarification on this would be appreciated!

If we're continuing with Artemis Markup Language to define the missions, it could really do with some more logic, data structures and expressions to simplify the process of creating missions with it.

I would suggest something along the lines of:

An "or" condition, allowing checking if one of several conditions is correct then fire the event. It could work something along the lines of:

<or>
    <if_variable .../>
    <if_inside_box .../>
</or>


Currently the only way to handle an or condition is to have an extra event for each condition that update a variable that is the trigger for the actual event. A repeatable event would also need another resetter event for the variable. That's a lot of extra code and twisty thinking needed.

A greater range of variable data types and structures:

XML does have its own format for defining data, so why not use it?

<variables>
    <chapter>1</chapter>
    <title>The New Mission</title>
    <wormhole>
        <entrance x="25000" y="0" z="50000" />
        <exit x="75000" y="0" z="50000" />
    </wormhole>
    <ship id="S01"/>
    <ship id="S04"/>
    <ship id="S05"/>
    <ship id="S07"/>
</variables>


You could then obtain the values for different variables using the DOM path, e.g.

variables.wormhole.entrance.x would contain the value "25000"
variables.title would contain the value "The New Mission"
variables.ship[2].id would contain the value "S05"


And you could define new variables dynamically or alter them using a DOM path. All of this is supported by standard DOM XML parsers.

Allow all data values to be parsed for variables:

This would allow using variables of different types in all kinds of ways. E.g.

<set_ship_text name="A01" scan_desc="Cargo: %cargo ore" />


Would update the amount of ore displayed as being carried by the ship named A01 on second sci-scan from the "cargo" variable. Something completely impossible under the current system.

Loops:

Greatly reduce the amount of code needed to perform the same action on different objects or with slightly different effects.

E.g.
<!-- Initialize the loop counter -->
<set_variable name="i" value="0"/>
<loop>
    <!-- Defines the loop condition, while this is true it'll keep looping -->
    <if_variable name="i" comparator="<" value="4" />

    <!-- The loop actions -->
    <set_variable name="this" value="%variables.ship[%i].id" />
    <clear_ai name="%this" />
    <add_ai type="TRY_TO_BECOME_LEADER" name="%this" />
    <add_ai type="CHASE_PLAYER" name="%this" />
    <add_ai type="CHASE_NEUTRAL" name="%this" />
    <add_ai type="CHASE_ANGER" name="%this" />
    <add_ai type="FOLLOW_LEADER" name="%this" />
    <add_ai type="LEADER_LEADS" name="%this" />

    <!-- Increment the counter -->
    <set_variable name="i" value="%i + 1" />
</loop>


This would loop over the array of ship variables defined above and set up a new AI brain stack. Much shorter, cleaner, less code duplication, easier to read, write and maintain.

Just some ideas I had to make the mission scripting more versatile and much much easier to use.
[Last edited May 07, 2013 19:21:35]
page   1
6 replies
avatar
matt.schillinger said Jun 03, 2013 19:31:39
I TOTALLY second this!
avatar
Mike_Substelny said Jun 04, 2013 01:23:46
procedural "scenarios" using NPC ships and stations


I believe that procedural refers to invasion mode, but I could be wrong.
"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
matt.schillinger said Jun 04, 2013 13:25:53
Being able to copy object properties into variables would be a huge bonus. Currently, I'm trying to detonate an enemy ship. If i could place a mine 'relative' to the coords of an object, that would have the desired effect. If I could copy the ship coords to variables, and use said variables to place the mine, that would be even cooler.

I realize that 2.0 is supposed to add a detonate/self destruct enemy ship option, but with the above mentioned addition, enemies could also 'beam' mines near a ship.

THAT, would be deadly...
avatar
matt.schillinger said Jun 06, 2013 18:44:15
Had another idea.

If we could get an additional condition 'if_scanned', that would be quite interesting.

Basically, it is a conditional that can initiate an action if an object is scanned.

Example use could be: enemy ship detects scan and attacks. Friendly ship detects scan and sends communication.

In mission scripting, the former seems useful to me, as when you are working in a sandbox style of play, having a science officer scan a ship indicates a level of interest, and therefore, having followup actions based on that initial interest will make the script feel as if it is working based on player action.

Thanks again for an awesome game!
avatar
badgeguy said Jun 06, 2013 20:06:18
Matt (and anyone else interested in object location set to variable capabilities),

Check out this thread in the Mission Scripting forum. It is currently based on the object Artemis, but I can think of a few ways to make it work for a variety of objects.

Rusty
avatar
matt.schillinger said Jun 06, 2013 21:26:01
Checked! You are awesome!
Login below to reply: