Page 1 of 1

[SOLVED] Easy Question: Changing Words/Phrases in Narration Based on Choices?

Posted: Tue Sep 10, 2019 1:38 am
by StValentines
I imagine this is really easy, but I've had trouble finding answers to this. Always leads me to entirely different questions. :P

I have a scene where the player chooses an item from a list. This item will be referenced in the future, so I want to change certain lines based on this. For instance, whether the player chooses the pendant or the book, I want later lines of dialogue or narration to reference the pendant, or the book.

I could use if/else statements and write out multiple versions of each line that includes this item in the future, but that seems extremely inefficient compared to simply setting the item as a variable and calling it into each line that references the item. I'm sure there's a way to do that, but I can't figure out how.

So how do I tell the game to place a previously-defined word into text?

Re: Easy Question: Changing Words/Phrases in Narration Based on Choices?

Posted: Tue Sep 10, 2019 2:17 am
by 78909087
Hey! Sorry if I'm a bit rusty, I'm returning to Lemma after a long break.
From what I remember, you can set a variable as a word.

Code: Select all

label start:
    $ item = "nothing yet"
    "I go to the shop and wander around."
    "Oh! They have my favourite book. But it's so expensive!"
    "I carry it with me through the shop, stopping in front of a display case."
    "Oh again! That pendant somehow conveniently costs the same amount, and is also pretty!"
    "I can only afford one. Hm."
menu:
    "I want the pendant.":
        $ item = "pendant"
        "It's so shiny."
        jump ____
    "I'll choose the book, after all.":
        $ item = "book"
        "I already love it."
        jump ____
label ____:
    "Now that I'm home, I look at the [item]."
    mc "Oh, my sweet [item], I love you."

Re: Easy Question: Changing Words/Phrases in Narration Based on Choices?

Posted: Tue Sep 10, 2019 2:38 am
by StValentines
Yep, that did it! I knew it would be simple, haha. Thanks so much!

Re: [SOLVED] Easy Question: Changing Words/Phrases in Narration Based on Choices?

Posted: Tue Sep 10, 2019 4:00 am
by 78909087
No problem :)

If you have any questions you can try to PM me, I'll be doing my best to stay active.