I'll keep this example simple, as the principle is the same anyway, but I'm wondering if there's a more efficient way to show an action, than the method I currently use.
Let's say you have a passage in which a player may drink some water, and you want to 'animate' (not literally) that action. Here's how I'd do it.
Starting with a passage called, for instance, 'Forest Clearing'
You are by a stream in a forest clearing.
A cabin lies to the west while the tips of mountains can be seen to the east
[[Go west]]
[[Go east]]
[[Drink from the stream->Drink]]
Choosing the drink option would send the player to a separate passage called 'Drink' which would have the following.
You stoop down and fill your cupped hand with water. The water is cold and delicious.
[[Go West]]
[[Go east]]
Now okay, this works fine, but my thinking is that the more passages you have that don't actually lead anywhere, the more cluttered your grid is going to get.
Is there not a way to have the action display in the original passage. For instance have the 'Drink from the stream' link simply replaced by the 'You stoop...' action on click?
Comments
I was doing my own digging and suspected I'd need to use the 'print' or 'input' macros. Just shows how little I know.
I tried by best and ended up with this, which when tested returns the following errors:
Error: HTML tag "span" is not closedError: cannot find a closing tag for macro <<click>>Error: cannot find a closing tag for macro <<replace>>
I'm not entirely sure which parts you want pre-/post-replace, so for the moment, I can't offer an example. If you could clarify what you want it to look like before/after drinking the "clear liquid", that would help.
Please bear in mind I have this working exactly how I want it, but my method sends the player to another passage for the drink action.
Passage on 1st visit (assuming 'bottle of clear liquid' was taken at previous passage)
Passage after player chooses 'Drink Clear Liquid' option
Since you're using SugarCube v1.x, I'll probably recommend something like the following: (for this example assume the passage is named "Long empty road") A few notes:
Setter links make this stuff much easier as they alliw you to rerun the passage with a specific variable set. Logic is a bit prologish, but you can't have everything...
I tend to use an entry macro that simply prints whatever, if anything is in the $entry variable. That lets me do this:
]
Typed on my phone, so appologies for any typo's.