Dynamic conversation (solved)

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
andyrenp
Newbie
Posts: 6
Joined: Sat Sep 15, 2018 2:21 pm
Contact:

Dynamic conversation (solved)

#1 Post by andyrenp »

Hi All! I've just joined the forum because I've been trying to figure out this problem for hours now. (It might be something easy and my brain is just fried up!)

What I'm trying to achieve is a conversation that jumps back to itself with different options in the menu based on what has already been asked.

Simple example...

Ask person 1 how he is (as a first option)
Ask person 2 how he is (as a first option)
ask person 1 to elaborate (if asked)
ask person 2 to elaborate (if asked)
Leave the conversation (if both elaborated)

I have had it working with True/False statements but would like to get it working with +=1 if possible for more in depth conversations such as ....

Ask person 1 how he is (as a first option)
Ask person 2 how he is (as a first option)
ask person 1 to elaborate (if asked)
ask person 2 to elaborate (if asked)
ask person 1 to elaborate further (if asked)
ask person 2 to elaborate further (if asked)
Leave the conversation (if both elaborated further)

my code at the moment is this....

Code: Select all

define j = Character("Jim")
define b = Character("Bob")
default jim = 0
default bob = 0

label start:

label talk:

menu:
    "How are you, Jim?" if jim = 0:
        jump jim1
    "Tell me about it, Jim" if jim = 1:
        jump jim2
    "How are you, Bob" if bob = 0:
        jump bob1
    "Tell me about it, Bob" if bob = 1:
        jump bob2
    "Leave" if jim = 1 and bob = 1:
        jump leave

label jim1:
    $jim += 1
    j "Oh I am great, just keeping busy"
    jump talk
label jim2:
    $jim += 1
    j "Well it's nothing interesting"
    jump talk
label bob1:
    $bob += 1
    b "Oh I am great, just keeping busy"
    jump talk
label bob2:
    $bob += 1
    b "Well it's all boring stuff"
    jump talk
label leave:
    "Well this is a boring conversation"
Any help is appreciated! I'm very new to renpy and I've been searching the documentation and forums for answers but can't find anything like this. Thanks!
Last edited by andyrenp on Sat Sep 22, 2018 1:36 pm, edited 1 time in total.

User avatar
trooper6
Lemma-Class Veteran
Posts: 3712
Joined: Sat Jul 09, 2011 10:33 pm
Projects: A Close Shave
Location: Medford, MA
Contact:

Re: Dynamic conversation

#2 Post by trooper6 »

if jim == 0
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)
Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978

andyrenp
Newbie
Posts: 6
Joined: Sat Sep 15, 2018 2:21 pm
Contact:

Re: Dynamic conversation

#3 Post by andyrenp »

Thanks! Got it working.

Post Reply

Who is online

Users browsing this forum: No registered users