Flags and Page Management

Zleight
02 Jul 2014, 02:52
Hullo. After a quick search, I couldn't find any threads on this topic, so I apologize in advance if this has already been asked (or if it's painfully obvious).

I'm creating a small gamebook with Quest. However, the number of pages is growing quickly, and I'm wondering if there's any way to put certain pages (ex: one scene) into its own folder, or if there's a way to minimize the number of pages used in the gamebook. What is the average number of pages for a completed, small gamebook? 50? 100?

My other question concerns flags. Are flags replaced when you set a new one?

Example, I made a flag named 'female' and set it to on. Later, I want to use another flag called 'male', so I made that and set it to on as well. Will this replace the 'female' flag?

HegemonKhan
02 Jul 2014, 04:54
each flag~boolean is independant ~ mutually exclusive, one flag has no code impact upon another flag, though you may have a conceptual conflict,

----------

Attribute (save'able, and thus load'able~can be used anywhere, so long as the Object that it's attached to, still exists of course):

Object_name.Attribute_name = Value_or_Expression

Variable (ONLY usable within its own script, can NOT use it anywhere, as it is not attached to an Object):

Variable_name = Value_or_Expression

A Boolean~flag is a String Attribute (but you set it's Attribute Type to: boolean, if using the GUI~Editor or coding in its tag block) with its Value set as: false_or_true

Object_name.Attribute_name = false
Object_name.Attribute_name = true

about flags (Boolean Attributes):

orc.dead = false (switched off) -> conceptually: orc is alive
orc.dead = true (switched on) -> conceptually: orc is dead
orc.alive = true (switched on) -> conceptually: orc is alive
orc.alive = false (switched off) -> conceptually: orc is dead

orc.male = true (switched on) -> conceptually: orc is a male
orc.male = false (switched off) -> conceptually: orc is a female
orc.female = true (switched on) -> conceptually: orc is a female
orc.female = false (switched off) -> conceptually: orc is a male

orc.male = true (switched on) and orc.female = true (switched on) -> conceptually: orc is both male and female
orc.male = true (switched on) and orc.female = false (switched off) -> conceptually: orc is a male
orc.male = false (switched off) and orc.female = true (switched on) -> conceptually: orc is a female
orc.male = false (switched off) and orc.female = false (switched off) -> conceptually: orc is neither male nor female

orc.dead = true (switched on) and orc.alive = true (switched on) -> conceptually: orc is both dead and alive: no quest error, but it is a conceptual conflict obviously
orc.dead = true (switched on) and orc.alive = false (switched off) -> conceptually: orc is dead
orc.dead = false (switched off) and orc.alive = true (switched on) -> conceptually: orc is a alive
orc.dead = false (switched off) and orc.alive = false (switched off) -> conceptually: orc is neither dead nor alive: no quest error, and only possibly a conceptual conflict (if organic~biological, but not if inorganic~machine)

------

usage of booleans~flags (the 'if'' Script + Flags~Boolean Attirbutes):

<object name="orc">
<inherit name="editor_object" />
<attr name="dead" type="boolean">false</attr>
<attr name="fight" type="script">
if (orc.dead = true) {
msg ("The orc is already dead, silly.")
} else if (orc.dead = false) {
orc.dead = true
msg ("You kill the orc.")
}
</attr>
</object>


--------------

explanation of "algebraic substitution string matching" that is used for a lot of coding (including Boolean~flag usage):

orc.dead = false
orc.dead = true

if (orc.dead = true) {
// if (false = false) {
-> // then do this: script 1
} else if (orc.dead = true) {
// } else if (true = true) {
-> // then do this: script 2
}

y = "x + 5"
y = "x^2 - 8"

if (y = "x +5") {
// if ("x + 5" = "x + 5") {
-> // then do this: script 1
} else if (y = "x^2 - 8") {
// } else if ("x^2 - 8" = "x^2 - 8") {
-> // then do this: script 2

Pertex
02 Jul 2014, 08:30
Zleight wrote:
I'm creating a small gamebook with Quest. However, the number of pages is growing quickly, and I'm wondering if there's any way to put certain pages (ex: one scene) into its own folder,


You can drag & drop pages in the left page tree
page.jpg

Zleight
02 Jul 2014, 18:37
I see. Thank you, both of you! I really appreciate it!

One more question. Is it possible to add a walkthrough for gamebooks? If so, how?

Pertex
02 Jul 2014, 20:53
No, it's not possible

Zleight
03 Jul 2014, 01:57
Alright. Thanks again!