Text Box Change Based on Choices

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
User avatar
chapscher
Newbie
Posts: 11
Joined: Sun May 07, 2017 12:05 am
Tumblr: chapscher
Contact:

Text Box Change Based on Choices

#1 Post by chapscher » Sat Aug 12, 2017 3:52 pm

I'm trying to create a pre-fitted image text box that changes based on what choices the player makes in the game. For example, let's say that the game involves the character making a series of choices surrounding if they will or will not serve The Ice God. If you have 1 ice_points there may be a few snowflakes stuck to and around the text box, but if you have 10 ice_points then it's covered in ice and snow and has created an icy boarder around the entire game window.

This wouldn't just be for one character, this would be for all narration and dialogue.

How would I go about doing this?

Zherot
Regular
Posts: 72
Joined: Tue Aug 08, 2017 9:10 pm
Contact:

Re: Text Box Change Based on Choices

#2 Post by Zherot » Sat Aug 12, 2017 9:53 pm

I would make a class of buttons and a bunch of "if's" depending on the score that you are using to determine this, every button that i wanted to behave like this would inherit from that class. Now... don't ask me how to code that in renpy because i have no idea, renpy guides are pretty bad.

User avatar
AnnieDB
Regular
Posts: 35
Joined: Tue Dec 01, 2015 3:24 pm
Location: Seattle
Contact:

Re: Text Box Change Based on Choices

#3 Post by AnnieDB » Mon Sep 11, 2017 6:42 pm

You likely have a couple different options here, and you can mix and match for what seems best - here's a bunch of examples from people cooler than me!

ONE: swap out the background for choices with another image.
http://lemmasoft.renai.us/forums/viewto ... =51&t=9812

TWO: drop in images showing your level of "connection."
viewtopic.php?f=8&t=26705

THREE: build a custom setup within choice menus, so you can swap out the basic look of the options.
viewtopic.php?f=8&t=44780

Zherot is spot on - you're likely going to need a global variable that you declare like

Code: Select all

init -1:
    $ var_icegod = 0
then every time you're like "hey yeah, ice god, you rule" you get $ var_icegod += 1 or whatever.

This would require a basic check for how close you are in every dialogue, so effectively, all your dialogues will be 3x longer in script, although only one option will ever appear.
OR you could choose to run an IF script before you even get that menu choice so you don't have to code that 3 times, but personally I think having them in close juxtaposition is wise (and also easier for copy-paste)

Hope that helps - let me know if you need some code examples!

Post Reply

Who is online

Users browsing this forum: No registered users