I'm coming up against a wall with this so any help (or maybe a better implementation, if I'm doing something stupid?) would be appreciated.
My inventory system is a page of icons accessible from the sidebar where, ideally, the player clicks between gear they've obtained to put something else on and then the inventory page returns them to wherever story page they were before they clicked Inventory in the sidebar. Also, on clicking on the icon, it needs to set a couple of variables to adjust the stats associated with the item they're newly wearing.
I can get this partly working with the <<click>> macro, but the problem is that I can't seem to also implement the "go back to the page you were on before" because <<click>> requires a link to go to, and I don't want there to be one (just the "go back" part.)
This code works fine for what I want:
The two variables there work fine and everything is lovely.
If I do this, however:
It breaks, because <<click>> requires an explicit link to go to, and the <<return>> part is ignored.
I've tried implementing Engine.backward, but I can't seem to work in the variable setting and it also seems to undo instead of pushing forward to last page before the Inventory one. The regular [[Link|Text][Setter]] also only appears to work with a single variable, and I need to be able to change as many as I wish.
Any suggestions?
My inventory system is a page of icons accessible from the sidebar where, ideally, the player clicks between gear they've obtained to put something else on and then the inventory page returns them to wherever story page they were before they clicked Inventory in the sidebar. Also, on clicking on the icon, it needs to set a couple of variables to adjust the stats associated with the item they're newly wearing.
I can get this partly working with the <<click>> macro, but the problem is that I can't seem to also implement the "go back to the page you were on before" because <<click>> requires a link to go to, and I don't want there to be one (just the "go back" part.)
This code works fine for what I want:
<<click "Test" "Text">><<set $no to "Worked!">><<set $go to "Also worked!">><</click>>
The two variables there work fine and everything is lovely.
If I do this, however:
<<click>><<set $no to "Worked!">><<set $go to "Also worked!">><<return>><</click>>
It breaks, because <<click>> requires an explicit link to go to, and the <<return>> part is ignored.
I've tried implementing Engine.backward, but I can't seem to work in the variable setting and it also seems to undo instead of pushing forward to last page before the Inventory one. The regular [[Link|Text][Setter]] also only appears to work with a single variable, and I need to be able to change as many as I wish.
Any suggestions?