questions about Gamebook
teresa
22 Jun 2014, 11:01I am using the web version. I'm a beginner and I come to these problems.
How do I use function, attributes, variables, list and dictionary? I have read the tutorial of text adventures: http://quest5.net/wiki/Tutorial_Introdu ... .27s_Begin , but they mostly are related to the text adventure type but not gamebook. So I don't really understand.
Also, what's the difference between counter and variable/attributes?
How do I use function, attributes, variables, list and dictionary? I have read the tutorial of text adventures: http://quest5.net/wiki/Tutorial_Introdu ... .27s_Begin , but they mostly are related to the text adventure type but not gamebook. So I don't really understand.
Also, what's the difference between counter and variable/attributes?

Pertex
22 Jun 2014, 15:12gamebook is the little brother of textadventure, so gamebook supports only a subset of the textadventure functionality. You can choose "script" as page type then you can add script commands (less than in textadventure mode).
counter is a numeric variable in Quest. If you add a counter named "steps" you can use the counter commands to increase or decrease its value. The internal name of the variable is game.steps then so the commands
and
are equivalent
counter is a numeric variable in Quest. If you add a counter named "steps" you can use the counter commands to increase or decrease its value. The internal name of the variable is game.steps then so the commands
IncreaseCounter ("steps")
and
game.steps=game.steps+1
are equivalent
HegemonKhan
22 Jun 2014, 17:58I don't use the 'gamebook' mode~version, so I don't know if this explanation will be of help or not, but here it is:
a 'counter' is a built-in integer addition expression (but the Value is limited to +1), here's what it would look like as an Attribute ('set a variable or attribute' Script in the GUI~Editor):
Object.Attribute = Object.Attribute + 1
examples:
game.turns = game.turns + 1
game.steps = game.steps + 1
player.strength = player.strength + 1
etc etc etc
but, if you just use an attribute ('set a variable or attribute' Script), you can choose any value (and any operator too, and any expression formula~equation too):
Simple Expressions:
Addition: Object.Attribute = Object.Attribute + Value
Subtraction: Object.Attribute = Object.Attribute - Value
Multiplication: Object.Attribute = Object.Attribute * Value
Division: Object.Attribute = Object.Attribute / Value
example: game.turns = game.turns + 5
Complex Expressions, an example:
player.physical_damage_integer = critical_hit_bonus_damage_function (player) * defending_bonus_damage_function (player) * player.weapon.physical_damage_integer + player.weapon.physical_damage_integer * player.strength_integer / 100 - defending_bonus_defense_function (monster) * monster.weapon.physical_damage_integer - monster.weapon.physical_damage_integer * monster.endurance_integer / 100
-------
as for Attributes vs Variables:
Coding in general terms, so technically:
Variables:
-> Quest's 'Variable' term
-> Quest's 'Attribute' term
Quest's terms:
Attribute: Object.Attribute_Name = Expression_or_Value
Variable: Variable_Name = Expression_or_Value
Examples:
Attribute: player.damage_integer = 50
Variable: damage_integer = 50
Attribute: player.y = x + 5
Variable: y = x + 5
'Attribute_Name' and 'Variable_Name' are the same thing: a string, as can be seen above in the example as: 'damage_integer' or 'y'
The only difference between a variable and an attribute is that variables are not 'attached' to an Object, and thus variables can only be used locally (in it's own script location and it's only script location), whereas an Attribute, which is 'attached' to an Object, can be used ('saved~stored' and 'loaded') in any scripting within your game code, so long as the Object exists, of course.
a 'counter' is a built-in integer addition expression (but the Value is limited to +1), here's what it would look like as an Attribute ('set a variable or attribute' Script in the GUI~Editor):
Object.Attribute = Object.Attribute + 1
examples:
game.turns = game.turns + 1
game.steps = game.steps + 1
player.strength = player.strength + 1
etc etc etc
but, if you just use an attribute ('set a variable or attribute' Script), you can choose any value (and any operator too, and any expression formula~equation too):
Simple Expressions:
Addition: Object.Attribute = Object.Attribute + Value
Subtraction: Object.Attribute = Object.Attribute - Value
Multiplication: Object.Attribute = Object.Attribute * Value
Division: Object.Attribute = Object.Attribute / Value
example: game.turns = game.turns + 5
Complex Expressions, an example:
player.physical_damage_integer = critical_hit_bonus_damage_function (player) * defending_bonus_damage_function (player) * player.weapon.physical_damage_integer + player.weapon.physical_damage_integer * player.strength_integer / 100 - defending_bonus_defense_function (monster) * monster.weapon.physical_damage_integer - monster.weapon.physical_damage_integer * monster.endurance_integer / 100
-------
as for Attributes vs Variables:
Coding in general terms, so technically:
Variables:
-> Quest's 'Variable' term
-> Quest's 'Attribute' term
Quest's terms:
Attribute: Object.Attribute_Name = Expression_or_Value
Variable: Variable_Name = Expression_or_Value
Examples:
Attribute: player.damage_integer = 50
Variable: damage_integer = 50
Attribute: player.y = x + 5
Variable: y = x + 5
'Attribute_Name' and 'Variable_Name' are the same thing: a string, as can be seen above in the example as: 'damage_integer' or 'y'
The only difference between a variable and an attribute is that variables are not 'attached' to an Object, and thus variables can only be used locally (in it's own script location and it's only script location), whereas an Attribute, which is 'attached' to an Object, can be used ('saved~stored' and 'loaded') in any scripting within your game code, so long as the Object exists, of course.