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.
-
Timberduck
- Regular
- Posts: 60
- Joined: Sat Jan 04, 2014 12:52 am
- Location: Canada
-
Contact:
#1
Post
by Timberduck » Sat Jan 04, 2014 1:10 am
I have created a photo gallery
sample list :
##Gallery 1
image a = "a.jpg"
image ab = "ab.jpg"
image ac = "ac.jpg"
image ad = "ad.jpg"
and so on...
What I want to do is view 12 random images from the above chart then jump randommenu
bonus: is there a way to make sure the same image those not show up more then once in the 12 random image cycle.
I have over 300 some images charted
Any help would be awsome
\m/ TIMBERDUCK \m/

-
Biomass
- Regular
- Posts: 104
- Joined: Tue Jan 01, 2013 11:13 pm
-
Contact:
#2
Post
by Biomass » Sat Jan 04, 2014 2:16 am
You're looking to produce a random permutation of images from a list.
Theres a permutation function in the itertools python package that may be of interest to you.
-
Timberduck
- Regular
- Posts: 60
- Joined: Sat Jan 04, 2014 12:52 am
- Location: Canada
-
Contact:
#4
Post
by Timberduck » Sat Jan 04, 2014 7:12 pm
Thanks Alex
It works perfectly.
Ill be publishing soon.
\m/ Timberduck \m/
Users browsing this forum: Google [Bot]