Return history button without logic re-running

Hello!

I’m using the following code in my inventory to allow the player to go back to the previous passage they were on; unfortunately it results in varaibles such as adreanline levels being implemented again or the same items being added to the inventory; is there a way to use the return button as here: (link-goto: “Return”, (history:)'s last) without the player having the same logic play?

Many thanks!

You can simply use the (undo:) macro (documentation ). It will Undo the last action (a.k.a. going to the inventory).

The “process the contents of the previously visited Passage again” behaviour is one reason why some people display content like inventory and character stats in dialogs, because closing a dialog doesn’t cause a Passage Transition.

eg. If you have a Passage named Inventory whose content you want to show when a link is selected, then you would use code like the following…

Welcome to the Library...

(link-repeat: "Show Inventory")[(dialog: [(display: "Inventory")], "Close")]
1 Like