Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Print message when option is clicked?

Sugarcube 2.0

Sometimes I'd prefer a message to just show up on the same page when a player click an option, instead of the link taking them to a separate passage. I know there's <<print>>, but how do I join that with a link?

Comments

  • If you want the new text to either join or replace the text of the link, you probably want one of: <<linkappend>>, <<linkprepend>>, or <<linkreplace>>.

    If you want the new text to appear somewhere else on the page, you'll probably want to use a combination of <<link>> and one of <<append>>, <<prepend>>, or <<replace>>.

    Your post is a bit scant on details, so it's difficult to say which would be best.
  • When I tried <<linkreplace>> I got an error saying no such macro exits.

    I want the room description here.

    Then the options here, and here.

    And the message to display here when the player clicks one of the options on the line above.
  • Which version of SugarCube 2.x are you using?

    The <<linkreplace>> documentation states that macro was added in 2.8.0 so you need to be using either that version or a later one.
  • edited November 2016
    Version 2.0.11

    I downloaded it from Twine's main page a couple of days ago. Just presumed the one on there would be the latest??

    Although. hold on. I think I was testing the above in the online one.

    Just checked and the online one is version 2.0.11 as well.
  • That's the version of Twine 2, not SugarCube. Look at the story formats window, each installed story format lists which version it happens to be—their versions are independent of the Twine 2 version.

    Based on your responses, I'm going to assume you're actually using SugarCube v1, probably 1.0.34 or 1.0.35, as SugarCube v2 does not come preinstalled in the current release of Twine 2.

    To install SugarCube v2, see the SugarCube 2.x in Twine 2 guide.
  • Man this is confusing!

    Thank you.
  • NOTE: The installation of SugarCube v2 does not overwrite the SugarCube v1 install. So, once you have it installed, be sure to select it as the story format used by your project from its menu—it will be listed as SugarCube 2 and the version should be 2.11.0.
  • edited November 2016
    Right, I've done all that, but when I switched to 2.11.0 it messed up all my CSS, so I've gone back to the previous version of Sugarcube.

    Unless there's a good reason for using 2.11.0 (aside from the <<linkreplace>>) I'll stick with the earlier version.
  • Jud_Casper wrote: »
    Right, I've done all that, but when I switched to 2.11.0 it messed up all my CSS, so I've gone back to the previous version of Sugarcube.

    Unless there's a good reason for using 2.11.0 (aside from the <<linkreplace>>) I'll stick with the earlier version.
    Currently the next release of the Twine 2.x application will automatically update your SugarCube 2.x story to use 2.11.0, so if you are planing to upgrade to the next release of Twine 2.x then it may be a good idea to fix the CSS issues now instead of using an older version of SugarCube 2.x
  • It sounds like Jud_Casper was using SugarCube version 1-- so I don't think it will affect them if they stick with the version they were using.

    @Jud_Casper: I realize the versioning does get confusing! My hope is once you get settled in with a format you're comfortable, you don't have to think too hard about versions.
  • I'm fairly okay with CSS - especially in that Twine makes changes so accessible - so getting SC2 looking how I want shouldn't be difficult. I just didn't fancy going through it all again at that moment in time.
Sign In or Register to comment.