code is quick and easy to post, but obviously not of much help to all those who don't know how to code~program and~or quest's code. It's usually me who posts code, and in the past I've posted GUI~Editor help, but it takes much longer to do so for me, time which I don't have anymore now that I'm working.
So, just ignore my code posts if you don't understand them, and wait for Jay or the others to help you via the GUI~Editor.
the two super scripts, which especially when used together, let's you do 90% of everything that you want to do within your game, are:
1. the 'set a variable or attribute' Script:
in the GUI~Editor: run as script (Gamebook version: set your 'pageX' as a 'script' or 'script+text' ) -> add a script -> variables -> 'set a variable or attribute' Script -> [EXPRESSION] -> Object_name.Attribute_name = Value_or_Expression
// instead of choosing [EXPRESSION] where you have to write~type in the code syntax, you can choose the other more non-code friendly options (I've not really worked with the GUI~Editor, so I just prefer using [EXPRESSION] as I can jsut type~write in the code that I want, instead of trying to figure out what options do what I want it to do, lol.
examples the general syntax (Object_name.Attribute_name = Value_or_Expression) above:
Gamebook version only has two Objects for you to use: 'game' and 'player'
for my own naming~labeling convention~system, I like to '_AttributeType' at the end of my Attribute's NAME (and underscores for spaces), examples:
player.strength_integer = 100
player.strength_string = "strong"
orc.dead_boolean = false
player.head_object = helmet
player.favorite_color_stringlist = split ("black;red", ";")
String Type Attributes:
player.alias = "HK"
player.age = "adult"
player.gender2 = "male"
// 'gender2' is used here by me as there's already the default 'gender' (and 'article' too) String Attribute(s) for using the 'he~she~it~him~her" (I never remember what 'gender' and 'article' match up to: 'he~she~it' and 'him~her', lol), if I used 'gender', it would OVER-RIDE the default 'gender', removing this~its functionality of 'his~her~he~she~it' from the game.
Integer Type Attributes:
player.strength = 100
game.strength = 100
orc.strength = 50
// example of a complex '=Expression' (vs instead of a simple '=Value' above), below:
player.damage = player.weapon_damage + player.weapon_damage * player.strength / 100 - orc.armor_class - orc.armor_class * orc.endurance / 100
Double Type Attributes:
player.damage = 46.065
Boolean (or Flag) Attributes:
orc.dead = false
player.flying = true
etc etc etc (the other Attribute Types are more complicated to work with, so leaving them out for this)
2. the 'if' Script:
in the GUI~Editor:
run as script (Gamebook version: set your 'pageX' as a 'script' or 'script+text' ) -> add a script -> scripts -> 'if' Script -> [EXPRESSION] -> (Object_name.Attribute_name = Value_or_Expression) ->
-> then -> add a script -> variables -> 'set a variable or attribute' Script -> [EXPRESSION] -> (Object_name.Attribute_name = Value_or_Expression) ->
else if -> [EXPRESSION] -> ((Object_name.Attribute_name = Value_or_Expression) ->
-> then -> add a script -> variables -> 'set a variable or attribute' Script -> [EXPRESSION] -> (Object_name.Attribute_name = Value_or_Expression) ->
else ->
-> add a script -> variables -> 'set a variable or attribute' Script -> [EXPRESSION] -> (Object_name.Attribute_name = Value_or_Expression) ->
----------
so, when used together, you can do pretty much anything, an example (in code):
Character Creation:
Text Adventure version
Full Game (well, it's not really much of a game though, laughs) Code
<asl version="550">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="blah">
<gameid>an_algorithm_generated_unique_string</gameid>
<version>1.0</version>
<firstpublished>2014</firstpublished>
<start type="script">
msg ("What is your name?")
get input {
player.alias = result
show menu ("What is your gender?", split ("male;female", ";"), false) {
player.gender_string = result
show menu ("What is your race?", split ("human;dwarf;elf", ";"), false) {
player.race_string = result
msg ("")
msg (player.alias + " is a " + player.gender_string + " " + player.race_string + ".")
if (player.race_string = "human") {
player.strength_integer = 1
player.intelligence_integer = 1
if (player.gender_string = "male") {
player.strength_integer = player.strength_integer + 1
} else if (player.gender_string = "female") {
player.intelligence_integer = player.intelligence_integer + 1
}
} else if (player.race_string = "dwarf") {
player.strength_integer = 2
if (player.gender_string = "male") {
player.strength_integer = player.strength_integer + 1
} else if (player.gender_string = "female") {
player.intelligence_integer = player.intelligence_integer + 1
}
} else if (player.race_string = "elf") {
player.intelligence_integer = 2
if (player.gender_string = "male") {
player.strength_integer = player.strength_integer + 1
} else if (player.gender_string = "female") {
player.intelligence_integer = player.intelligence_integer + 1
}
}
}
}
}
</start>
</game>
<object name="room">
<inherit name="editor_room" />
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
</object>
</object>
</asl>