Embedded or replaced passage seen/attribute help

Hello!

I'm trying to make an option populate if the player clicked on a replace passage link.

[Maybe you should say something to help.](@replace 1=dhelp)

{label:1=Original text.}

... later in the text ...

[[Outside]](doutside)
[[Different option]](ddiff)."
{if a:[[I'll drive you home]](dtakejhome)."}

[dhelp]:
Blah text
@set a
Blah text

Seen didn't work because it's an indirect use of the passage. I'd hoped that setting an attribute would help, but it seems that indirect use of the passage doesn't actually set the attribute either.

Any ideas on how I could make something like this work? Using @1 to make the new option populate works, but it forces the player to scroll to the bottom of the page, and I don't want that.


Nevermind, I found a workaround. I had @1 set the attribute. False alarm!


Answering off the top of my head, so I could be wrong. But this would be my first guess.

I think replace parses the text of a section or passage, but not the attributes or js.

Lines like @set and @inc are separated from the text when the game is compiled, and stored in attributes rather than text. While the short versions, for example {@a}, are stored in the text and parsed when they are reached (so that they can be placed inside {if blocks or whatever). So you could use {@a} instead of @set a and I think it should work.

Alternatively, I think you could use a link like [Maybe you should say something to help.](a,@replace 1=dhelp) so the link will both set an attribute a and do the replacement.


Oh neat! Thanks for the info, that's very helpful! I play with those options too and see what works best.


Log in to post a reply.

Support

Forums