So I have a few questions that I need help with.
I'm using sugarcube 2.18 and I want to add a box to the sidebar (like the default save and restart) with all the possible endings, and you'll be able to see it when you unlock it. So is there a way to add boxes on the sidebar and make the last passage show up in the sidebar like "Ending 1" and with a desiption of it.
I also want to show a picture when you hover over text but I can only find the reverse, I know it's possible because I've seen it but not sure how to do it.
I also want to have the money you have show up in the sidebar but not sure on the best way to go about it, now I'm putting <<set $money = 100>> on the storycaption and <<print $money>> to show it and <<set $money = $money+20>> or whatever but it just shows the number. If I make it text like <<set $money = "100$">> it doesn't add or subtract when I want it to.
I'd really appriciate it if someone could answer.
Comments
I can't tell if that's exactly what you mean, though.
For the StoryCaption question, try something like:
That should work. I can't test it right now.
If having a description of each ending is also important, then you're probably better off making an "endings" passage, which will show all of the unlocked endings, and merely placing a link to that in StoryMenu.
For example, in StoryMenu:
And in the Endings passage:
Either way, I'd suggest using the hasVisited() function in this case, rather than visited()—suggested by Chapel—as it's more efficient for what you're using it for.
Unless the images you have in mind are fairly small, that's likely not going to work out very well. Can you provide more details about what exactly you're looking to do?
You almost never want to put initializations in StoryCaption, since it's refreshed every turn. You should do variable initialization in the StoryInit special passage.
In StoryInit:
In StoryCaption—any of the following will work, pick one: The first works by using the double dollar-sign markup ($$), which produces a literal dollar-sign in the output, immediately followed by the story variable $money, which via the naked variable markup prints its value. The latter three all make use of the <<print>> macro—specifically, the <<=>> alias—to render the literal dollar-sign you want separately from the value of $money.
As noted, all four will do what you want, simply pick one. I'd recommend the first.
Well I want to as an example have the word "tree" in the text and if you hover over it with the mouse it shows a picture of a tree, the size isn't that big so that shouldn't be a problem, if it doesn't work I could just put a picture below the text or make a link i guess, thanks again for your help.
Since the forums are supposed to be closing soon—tomorrow (July 15)—you may want to shift the image flyout question to the Q&A section of this website.
That said, you could try this CSS based method.
Styles (Twine 2: goes in Story Stylesheet; Twine 1: goes in stylesheet-tagged passage)
Usage
Using HTML markup: Using the custom styles markup: