Combat in gamebooks
adrao
29 Sept 2014, 06:37Ok, so I can see that there are some threads for the text adventures on combat, but almost nothing on how to do such a thing for gamebooks. Any ideas on how a (easy/complicated) system can be implemented for a gamebook?
The Pixie
29 Sept 2014, 14:52If it was me, I would do it as a text adventure, then modify the interface to look like a game book, by disabling the panes on the right and the command line. That way you have full access to Quests capabilities and to what others have already done.
MrFRZ
30 Sept 2014, 23:12I suggest this too. Gamebooks, I have found, are a lot simpler than the normal text adventure format. This can be a blessing or a curse, depending on what you want. The gamebook doesn't allow any good way for stat tracking, for example. Currently I'm working on a complex zombie survival game, that tracks your choices and stats like inventory, health, your group's approval of your choices, etc. Depending on these values, different dialogue will show, and characters will react different ways. If you were to do this in a gamebook, you would have to write a different page for almost every single action, compared to text adventures where doing this would be much simpler. So if the fight sequence is going to be a simple, punch, kick, tackle, or run, kind of thing, go with gamebooks. Gamebooks would also be the better choice if you don't want all the complications of coding. However if you want to incorporate timers and variables to recall a character's health etc. A text adventure that looks like a gamebook might be the better option.
adrao
01 Oct 2014, 05:04Thanks for the advice, had I thought about it in the beginning I would have done that. However, after I discovered Quest software I (enthusiastically) started producing my first game straight away, and now I am something like 150 pages into it, so I would like to finish it somehow, and then might do as you say for my next game.
But actually I wanted something more complicated, that tracked some sort of statistic like strength, or just gave some damage to the character, like deduce one hit point from him, what do you think is the best way of doing so?
But actually I wanted something more complicated, that tracked some sort of statistic like strength, or just gave some damage to the character, like deduce one hit point from him, what do you think is the best way of doing so?

jaynabonne
01 Oct 2014, 06:47You can set an attribute on the player (e.g. "health") which is then changed via scripts on certain pages.
adrao
01 Oct 2014, 13:44Hi, thanks for that. Somehow I had figured that this was the way to go, though I am having some trouble with attributes (variables?) and counters. Basically, the use of attributes seems better, but they are somehow not being transferred between pages, unless I am doing something wrong? Also, is there any way to ask the program to print these attributes, variables and counters on the screen?
(something like: "You now have %%% hit points left")
(something like: "You now have %%% hit points left")

