Howdy, Stranger!

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

I need help with a branching story

Hey guys. I'm new to this (also new to programming)so bear with me, even if I might come off as unbearable.

So I'm new to Twine, and i've been using twine as a means of helping me plan out a story for a game that I want to make in the future. It's supposed to have a decent amount of player agency where the decisions you make in the act 1 could have serious ramifications somewhere in act 3. For instance, say that I steal something from a friend in Act 1, that friend will refuse to help me in Act 3.  Character are also supposed to say different things based on your decisions as well.  Now the trouble i'm having is trying to figure out what code to use so twine can remember the decisions I make. The initial way that I decided to do this was simply with "true" "false" statements where if a certain decision activated it would register as true. To my chagrin I found that when your moving on to another passage this doesn't really work so well. So I'm feeling kind of bummed about that. So may I ask: What would be the best way to have twine remember certain game states/decisions so that it can be recalled in later portions of the story? Thanks in advance.


-Also if more needs to be said or if something needs to be clarified please let me know.

Comments

  • Adventurous wrote:

    The initial way that I decided to do this was simply with "true" "false" statements where if a certain decision activated it would register as true. To my chagrin I found that when your moving on to another passage this doesn't really work so well.


    It doesn't work well in what way? It doesn't produce the correct result or the result is correct but the code is ugly? In either case, some example code would be useful so we can better understand the problem.
  • [QUOTE]It doesn't work well in what way? It doesn't produce the correct result or the result is correct but the code is ugly? In either case, some example code would be useful so we can better understand the problem.[/QUOTE]

    Well the way I did it, turns out i'm positive is completely wrong.  Here's an example of what I did:

    So in one Passages you have 3 choices to make. Each one would have a very simple set to true statement so for example:

    Choice 1:  Kill Gang Leader in honorable combat <<set $Level_B5_End = "1">>
    Choice 2: Spare Gang Leader and split the goods 50/50 <<set $Level_B5_End = "2">>
    Choice 3: Signal assassin to kill gang leader.<<set $Level_B5_End = "3">>

    So in Passage 2, I wanted to use the true false statements from the previous passage to produce different outcomes through if else statements. So for instance(in pseudocode form)
    if $Level1_B5_End=1
    *insert dialogue here*

    else if $Level1_B5_End=2

    *insert other dialogue here*

    else if $Level1_B5_End=3

    *insert some other dialogue here*

    end if

    The problem i'm having is having twine remember those true false statements as they move to different passages. The code in passage 2 doesn't activate at all so none of those dialogue boxes activate. The statements work fine if i was to define $Level1_B5_End in passage 2 though. So i'm wondering what I need to do so that it remembers my choices through the different passages



  • If your actual code looks like the pseudocode, you fell into a common trap: using "=" inside an <<if>> will change the variable. Use "eq" or "==" to test for equality.

    If I recall correctly, the latest/next Twine beta will trigger a warning or error for this, since it's such an easy mistake to make.
Sign In or Register to comment.