Search found 33 matches

by 15nick
Thu Oct 17, 2013 5:57 pm
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED] Having a variable be random every time
Replies: 6
Views: 1846

Re: Having a variable be random every time

Having a variable be random every time This solution will do exactly what you asked. class RandomString: def __init__(self,*l): self.l=l def __str__(self): import random return str(random.choice(self.l)) redhair=RandomString("bright red","dark red","bloody red","r...
by 15nick
Thu Oct 17, 2013 12:24 pm
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED] Having a variable be random every time
Replies: 6
Views: 1846

Re: Having a variable be random every time

You've misunderstood the post on stackoverflow in general, it shouldn't work like you want it to. return result; ; at the end does nothing. Sorry. I know some C++ and force of habit. When you call your function, whatever that function returns is assigned to your redhair variable. When you access th...
by 15nick
Thu Oct 17, 2013 3:08 am
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED] Having a variable be random every time
Replies: 6
Views: 1846

[SOLVED] Having a variable be random every time

Unfortunately I'm having an issue with a random variable. I want this variable to be chosen randomly from an array and that performs perfectly. The error is that I have the variable equal to the return of a function that picks the random choice, so it should show up as a random choice whenever I cal...