[Solved] Turn conversation into a variable?

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
Posts: 15
Joined: Wed Nov 20, 2019 3:19 pm

[Solved] Turn conversation into a variable?

#1 Post by Rekoija » Wed May 27, 2020 10:46 am

Aight so, I want to make this code as simple to repeat as I can, it gets a bit annoying having to copy paste a conversation a bunch of times if there's an easier way.

So I've been wondering, is there some sort of way to turn a conversation into something that's really easy to call?

(gonna show you some code i definitely know won't work, but'll demonstrate what i'd like)

$ convo1 = (
if x = True:
xyz "blah blah"
xyz "blergh"

and then somehow making the convo play whenever i use the variable?
it sounds like it'll be really complicated or even impossible, but i'm not super experienced with code, so who knows?
i'll post it just in case i'm wrong.

Thanks in advance!
(and if you know it's not possible, i'd also appreciate a reply saying that :D)
Last edited by Rekoija on Wed May 27, 2020 2:45 pm, edited 1 time in total.

User avatar
Lemma-Class Veteran
Posts: 3378
Joined: Mon Dec 14, 2015 5:05 am
Location: Your monitor

Re: Turn conversation into a variable?

#2 Post by Imperf3kt » Wed May 27, 2020 10:57 am

If you have something you want to repeat multiple times that'll never really change, you can just put it in its own label, put a return at the end, and use "call label_name" to make your script jump to the label, and back when it's done.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Free Android GUI - Updated occasionally
Imperf3kt Blackjack - a WIP blackjack game for Android made using Ren'Py
Latest Blackjack updates

Post Reply

Who is online

Users browsing this forum: No registered users