Variables in section/passage links?

Is it possible to use a variable in a link title? Something like:

[[@variable]]

Such that the above link would lead to different sections depending on the value of the variable "variable"?

I've been trying to use if-then to accomplish the same effect but am running into limitations of what can be displayed in the then clause.


Hello!

Try something like this;

    set("variable","CLICK ME!")
This is an example game.

[[{variable}]](THISLINK):



[[THISLINK]]:

It works!

Quick Squiffy Reference


Editable example game in Scratchpad

http://docs.textadventures.co.uk/squiffy/scratchpad/?gistid=3469e07e5c6bbf245db5efb6d76dc8f4&filename=var_in_link.squiffy


Hi there K.V.!

I swear, this morning I couldn't get custom link text to work inside @replace or inside if-thens (I can't remember which)!

At any rate, of course [[{variable}]] works too. Awesome!


I think what I was trying to do that wasn't working was:

{if condition:{@replace label=text}}

But you can do this instead:

@replace label={if condition:text} 

I updated my reference doc to indicate @replace doesn't work inside if-then.

Did I link you to your own reference?

Whoops!

I recognized your web handle, but I didn't remember that the reference doc was yours. (At least you know someone is using it!)


Log in to post a reply.

Support

Forums