How to end game based on points

annehyphenmarie
I'm trying to make it so if you have a certain number of points the game ends(IE if you have 25 points the game ends and you win).
So I have a turn script that is an if/else. On the if, it has "if "object counter" "expression" "_____" "counter name" "points" ">=" "number" "500"", and the "else" is blank because the game will just continue of the expression is not true.
What do I put in the blank section after "expression"?
Thanks!!! :D

The Pixie
Add a script command Game state - Finish the game (I would put a message in there too).

HegemonKhan
in code, it'd look like this:

<asl version="550">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name"XXX">
// blah code lines
<attr name="score_integer" type="int">0</attr>
</game>
<turnscript name="winning_the_game_checking_turnscript">
<enabled />
<script><![CDATA[
if (game.score_integer >= 25) {
msg ("You've reached the 25+ score requirement, you've won the game, congratulations!")
finish
} else {
// optional script(s), you really don't need~want an 'else' here, in general anyways
//
// but, here's an example 'else' script that you could use:
//
// points_needed_variable = 25 - game.score_integer
// msg ("You still need " + points_needed_variable + " points to win the game.")
}
]]></script>
</turnscript>
</asl>

This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums