Howdy, Stranger!

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

Replacing macros

Hi! It's the newb again, using SugarCube.

I'm trying to figure out how to create an effect where you go through the game and text says one thing, and once you trigger an event, if you return to those locations the text is different.

I've been using <<if visited("passage")>> <<endif>> which works fine for additional text, but I'm having trouble altering the text that's already there. Replace macros only seem to replace them by making it clickable or mousing over them.

Is there another way to do this? Thanks!

Comments

  • I think the <<once>> macro would be helpful here. It's part of the replace set of macros. It displays the text the first time you reach the passage, and then you can set it to change the text the second time you reach the passage.

    Basically you would write your text like this:

    <<once>>This is an abandoned mall, devoid of life.<<becomes>This is a mall full of zombies<<endonce>>

    The text before the <<becomes>> would be displayed when you first reach the passage, and the text after would be displayed on the second time around. You can add more <<becomes>> to modify it for third and fourth times too.
  • Nycea wrote:
    I'm trying to figure out how to create an effect where you go through the game and text says one thing, and once you trigger an event, if you return to those locations the text is different.

    I've been using <<if visited("passage")>> <<endif>> which works fine for additional text, but I'm having trouble altering the text that's already there.


    Assuming that I understand what you want.  Why don't you do something like one of these: (they're the same, only the logic is inverted)

    <<if EVENT>>/% Post-event text goes here. %/<<else>>/% Pre-event text goes here. %/<</if>>

    <<if not EVENT>>/% Pre-event text goes here. %/<<else>>/% Post-event text goes here. %/<</if>>
    For example, if the event was external to the text logic, then you could do something like: (the value of $zombiesActive would be set elsewhere; scenario courtesy of SpatkplusTwelve's zombie infested malls)

    As you make your way into the mall, you \
    <<if not $zombiesActive>>\
    discover that it seems devoid of anyone. Thankfully, that includes zombies, especially zombies.\
    <<else>>\
    stop dead in your tracks as you notice that it's full of zombies!\
    <</if>>
    On the other hand, if if the event was coupled to the text logic, then you could do something like: (notice that in the not $metNancy case, $metNancy is set to true)

    As you turn the street corner you see \
    <<if not $metNancy>>\
    <<set $metNancy to true>>\
    a petite woman dressed in faded jeans and a tie-dyed t-shirt, seemingly camped out on a nearby stoop. Noticing your arrival, \
    she stands up and greets you with a smile, "Well, hello there, I haven't see you around these parts before. I'm Nancy."\
    <<else>>\
    Nancy again, still camped out on her stoop.\
    <</if>>
    n.b. The line continuations were used to make the examples fit on screen better, you don't have to use them.
Sign In or Register to comment.