alright, thanks for that information, as it shows me how the built-in page linking works.
it indeed uses a List Attribute, which is what you're using, adding (more and more) choices to that List Attribute (which you have set to be labeled as 'Back', and thus you see multiple 'Back' choices to select from):
AddPageLink (Inventory, player.exit_inventory, "Back")
---------------
you store the current page you're in (via: player.parent, let's say it's Page1) to the 'player.exit_inventory' Object Attribute: player.exit_inventory = player.parent
and then you add that page (Page1) to your List Attribute: AddPageLink (Inventory, player.exit_inventory, "Back"), labeling the link choice (to Page1) as 'Back'.
now you goto another Page, and the same thing repeats:
you store the current page you're in (via: player.parent, let's say it's now Page2) to the 'player.exit_inventory' Object Attribute: player.exit_inventory = player.parent
and then you add that page (Page2) to your List Attribute: AddPageLink (Inventory, player.exit_inventory, "Back"), labeling the link choice (to Page12) as 'Back'.
and now you got as choices:
Back (takes you to Page1)
Back (takes you to Page2)
and repeating for more new pages:
Back (takes you to Page1)
Back (takes you to Page2)
Back (takes you to Page3)
Back (takes you to Page4)
etc etc etc
-------------------
thus, because you're working with a List Attribute... you're going to have to have a code line to remove all those other (old) page choices from your List Attribute:
(there should be some kind of) ~ 'RemovePageLink' Script/Function
you'll have to iterate (cycle) through the list and remove each item (page name), and then add in your new item (page name):
foreach (page_variable, Inventory) {
RemovePageLink (Inventory, page_variable)
}
AddPageLink (Inventory, player.exit_inventory, "Back")
HK edit:
actually, you shouldn't be using foreach, as you should just have a single choice in the List (your old choice, which you want to remove, so when you add in the new choice, it is the only choice in the List), but this will require a bit of work with when/how you update your 'old_page' Attribute. Using the 'foreach' method is easier to do, but in terms of coding efficiency, it shouldn't be needed/used, and so it'd be a wasteful/un-needed action (not efficient).
--------
or, even better, (if you can do so in the Game Book version), over-write the built-in List Attribute (thus erasing all of your old page-name choices), by creating a new List Attribute for it:
(for text adventure version:
http://docs.textadventures.co.uk/quest/ ... glist.html ,
http://docs.textadventures.co.uk/quest/ ... lists.html )
Inventory = NewPageLink ()
AddPageLink (Inventory, player.exit_inventory, "Back")
or, maybe if there's no 'NewPageLink()' Function/Script, and there is the 'split' Function/Script, you can try using that too (as it creates/returns a List):
http://docs.textadventures.co.uk/quest/ ... split.htmlInventory = split ("temp", ";") // not sure if there's a default split (so you're not giving it, adding in, any items/choices): split (), as if you were to do this: split ("", ";"), you'd still get a 'whitespace/blank' choice, lol
AddPageLink (Inventory, player.exit_inventory, "Back")
RemovePageLink (Inventory, temp)