Can Character Conversation Text Be Segregated Using Scenes Instead Of Truth States?

I have a character that is available for conversation at the Start and End of a game.

Currently I am using a truth state to determine which character conversation text to display.

Instead of asking X about "Y":
   if start-game is true:
      say "A.";
   otherwise:
      say "Z."

Is it possible to get rid of the truth state and put individual Asking code in separate scenes (extra scene code has been removed from the example below for clarity)?

Start is a scene.
   Instead of asking X about "Y": say "A."

End is a scene.
   Instead of asking X about "Y": say "Z."

I am currently reading through the Chapter 10: Scenes documentation but have not found anything specific about this yet.

Thanks in advance.

1 Like

You can do this:

Instead of asking X about Y during Start: say "A."

Instead of asking X about Y during End: say "Z."

or even:

Instead of asking X about Y:
    if Start is happening:
        say "A.";
    otherwise if End is happening:
        say "Z.";
    otherwise:
        say "B."

or more succinctly:

Instead of asking X about Y, say "[if Start is happening]A[otherwise if End is happening]Z[otherwise]B[end if]."

The last case is to catch instances where neither scene is happening.

3 Likes

@J_J_Guest The “during Start/End” suffixes will certainly allow me to separate the individual code without relying on a truth state and make things a bit cleaner.

Instead of asking X about Y during Start: say "A."
Instead of asking X about Y during End: say "Z."

If my original idea is not feasible, I could use the above technique and organize conversation text using the various headings.

Book - Characters
   Part - Character #1
      Chapter - Conversation
         Section - Start Scene Conversation Text
            Instead of asking X about Y during Start: say "A."
            ...
         Section - End Scene Conversation Text
            Instead of asking X about Y during End: say "Z."
            ...

I like this idea since it lets me keep that character conversation text with the character and put only non-character and world code in the individual scenes and get rid of a truth state variable (but if anyone has any thoughts about my original question please post as well).

Thank you.

A scene is really nothing more than a flag, it’s similar to a truth state but if has the advantage of that additional syntax, “if Scene is happening” and “during Scene”.

It doesn’t make any difference where you put your conversation code. Putting it in the same chapter or section as the scene doesn’t mean it will only run during that scene - you need to explicitly add that condition. But by all means put it in the same section if it helps you to organise it.

1 Like

I implemented the conversations in my game using almost the exact same approach, and it worked out OK – but if I were to do it again, I’d make two changes:

  • First, I would definitely do this via carry out rather than instead rules. For the reasons laid out in this thread, it’s easy to get into trouble with instead rules, and I wound up creating lots of extra work for myself by using them (for example, in one sequence I wanted other characters to notice if the player was talking to somebody – this is trivial to do with an “after asking someone about something” catchall rule if you’re using the carry out asking approach, but much harder if you’re using instead ones.

  • I’d use tables to organize the responses – it’s much neater and easier to edit, I think. See the Costa Rica Ornithology example to see one way to do this.

2 Likes