Members | Sign In
All Forums > Mission Scripting
avatar

Mission Points

posted Jun 15, 2011 21:49:38 by Eric
Another idea for scripting that I had would be to assign point values. So in any event you could add a tag like:

<assign_points value="500"/>

and at the end on the mission wrap-up screen you could see the total accumulated points. That would allow complex missions that aren't strictly win or lose, but where you are trying to achieve the maximum point value. The sharper your crew and gameplay, the higher the points you earn on that mission. That would also up the replay value of individual missions.
page   1
9 replies
avatar
Mike_Substelny said Jun 17, 2011 14:04:20
You could do that now, but it would be cumbersome to show the score on the ending screen like that. But the [F7] on the server could show the state of the score variable at any time.

A letter grade system would be easy to do. Suppose you wrote a mission worth 100 points, with the possibility of a few bonus points along the way. Consider this code snippet for the end of the mission:

<event>
<if_variable name="mission end" comparator="EQUAL" value="1"/>
<if_variable name="score" comparator="<" value="59"/>
<big_message title="Your mission grade is F" subtitle1="You clowns should be manning a garbage scow."/>
</event>


<event>
<if_variable name="mission end" comparator="EQUAL" value="1"/>
<if_variable name="score" comparator=">=" value="60"/>
<if_variable name="score" comparator="<" value="70"/>
<big_message title="Your mission grade is D" subtitle1="Unless we find a better crew the human race is doomed."/>
</event>

<event>
<if_variable name="mission end" comparator="EQUAL" value="1"/>
<if_variable name="score" comparator=">=" value="70"/>
<if_variable name="score" comparator="<" value="80"/>
<big_message title="Your mission grade is C" subtitle1="Let's hope the admiral wasn't watching."/>
</event>

<event>
<if_variable name="mission end" comparator="EQUAL" value="1"/>
<if_variable name="score" comparator=">=" value="80"/>
<if_variable name="score" comparator="<" value="90"/>
<big_message title="Your mission grade is B" subtitle1="Well done. You made a good showing against a tough enemy."/>
</event>

<event>
<if_variable name="mission end" comparator="EQUAL" value="1"/>
<if_variable name="score" comparator=">=" value="90"/>
<if_variable name="score" comparator="<=" value="100"/>
<big_message title="Your mission grade is A" subtitle1="Your ship is cited for uncommon valor in combat."/>
</event>

<event>
<if_variable name="mission end" comparator="EQUAL" value="1"/>
<if_variable name="score" comparator=">" value="100"/>
<big_message title="Your mission grade is A+" subtitle1="On Earth they are throwing you a ticker-tape parade." subtitle2="The Federation President will personally pin Medals of Honor on your chests."/>
</event>
"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 Jun 17, 2011 19:01:16
I like the code here, but how would you update the points during the mission? We don't have anything like the following do we?

<set_variable name="points" value="points + 10"/>

What is the [F7] and how does that work? Thanks for the help!
avatar
Mike_Substelny said Jun 18, 2011 03:08:16
Hmm, you are right about adding to variables. For points we would need to use something we could add to, like the X coordinate of a dummy ship or anomaly.

That could work! Create an anomaly with a y coordinate such that the players can't touch it, and add to the X coordinate every time they score points.

[F7] is a debugging tool Thom built for us mission script writers. Press the [F7] on the server computer any time during a scripted mission and you can see the states of variables and timers as well as which actions are triggered when.
"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 Jun 19, 2011 14:54:52
Man, there are so many good ideas floating around the scripting area lately! Just wanted to say that, and that I'm enjoying the collaboration that is going on. :D
-----------
Khomerex nal Khesterex

The unofficial Artemis Wiki, your best source for Artemis Information
avatar
TreChipman said Jun 19, 2011 19:36:50
Unfortunately, there's still no way to add to an X coordinate directly. You could, however, set the object's course to only increment X, figure out how far along that axis the object travels a second, and set a timer to halt it after a period of time; for example, if you know that the object will go 100 X units a second, and you want to add 500 points to a score, you set the object in motion with a timer that stops it in 5 seconds. However, you're still stuck with how to retrieve that X value at the end of the simulation. It's a pretty hobo way to do things, though; it would be way, WAY better to add += and -= operators to the set_object_property (which would also be helpful elsewhere, too-- see the Planet DXS discussion here, for example) but that would require some serious work from Thom.

In the meantime, I'd suggest just using this at the mission end:

<big message title="Mission Failed" subtitle1="You did not achieve all your mission goals." subtitle2="Please try harder next time."/>

That way, you're guaranteed they'll try your mission at least a few more times before they catch on.
[Last edited Jun 19, 2011 19:41:16]
I'm not a mad scientist. I'm an angry one. You'd be wise to fear the latter.

Visit Artemis Command!
avatar
Vorus said Jun 20, 2011 20:57:39
Unfortunately, there's still no way to add to an X coordinate directly.

You should be able to do that with "addto_object_property".

You might even be able to make the anomaly an elite and set it to be invisible to LRS and SCI, just so that a crew doesn't see it and wonder what it is doing off the map.
-----------
Khomerex nal Khesterex

The unofficial Artemis Wiki, your best source for Artemis Information
avatar
TreChipman said Jun 20, 2011 21:07:58
Good catch-- I misunderstood how that command worked.
I'm not a mad scientist. I'm an angry one. You'd be wise to fear the latter.

Visit Artemis Command!
avatar
Vorus said Jun 20, 2011 21:24:43
I just discovered it while trying to get planets to spin. :P
-----------
Khomerex nal Khesterex

The unofficial Artemis Wiki, your best source for Artemis Information
avatar
DrTwitch said Dec 16, 2011 18:47:15
we are still doing hobo math to add variables at this point right?

You should be able to do that with "addto_object_property".

You might even be able to make the anomaly an elite and set it to be invisible to LRS and SCI, just so that a crew doesn't see it and wonder what it is doing off the map.


---- ---- ----
here come the drums
Login below to reply: