creating~adding a global Turnscript:
click on the upper left most 'Object' in the left side's 'tree of stuff', so that it is highlighted, this ensures that the added~created Turnscript will be global (not locally ~ not limited to within a specific individual room), then (I don't know why 'Turnscript' is not a choice in the left side's 'tree of stuff' as its cousin 'Timer' is, but oh well. Go to the top of the screen, and click on the 'add' in the bar at the top of the screen, and select 'Turnscript'.
Turnscript Name: (whatever you like, I like using this label for its name: global_turnscript)
'enabled' check box: have it check in (this makes it always activated at the beginning of the game, and remains activating every single internal turn, as long as it remains 'enabled', of course)
in~for your (global) Turnscript's Script:
run as script -> add new script -> scripts -> 'if' Script -> [expression] -> player.health <= 0
-> then, -> add a script -> game state (you got to scroll way down) -> 'finish the game' script
in code, it looks like this (added in extra 'print a message' Scripts: the 'msg' Scripts):
<turnscript name="global_turnscript">
<enabled />
<script><![CDATA[
if (player.health <= 0) {
msg ("You have died or were killed.")
msg ("GAME OVER")
finish
}
]]></script>
</turnscript>
the Scripts to add~decrease your health:
run as script -> add a script -> player (you got to scroll way down) -> 'increase~decrease health' Script