Displaing preference variables

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
Lutka
Newbie
Posts: 23
Joined: Mon Apr 24, 2017 11:13 am
Contact:

Displaing preference variables

#1 Post by Lutka » Thu Aug 31, 2017 9:57 am

So the default bar you drag to change the text speed is quite bare bones, I was thinking would it be possible to display the text speed variable as a number next to the bar?
For the life of me I can't figure out what the variable would even be called, let alone how to call it in to text. Where are these variable names even defined?

User avatar
DannyGMaster
Regular
Posts: 113
Joined: Fri Sep 02, 2016 11:07 am
Contact:

Re: Displaing preference variables

#2 Post by DannyGMaster » Thu Aug 31, 2017 10:25 am

They're defined in every project in a file called options.rpy. For the text speed specifically it can be found around line 116:

Code: Select all

default preferences.text_cps = 0
To convert it into text, you would place that name in a string, and within square brackets:

Code: Select all

text "[preferences.text_cps]"
The silent voice within one's heart whispers the most profound wisdom.

Lutka
Newbie
Posts: 23
Joined: Mon Apr 24, 2017 11:13 am
Contact:

Re: Displaing preference variables

#3 Post by Lutka » Thu Aug 31, 2017 10:37 am

Thanks for the quick reply, that worked :)

Post Reply

Who is online

Users browsing this forum: lking22