The only alternative I can think of is to have an <<if>> statement on the shop page that shows one option if you have enough gold and another if you don't, but I'd really rather not do that.
Also for some thing it does a secret check at random intervals. So it would check if strength is gte an amount and if it is you get a special event.
Basically with some things I send the player to a check page, so for example if they go to buy a sword they are sent to a redirect page.
[…]
The only alternative I can think of is to have an <<if>> statement on the shop page that shows one option if you have enough gold and another if you don't, but I'd really rather not do that.
As a general rule, you should avoid routing passages—i.e. passages whose only purpose is to send the player somewhere else. You should also avoid the <<goto>> macro as much as possible—i.e. use it only after exhausting all reasonable avenues first.
Using the <<display>> macro should accomplish what want:
n.b. Your <<elseif>> is superfluous, an <<else>> is sufficient in this case.
That said, a better method would be to make the originating link—the one that currently leads to the routing passage—a <<click>> macro. Then instead of using a routing passage at all, you'd place its logic inside the <<click>>:
Also for some thing it does a secret check at random intervals. So it would check if strength is gte an amount and if it is you get a special event.
That could be handled with either a <<click>> macro—similar to my example above—or a routing function.
A <<click>> example:
<<click "Head to the village round">>
<<if $strength gte 20 and random(5) is 0>>
<<goto "random strength event">>
<<else>>
<<goto "village round">>
<</if>>
<</click>>
You could even make a widget out of the event logic, if you needed to reuse it in several places.
A routing function example:
[[Head to the village round|route("village round")]]
Obviously, you'd have to be able to write the routing function, so if JavaScript isn't your thing, you're probably be better off using something like the <<click>> example above.
Beyond the two mentioned here, there are other ways to handle that sort of thing.
I tried it out and it works exactly how you said it would. There are some downsides to doing it this way but I definitely think it works better than the alternative. Thanks.
Comments
TL;DR: What you're asking for is bizarre. So, yeah, details please.
The only alternative I can think of is to have an <<if>> statement on the shop page that shows one option if you have enough gold and another if you don't, but I'd really rather not do that.
Also for some thing it does a secret check at random intervals. So it would check if strength is gte an amount and if it is you get a special event.
Using the <<display>> macro should accomplish what want: n.b. Your <<elseif>> is superfluous, an <<else>> is sufficient in this case.
That said, a better method would be to make the originating link—the one that currently leads to the routing passage—a <<click>> macro. Then instead of using a routing passage at all, you'd place its logic inside the <<click>>: That's one of the good uses of <<goto>>.
That could be handled with either a <<click>> macro—similar to my example above—or a routing function.
A <<click>> example: You could even make a widget out of the event logic, if you needed to reuse it in several places.
A routing function example: Obviously, you'd have to be able to write the routing function, so if JavaScript isn't your thing, you're probably be better off using something like the <<click>> example above.
Beyond the two mentioned here, there are other ways to handle that sort of thing.