Procedural generated Ren'Py?

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
Chronocide
Regular
Posts: 77
Joined: Tue Feb 16, 2021 8:03 pm
Projects: Land of the 11 Towers
Contact:

Procedural generated Ren'Py?

#1 Post by Chronocide » Wed Mar 03, 2021 11:45 pm

Random settings or semi-random character encounters, can this be done with Ren'Py?

Still a noob, still trying to figure out the best directions to proceed..

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

Re: Procedural generated Ren'Py?

#2 Post by Imperf3kt » Thu Mar 04, 2021 12:48 am

The simple answer is yes.
The more complete answer is a question : How does your game work, is it an RPG, point and click, idle clicker game, dating sim, vanilla VN etc.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor
Free Android GUI - Updated occasionally
Twitter
Imperf3kt Blackjack - a WIP blackjack game for Android made using Ren'Py

User avatar
zmook
Veteran
Posts: 421
Joined: Wed Aug 26, 2020 6:44 pm
Contact:

Re: Procedural generated Ren'Py?

#3 Post by zmook » Thu Mar 04, 2021 10:27 am

renpy.random is a random-number generator that supports renpy rollback.

https://www.renpy.org/doc/html/other.ht ... npy-random

Code: Select all

# return a random float between 0 and 1
$ randfloat = renpy.random.random()

# return a random integer between 1 and 20
$ d20roll = renpy.random.randint(1, 20)

# return a random element from a list
$ randfruit = renpy.random.choice(['apple', 'orange', 'plum'])
colin r
➔ if you're an artist and need a bit of help coding your game, feel free to send me a PM

User avatar
Chronocide
Regular
Posts: 77
Joined: Tue Feb 16, 2021 8:03 pm
Projects: Land of the 11 Towers
Contact:

Re: Procedural generated Ren'Py?

#4 Post by Chronocide » Thu Mar 04, 2021 1:14 pm

Thank you both.

Post Reply

Who is online

Users browsing this forum: GetOutOfMyLab, Google [Bot]