Making a dialogue speech appear only if right answer is chosen

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
Frey
Newbie
Posts: 3
Joined: Wed Nov 07, 2018 11:36 pm
Contact:

Making a dialogue speech appear only if right answer is chosen

#1 Post by Frey »

Hi guys, I'm kinda new at this and so I'm kinda suffering from last minute stuff. I was just wandering how to make a text(Not a menu choice) available on if a choice is chosen. It won't appear if a different choice was chosen.

User avatar
Per K Grok
Miko-Class Veteran
Posts: 882
Joined: Fri May 18, 2018 1:02 am
Completed: the Ghost Pilot, Sea of Lost Ships, Bubbles and the Pterodactyls, Defenders of Adacan Part 1-3, the Phantom Flyer
itch: per-k-grok
Location: Sverige
Contact:

Re: Making a dialogue speech appear only if right answer is chosen

#2 Post by Per K Grok »

Frey wrote: Thu Nov 29, 2018 11:26 pm Hi guys, I'm kinda new at this and so I'm kinda suffering from last minute stuff. I was just wandering how to make a text(Not a menu choice) available on if a choice is chosen. It won't appear if a different choice was chosen.
You could use a variable i.e

default vChoices=0

When the player make a choice in the game that should effect something later you change the value of the variable.

$ vChoice=1


You then use the value of the variable to determine what will happen at a certain point in the game

Code: Select all

if vChoice==1:
    pc1  "Let me tell you this very important piece of information......." 
else:
    pc1 "Niece weather we are having, no?"

Frey
Newbie
Posts: 3
Joined: Wed Nov 07, 2018 11:36 pm
Contact:

Re: Making a dialogue speech appear only if right answer is chosen

#3 Post by Frey »

Per K Grok wrote: Fri Nov 30, 2018 1:35 am
Frey wrote: Thu Nov 29, 2018 11:26 pm Hi guys, I'm kinda new at this and so I'm kinda suffering from last minute stuff. I was just wandering how to make a text(Not a menu choice) available on if a choice is chosen. It won't appear if a different choice was chosen.
You could use a variable i.e

default vChoices=0

When the player make a choice in the game that should effect something later you change the value of the variable.

$ vChoice=1


You then use the value of the variable to determine what will happen at a certain point in the game

Code: Select all

if vChoice==1:
    pc1  "Let me tell you this very important piece of information......." 
else:
    pc1 "Niece weather we are having, no?"
Thanks I think I get it! :D

Post Reply

Who is online

Users browsing this forum: Google [Bot], henne, MisterPinetree