How to write a [[Back]] link?

Hi, i have a section witch i can visit from more than one other section. How can i set a link witch brings me back where i klicked on it?

[[Room1]]:
@clear
[[Mirror]]
[[Room2]]

[[Room 2]]:
@clear
[[Mirror]]
[[Room1]]

[[Mirror]]:
@clear
Attributes are Shown

[[the room i watched the mirror]]


got a solution for myself

[[Room1]]:
@set room=Room1

[[Mirror]]:

[[{Room}]]


might not work but can try using a checkpoint?

this might allow you to loop round to what ever area you want and if you have already went past it, just set an alternate route of the room that has nothing in it

someone helped with it on another forum if you like to try it...


I would have suggested something like that :)

I think (not sure, haven't tested it) that you can also do something like this if you want the 'Back' link to always display the same text:

[[Back]]({room})

If you're using my tweaked core functions (I posted the code around here a few times), you could also use a master passage for this; something like:

[[Room1]]:
@clear
[Mirror]
[[Room2]]

[[Room 2]]:
@clear
[Mirror]
[[Room1]]

[[]]:
[Mirror]:
Attributes are Shown

In this case you don't need a back link, because clicking on the mirror displays it without moving the player away from the section they are on (so it just adds their attributes to what is currently on the screen, and they can still click on the links that were already there).

If you want to use @clear with this method, then you could use a link like [[Back]]({_section}), which should magically return the player to the last section they visited. (The special attribute _section contains the current section name; it's used to return the player to the right place when they resume a saved game)


this works but if you have an item you dont want the player to have or you want to make sure they dont pick up[ the item again, the checkpoint system might work for that too XD


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

Support

Forums