jaynabonne
01 Oct 2014, 15:22It would help to know what you're doing to know if it's wrong, but I can plod on anyway.
Be sure when you set the attribute that you do something like
That sets an attribute "health" on the "player" object. If you just do "health = 100", then you're creating a local, temporary variable that disappears once that invocation of the script is over.
To print the value, you'd simply do:
"You now have {player.health} hit points left"
Be sure when you set the attribute that you do something like
player.health = 100
That sets an attribute "health" on the "player" object. If you just do "health = 100", then you're creating a local, temporary variable that disappears once that invocation of the script is over.
To print the value, you'd simply do:
"You now have {player.health} hit points left"
HegemonKhan
01 Oct 2014, 15:50to expound on Jay's post:
In~For Quest:
VARIABLES:
Variable: Variable = Value_or_Expression
Attribute: Object.Attribute = value_or_Expression
the bolded ' Variable ' and ' Attribute ' are the same thing, they're just a string name~label, such as in math with the y: y = x + 1
an example of it~this below:
Examples:
Variable: strength = 100
Attribute: player.strength = 100
the only difference between an Attribute and a Variable, is whether it is attached to an Object (global, as it's 'saved' to an Object, and so long as that Object exists, it can then be 'loaded' within any script anywhere in the game), or not attached to an Object (local, you can only use it within the same script that you set it within).
though, with the GameBook quest version, you only got two Objects for use for creating~setting Attributes (global usage):
'game' and 'player'
game.strength = 100
player.strength = 100
----------
if you don't know how to script the basic math computation code expressions in quest:
in the GUI~Editor:
run as script -> add a script -> variables -> set a variable or attribute -> (set it up: Object.Attribute = Value_or_Expression, or: Variable = Value_or_Expression)
in code: Variable = Value_or_Expression, or: Object.Attribute = Value_or_Expression
Addition:
Object.Attribute = Object.Attribute + Value_or_Expression
Subtraction:
Object.Attribute = Object.Attribute - Value_or_Expression
Multiplication:
Object.Attribute = Object.Attribute * Value_or_Expression
Division:
Object.Attribute = Object.Attribute / Value_or_Expression
---------------
quick conception of them, using addition as an example:
initial~old: player.strength = 0
player.strength = player.strength + 1
player.strength (new) = player.strength (old) + 1
player.strength (new) = player.strength (0) + 1
player.strength (new) = 0 + 1
player.strength (new) = 1
new: player.strength = 1
old: player.strength = 1
player.strength (new) = player.strength (1) + 1
player.strength (new) = 1 + 1
player.strength (new) = 2
new: player.strength = 2
old: player.strength = 2
etc etc etc
etc etc etc
-------------------
Jay's using the in-text command, but if you want to use a message script:
GUI~Editor:
run as script -> add a script -> output -> Print a message -> [EXPRESSION] -> see below
in code (VARIABLE only for this example below):
msg (Object.Attribute)
----
so, for example:
player.strength = 100
msg ("Strength: " + Object.Attribute)
msg ("Strength: " + player.strength)
outputs~returns~displays~shows: Strength: 100
though, if you're new to programming, understanding how to do text+VARIABLES isn't easy, I've got another post explaining how to do this, let me know if you need help with this, and I'll find and copy the content here from that other post of mine that has it.
In~For Quest:
VARIABLES:
Variable: Variable = Value_or_Expression
Attribute: Object.Attribute = value_or_Expression
the bolded ' Variable ' and ' Attribute ' are the same thing, they're just a string name~label, such as in math with the y: y = x + 1
an example of it~this below:
Examples:
Variable: strength = 100
Attribute: player.strength = 100
the only difference between an Attribute and a Variable, is whether it is attached to an Object (global, as it's 'saved' to an Object, and so long as that Object exists, it can then be 'loaded' within any script anywhere in the game), or not attached to an Object (local, you can only use it within the same script that you set it within).
though, with the GameBook quest version, you only got two Objects for use for creating~setting Attributes (global usage):
'game' and 'player'
game.strength = 100
player.strength = 100
----------
if you don't know how to script the basic math computation code expressions in quest:
in the GUI~Editor:
run as script -> add a script -> variables -> set a variable or attribute -> (set it up: Object.Attribute = Value_or_Expression, or: Variable = Value_or_Expression)
in code: Variable = Value_or_Expression, or: Object.Attribute = Value_or_Expression
Addition:
Object.Attribute = Object.Attribute + Value_or_Expression
Subtraction:
Object.Attribute = Object.Attribute - Value_or_Expression
Multiplication:
Object.Attribute = Object.Attribute * Value_or_Expression
Division:
Object.Attribute = Object.Attribute / Value_or_Expression
---------------
quick conception of them, using addition as an example:
initial~old: player.strength = 0
player.strength = player.strength + 1
player.strength (new) = player.strength (old) + 1
player.strength (new) = player.strength (0) + 1
player.strength (new) = 0 + 1
player.strength (new) = 1
new: player.strength = 1
old: player.strength = 1
player.strength (new) = player.strength (1) + 1
player.strength (new) = 1 + 1
player.strength (new) = 2
new: player.strength = 2
old: player.strength = 2
etc etc etc
etc etc etc
-------------------
Jay's using the in-text command, but if you want to use a message script:
GUI~Editor:
run as script -> add a script -> output -> Print a message -> [EXPRESSION] -> see below
in code (VARIABLE only for this example below):
msg (Object.Attribute)
----
so, for example:
player.strength = 100
msg ("Strength: " + Object.Attribute)
msg ("Strength: " + player.strength)
outputs~returns~displays~shows: Strength: 100
though, if you're new to programming, understanding how to do text+VARIABLES isn't easy, I've got another post explaining how to do this, let me know if you need help with this, and I'll find and copy the content here from that other post of mine that has it.
Silver
01 Oct 2014, 16:23I haven't really thought about combat too much but an interesting idea I've just had regarding masking a text adventure as a game book is you could set flags for injuries and even put them on a timer for when they heal. So if you bruised a knuckle in a fight and then went into another fight quickly afterwards you could make it have some kind of impact.
No idea if it'd work btw, just thinking out loud.
I imagine it could become a lot of work though monitoring a lot of flags through many scenes. It could be limited to something a bit more rare to add flavour.
No idea if it'd work btw, just thinking out loud.

HegemonKhan
01 Oct 2014, 16:38you can make a counter too (it subtracts down upon each new page), or just on the future page (as with a GameBook, you know the sequence+connnections of your pages), set yourself to have been healed.
------
booleans become unweildry very fast, a better method is to use lists and~or dictionaries, as this allows you to group common things together (though using lists and~or dictionaries is a bit more complex that people new to programming will have trouble with learning how to use them), for example:
Status Effects (common in RPGs):
player.dead=false
player.unconscious=false
player.asleep=false
player.poisoned=false
player.confused=false
player.paralyzed=false
player.petrified=false
player.silent=false
player.blinded=false
player.crippled=false
player.cursed=false
player.stunned=false
etc etc etc
very unweildy...
whereas we can group all of these together using a list instead:
player.status_effect_stringlist = NewStringList ()
then as we get or remove the status effects:
list add (player.status_effect_stringlist, "poisoned")
list add (player.status_effect_stringlist, "confused")
we then 'if' check what's in the list, doing if's 'then' actions if that thing is in the list:
Player's 'battle_turn_function' Function (within a 'fight' Verb), for an example:
if (ListContains (player.status_effect_stringlist, "poisoned") = true) {
player.hp = player.hp - 50
} else if (ListContains (player.status_effect_stringlist, "confused") = true) {
// player randomly attacks a target: enemy or self or ally
}
list remove (player.status_effect_stringlist, "poisoned")
etc etc etc
much better than unwieldy booleans... hehe
---------
another example: locomotion
player.walking=true
player.running=false
player.flying=false
player.swimming=false
player.jumping=false
player.falling=false
player.floating=false
player.gliding=false
player.crawling=false
player.climbing=false
player.sitting=false
player.standing=false
player.lying_down=false
player.bipedal=true
player.quadripedal=false
etc etc etc
or, 'activities', too:
reading, studying, training, sleeping, resting, casting, defending, talking, playing, working, partying, eating, drinking, etc etc etc
or, 'stealth', too:
sneaking,stealing,lockpicking,planting,etc etc
or, 'diplomacy', too:
talking, intimidating~threatening, bartering, insulting, complimenting, flirting, seducing, bribing, etc etc etc
and etc etc etc such groupings
------
booleans become unweildry very fast, a better method is to use lists and~or dictionaries, as this allows you to group common things together (though using lists and~or dictionaries is a bit more complex that people new to programming will have trouble with learning how to use them), for example:
Status Effects (common in RPGs):
player.dead=false
player.unconscious=false
player.asleep=false
player.poisoned=false
player.confused=false
player.paralyzed=false
player.petrified=false
player.silent=false
player.blinded=false
player.crippled=false
player.cursed=false
player.stunned=false
etc etc etc
very unweildy...
whereas we can group all of these together using a list instead:
player.status_effect_stringlist = NewStringList ()
then as we get or remove the status effects:
list add (player.status_effect_stringlist, "poisoned")
list add (player.status_effect_stringlist, "confused")
we then 'if' check what's in the list, doing if's 'then' actions if that thing is in the list:
Player's 'battle_turn_function' Function (within a 'fight' Verb), for an example:
if (ListContains (player.status_effect_stringlist, "poisoned") = true) {
player.hp = player.hp - 50
} else if (ListContains (player.status_effect_stringlist, "confused") = true) {
// player randomly attacks a target: enemy or self or ally
}
list remove (player.status_effect_stringlist, "poisoned")
etc etc etc
much better than unwieldy booleans... hehe

---------
another example: locomotion
player.walking=true
player.running=false
player.flying=false
player.swimming=false
player.jumping=false
player.falling=false
player.floating=false
player.gliding=false
player.crawling=false
player.climbing=false
player.sitting=false
player.standing=false
player.lying_down=false
player.bipedal=true
player.quadripedal=false
etc etc etc
or, 'activities', too:
reading, studying, training, sleeping, resting, casting, defending, talking, playing, working, partying, eating, drinking, etc etc etc
or, 'stealth', too:
sneaking,stealing,lockpicking,planting,etc etc
or, 'diplomacy', too:
talking, intimidating~threatening, bartering, insulting, complimenting, flirting, seducing, bribing, etc etc etc
and etc etc etc such groupings
Silver
01 Oct 2014, 17:01What about dice? That's what Livingstone/Jackson relied on in their books. I guess the player could roll their own and input the score (and cheat like we all did back in the day
) or there could be an in game one.

HegemonKhan
01 Oct 2014, 17:24if you're refering to how to get~determine damage in combat:
here's some links:
http://docs.textadventures.co.uk/quest/functions/
yes, quest has the D&D dice function for you:
http://docs.textadventures.co.uk/quest/ ... eroll.html
and there's also a random function too:
http://docs.textadventures.co.uk/quest/ ... omint.html
http://docs.textadventures.co.uk/quest/ ... ouble.html
and there's a percentage function too:
http://docs.textadventures.co.uk/quest/ ... hance.html
and, you can simply write in your own expression too:
orc.hp = (orc.hp) - (critical_hit_function (player) * player.weapon_damage) - (player.weapon_damage * (player.strength / 100)) + (orc.armor_class) + (orc.armor_class * (orc.endurance / 100))
<function name="critical_hit_function" parameters="object_x" type="int">
if (RandomChance (object_x.luck) = true) {
value=2
} else {
value=1
}
return (value)
</function>
hehe
----------------
A.I.~enemy basic programming:
an 'orc' Object's 'enemy_battle_turn_function' within the 'orc' Object's 'fight' Verb:
value_x = GetRandomInt (1,4)
switch (value_x) {
case (1) {
// physical~weapon~normal attack scripting
}
case (2) {
// magic scripting
}
case (3) {
// stealing scripting
}
case (4) {
// escape scripting
}
here's some links:
http://docs.textadventures.co.uk/quest/functions/
yes, quest has the D&D dice function for you:
http://docs.textadventures.co.uk/quest/ ... eroll.html
and there's also a random function too:
http://docs.textadventures.co.uk/quest/ ... omint.html
http://docs.textadventures.co.uk/quest/ ... ouble.html
and there's a percentage function too:
http://docs.textadventures.co.uk/quest/ ... hance.html
and, you can simply write in your own expression too:
orc.hp = (orc.hp) - (critical_hit_function (player) * player.weapon_damage) - (player.weapon_damage * (player.strength / 100)) + (orc.armor_class) + (orc.armor_class * (orc.endurance / 100))
<function name="critical_hit_function" parameters="object_x" type="int">
if (RandomChance (object_x.luck) = true) {
value=2
} else {
value=1
}
return (value)
</function>
hehe

----------------
A.I.~enemy basic programming:
an 'orc' Object's 'enemy_battle_turn_function' within the 'orc' Object's 'fight' Verb:
value_x = GetRandomInt (1,4)
switch (value_x) {
case (1) {
// physical~weapon~normal attack scripting
}
case (2) {
// magic scripting
}
case (3) {
// stealing scripting
}
case (4) {
// escape scripting
}
Silver
01 Oct 2014, 17:57Code confuses my mind. I wish it didn't.
It's a bit like Motorsport. The driver can be the best in the world and suggest tyres and fuel levels without worrying about when he'll be called into the pits and what the crew will do.
The crew can refuel, change wheels/tyres without worrying about the decisions made on an engineering level.
The engineers can design cars to any specification. They don't need to worry about cost as the financiers will decide what design fits budgets and sales forecasts.
It's hard to be someone who fills every role.
It's a bit like Motorsport. The driver can be the best in the world and suggest tyres and fuel levels without worrying about when he'll be called into the pits and what the crew will do.
The crew can refuel, change wheels/tyres without worrying about the decisions made on an engineering level.
The engineers can design cars to any specification. They don't need to worry about cost as the financiers will decide what design fits budgets and sales forecasts.
It's hard to be someone who fills every role.

jaynabonne
01 Oct 2014, 18:21The cool thing about software is that, while you don't have to know how the "tyres" are made to use them, it's also a heck of lot easier for just about anyone to make their own if they want to! 
"We are the music makers, and we are the dreamers of dreams."

"We are the music makers, and we are the dreamers of dreams."
HegemonKhan
01 Oct 2014, 18:46silver wrote:It's hard to be someone who fills every role.
Game Creation:
1. programming (implementing all of the below)
2. Game Design (create the game world itself and everything that your game is~will be)
3. Authorship (writing: story, plot, dialogue, etc)
4. Media (pictures, sounds, vids, etc)
5. Game Mechanics (all your equations~formulas for your game stats~attributes)
6. Game Balance (having all your game mechanics and etc working together, so there's no OP-ness or impossible difficulty or too easy difficulty, etc...)
7. Game Play (easy to use UI or controls, and etc)
8. probably some more aspects too...
there's a good reason Game Making companies now have a team of 100 (and it still takes them years to make a game), whereas in the early days of game making... it was solo... only a single person made the entire game!
those early game making guys must have been amazing... having the ability to do all aspects involved in game making, lol.
I don't think there's anything more complex than game making... except maybe crafting an entire government... though game making can also involve this and more... lol...

jaynabonne
01 Oct 2014, 18:49Those days are back again now, thankfully, with the current Indie game movement. Perhaps it's a backlash against the "game studio as movie studio" model, but we're back to seeing small teams (some even solo) creating games and getting them out there and actually making money. Which I think is cool, because I'd love to work on games...
HegemonKhan
01 Oct 2014, 18:55and there's great sites like this one, and its free (YES!), allowing us to learn to program, and make games, and even sell them commercially, hehe 
(though... I'm VERY VERY VERY VERY far off from making money off of great games of mine... laughs... argh... HK cries... lol)
(real life has made it difficult to work on trying to learn more programming, and as probably seen in my posts, I'm forgetting how to do a lot of stuff in quest now too... grr)

(though... I'm VERY VERY VERY VERY far off from making money off of great games of mine... laughs... argh... HK cries... lol)
(real life has made it difficult to work on trying to learn more programming, and as probably seen in my posts, I'm forgetting how to do a lot of stuff in quest now too... grr)
adrao
02 Oct 2014, 05:09guys, thanks a lot for the answers received, its cleared a lot of the confusion in my mind, I have written extensive programs in FORTRAN (yes, prehistoric, I know, but somehow I had no choice at the time as everything in my discipline still runs on it...) but the points you make help a lot! Ok, will try to do something using your suggestions!
Darkweaver
02 Oct 2014, 05:25HegemonKhan wrote:"silver"
It's hard to be someone who fills every role.
Game Creation:
1. programming (implementing all of the below)
2. Game Design (create the game world itself and everything that your game is~will be)
3. Authorship (writing: story, plot, dialogue, etc)
4. Media (pictures, sounds, vids, etc)
5. Game Mechanics (all your equations~formulas for your game stats~attributes)
6. Game Balance (having all your game mechanics and etc working together, so there's no OP-ness or impossible difficulty or too easy difficulty, etc...)
7. Game Play (easy to use UI or controls, and etc)
8. probably some more aspects too...
there's a good reason Game Making companies now have a team of 100 (and it still takes them years to make a game), whereas in the early days of game making... it was solo... only a single person made the entire game!
those early game making guys must have been amazing... having the ability to do all aspects involved in game making, lol.
I don't think there's anything more complex than game making... except maybe crafting an entire government... though game making can also involve this and more... lol...
This is so, so true.
adrao
02 Oct 2014, 13:22Just tried it, works beautifully actually, still shocked by how much its possible to do in Quest without writing a line of code (Ok, its not going to be the most amazing combat system in the world this way, but still exactly what I wanted!). Thanks guys for the help!