Gamebook: set probabilities to something

Tomineitor
I dont know if this question is too stupid, but i want to know if in gamebook mode you can do something like this:

click on a hyperlink and there is a 30% prob. to go to "X" page and a 70% prob. to go to "Y" page.

(* those % are just an example)

Thanks.

TinFoilMkIV
Not as familiar with the gamebook limitations vs the text adventure mode, but I don't see much of a reason that it shouldn't work. There are several ways to create a random chance of something occurring, add that into a scrip that runs when you either move to a certain page, or even within the link itself that is disguised as a normal "to next page" button.

At the same time there's the whole thing about making a text adventure that mimics a game book in what the player can see.


A quick example would be just using the built in RandomInt function.
Something like this
*disclaimer, this is quick and very likely inaccurate coding, don't expect this to actually run if copy/pasted into quest*
//this script causes a random split in the resulting page
random_number = RandomInt(0,100)
if (random_number < 30){
goto page 42
}
else {
goto page 578
}

Tomineitor
Thanks! I will try it next time

HegemonKhan
I don't know about the GameBook that much, but here are the built-in randomization code commands (not sure if they work with~in GameBook):

http://docs.textadventures.co.uk/quest/ ... hance.html (this can be a bit confusing, ask if you need help with it)
http://docs.textadventures.co.uk/quest/ ... eroll.html
http://docs.textadventures.co.uk/quest/ ... omint.html
http://docs.textadventures.co.uk/quest/ ... ouble.html

----------

the source of the above links:

http://docs.textadventures.co.uk/quest/ (quest wiki's main page)

http://docs.textadventures.co.uk/quest/functions/ (categorical order)
http://docs.textadventures.co.uk/quest/ ... tions.html (alphabetical order)
http://docs.textadventures.co.uk/quest/scripts/

-------

for the Text Adventure version (don't know about GameBook):

for using scripting for 'goto' movement (non-Exit usage), two different scripts, which do the same thing:

// the GUI~Editor uses this script method for its drop down box choice:
MoveObject (moving_Object_name, destination_Object_name)
// example: MoveObject (player, room2)

~OR~

moving_Object_name.parent = destination_Object_name
// example: player.parent = room2

This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums