Saving Page Location

nyarlaBROtep
Hey there, having some trouble with making a Gamebook game novel.
I will do my best to explain the situation, but feel free to ask for clarification.

During the story the player has a few different times they can go to PAGE Y. They can go to PAGE Y from PAGE X, PAGE B, or even PAGE K. My problem is, hos to I get the player to go back to the PAGE they were originally on? I have been trying to mess around with it for about an hour and most options I have to set what page they return to, but there can be several pages and I need them to go back to the right page.

Any advice will be greatly appreciated! Thanks for taking the time to read!

HegemonKhan
I'm not sure how to do this with GameBooks, but for a Text Adventure:

( GameBooks: 'PageX' Page Object -> 'whatever' Tab -> 'Page Type' option: [script] or [text+script] -> 'set a variable or attribute' Script )

in general, you need to store/save that thing/value/room/page/whatever to a variable/attribute, so you can then refer to it for later usage, this means using the 'set a variable or attribute' Script in the GUI~Editor.

set variable Object's_name.Attribute's_name = [expression] Value_or_Expression

is the same as this in code:

Object's_name.Attribute's_name = Value_or_Expression

-------

an example (in pseudo-code, sorry lazy):

used for getting current (Page): player.parent
used for setting current (Page): player.parent = Page's_name

Player is in/on Page1: player.parent = Page1

game.old_page = player.parent // storing/saving "Page1" Page (Object) to 'game.old_page' Object Attribute

Player moves to Page2 and onward to Page99: player.parent = Page99 // (we do NOT store/save these new Page locations to 'game.old_page' Object Attribute)

Player wants to move back to Page1, which is done via: player.parent = game.old_page // as the 'game.old_page' Object Attribute still stores/saves "Page1", thus we're "loading, or restoring/returning to, Page1"

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

Support

Forums