Howdy, Stranger!

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

Links that display passages instead of switching pages

Hi there. I'm interested in trying out this IF system, since it seems very well established and very well supported. I was initially interested in Dedalus, but the only line of support for it is the author, who has become unresponsive, and it seems nobody has actually used it to make anything aside from Cloak of Darkness. A shame, because I really liked how it had a basic but workable world model. I want to make a story where my main character gets things, uses things, talks to people, gives things to people, uses things in certain situations, etc.

I played Twine's RPG example, and was pretty impressed. It seems like you can indeed kludge together a world model, though I didn't like how everything you did meant you ended up going to a completely new page, no matter how trivial that action was. I think it would be a lot better if trivial actions displayed passages appended to the current one. I don't want to use a stretchtext format; I want each passage to represent a discrete situation, such as you're in a room and just standing there, or you're in the same room but using a specific device in that room, and by only displaying the text for that given situation, I feel players will be more immersed in said situation.

As an example for what I'm trying to do, let's say you're a young lady in your bedroom, and you got a couple plushies on your bed. One's a blue bunny named Nigel, and the other's a pink bunny named Nadine. While you're in your bedroom, as long as you don't have either of them in your inventory, they will be described on the bed. You can click on hyperlinks for either of them to describe them, and display a list of actions that you can do with them, and the actions would change depending on whether you have them in your inventory or not. So you could "Get" either of them while you don't have them, "Put back" when you do have them and are currently in your bedroom, and in any place when you have them, or when you don't have them but are in your bedroom, you can "Hug" them.

So you start out in your bedroom and you see its flowery, prosey description. It remains visible at all times, as long as you are in that situation (that is, you're standing in your bedroom not doing anything specific). Nigel and Nadine are included in the description. When you click on Nigel's hyperlink, he is described further, and you are given the option to Get him, or Hug him. If you click Nadine's hyperlink, her description and actions should replace Nigel's. If you elect to hug Nadine, an adorable description of you hugging the pink bunny plush replaces the description of Nadine and her actions, and displays a link to go back to the description to do more things, like hug her again or put her in your inventory. You should be able to access the same menu of actions from any other situation, as long as the item in question is in your inventory.

And lastly--and I imagine this is REALLY pushing it now--if you take either of the plushies, they should disappear from the passage, and if you put either of them back, they should reappear there. So that would require some way to refresh the passage in-place, without necessarily changing passages (or at least make it look like it refreshed in-place).

Is any of this possible, or am I trying to stretch Twine too hard? Thanks for reading, and for any assistance.

Comments

  • I'm sure you'll get better answers.  I gave up on stretchtext, but I want to do a slightly similar world model.  I don't mind going to a new screen for each interaction, but the thing I had trouble with is knowing what passage to send the player back to when they were done.  This is solved nicely if you look at the responses I got in the SugarCube FAQ (Sugarcube is a twine template that has very nice saving and loading interfaces, plus some more extras.)  That will show you a good way to keep track of what room/passage the player is "in".

    Sounds like what you want to do is have a master passage represent your room.  It contains flowery prose.  Then you can write <display Nigel> and <display Nadine>.  This will include passages called Nadine and Nigel on the same page.  These passages contain variables to decide their situation and the appropriate text.  These can have links that interact with Nigel and Nadine to change variables.  Because of this, you're going to need the page to refresh anyway, so it almost seems like you could design the entire page to *seem* like stretchtext although it updates on every click so the room description updates correctly. 

    This is rambling, I am also learning too but hopefully it might spark some inspiration.  You'll get much better advice downthread I'm sure.
  • @TiZ
    Most, if not all, of the functionality you have asked about should be possible to do using the built-in macros within SugarCube but it will take some effort on your part.

    The features you will need to learn about are <<click>> (Without forwarding version), <<append>>, <<prepend>>, <<replace>>, and <<remove>>

    You will also need to learn to insert html tags with id attributes into your passages.

    A very basic example of replacing the text/links of the current passage:
    NOTE: I have formatted the code below to make it a little easier to read, you dont need to space it out like I have in your own passages.

    You are in a room containing a bed, its a very nice bed.
    On the bed are two plushies:
    <<click "Nigel">>
    <<replace "#plussy">>
    Nigel is a blue bunny.
    <<click "Pat Nigel">>
    <<replace "#plussy">>
    Nigel grumbles.
    <</replace>>
    <</click>>
    <</replace>>
    <</click>>
    <<click "Nadine">>
    <<replace "#plussy">>
    Nadine is a pink bunny.
    <<click "Pat Nadine">>
    <<replace "#plussy">>
    Nadine purrs.
    <</replace>>
    <</click>>
    <</replace>>
    <</click>>
    <span id="plussy"></span>
  • Funny thing, I did some more digging myself while waiting for replies, and actually discovered the very things that greyelf mentioned! SugarCube is just oh so slick. And while I was at it, I also discovered tweego so I can use a directory structure and not be forced into a node map, where this will go out of control quickly.

    Basically what I did is create a widget macro called "int" (for interact), used like such: <<int "link text" "passage">> When the link is clicked, a div at the end of every passage, created in PassageDone, has its contents replaced with the specified passage, and then is revealed through CSS. It includes a few extra things, too, like a X at the top right to dismiss it. Any further actions taken in the box can replace the very same box. Since I make heavy use of passages for this, having to sort them out in a node map would be hell. Thank goodness for twee/tweego!

    And I also figured out how to replace the description text when the specified plushies are taken! The description text is contained in a separate passage as well, which is <<display>>'d inside an <<id>>. They show different things depending on a couple variable states. When a plushie is taken, a <<replace>> is run on that id with the same passage. I will probably make syntactic sugar for this with widget macros.

    Check out the demo and the source!

    Demo Story
    Story Source

    Thank you both for your help, in any case!
  • This is excellent...it'd be nice to be able to do this in sugarcane.  I guess I'd just need to tweak something like this, although I do like the idea of being able to interact with things inside the pop up as in the demo.
  • This is definitely cool :). Plenty of things new things for me to learn here.

    Thanks for sharing.



Sign In or Register to comment.