the two super scripts, which let you do 90% of everything that you want in your game:
1. Attribute Usage:
in the GUI~Editor:
non-scripting (Attribute creation):
'whatever' (object) -> Attributes (Tab) -> Attributes -> Add ->
(Object Name: whatever )
Attribute Name: (whatever)
Attribute Type: (String, Boolean, Integer, Double, Object, List, Dictionary, etc)
Attribute Value: (whatever, but based upon your Attribute Type)
examples:
Object Name: game
Attribute Name: radiation
Attribute Type: int (integer)
Attribute Value: 50
Object Name: player
Attribute Name: life
Attribute Type: int (integer)
Attribute Value: 999
or, in scripting:
Object_name.Attribute_name = Value_or_Expression
examples:
game.radiation = 50
player.life = 999
in the GUI~Editor:
run as script -> add a script or add new script -> variables -> 'set a variable or attribute' -> [EXPRESSION] ~ (see above) or [whatever] ~ set it up
Basic Math Computation Expressions, examples:
Addition:
player.strength = player.strength + 50
player.strength = player.strength + player.sword.bonus_strength
Subtraction:
player.strength = player.strength - 30
player.strength = player.strength - orc.armor.bonus_endurance
Multiplication:
player.strength = player.strength * 3
player.strength = player.strength * player.sword.bonus_strength
Division:
player.strength = player.strength / 2
player.strength = player.strength / orc.armor.bonus_endurance
a complex math expression:
player.damage = player.weapon.damage + player.weapon.damage * player.strength / 100 - orc.armor.defense - orc.armor.defense * orc.endurance / 100
2. the 'if' Script:
in the GUI~Editor:
run as script -> add a script or add new script -> scripts -> 'if' Script -> [EXPRESSION] ~ see below or [whatever] ~ set it up
Object_name.Attribute_name (=, not =, >, <, >=, <=) Value_or_Expression
-------
putting the 'if' Script and 'set a variable or attribute' Script together, example in code:
testable 'full game' code (if I didn't make any typos and not forgotten some code lines~stuff, hehe):
<asl version="550">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="testing game stuff">
<gameid>d83ba5bb-2e3c-4f31-80c9-3e88a2dc082c</gameid>
<version>1.0</version>
<firstpublished>2014</firstpublished>
<author>HegemonKhan</author>
<attr name="radiation_integer" type="int">50</attr>
<attr name="turn_integer" type="int">0</attr>
<statusattributes type="simplestringdictionary">turn_integer = Turn: !;radiation_integer = Radiation: !</statusattributes>
</game>
<object name="room">
<inherit name="editor_room" />
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
<attr name="life_integer" type="int">999</attr>
<statusattributes type="simplestringdictionary">life_integer = Life: !</statusattributes>
</object>
</object>
<turnscript name="global_turnscript">
<enabled />
<script>
player.life_integer = player.life_integer - game.radiation_integer
if (player.life_integer <= 0) {
msg ("You've been explosed to too much radiation, the radiation sickness has killed you.")
msg ("GAME OVER"
finish
}
game.turn_integer = game.turn_integer + 1
</script>
</turnscript>
</asl>