Lemma Soft Forums

Supporting creators of visual novels and story-based games since 2003.


Visit our new games list, blog aggregator, IRC, and wiki.
Activation problem? Email [email protected]
It is currently Fri May 24, 2013 5:03 am

All times are UTC - 5 hours [ DST ]


Forum rules


Ask questions about one topic per thread, and use a descriptive subject. "NotImplemented error in script.rpy" is a good subject, "Tom's problems" is not. Remember to include all of traceback.txt or error.txt when reporting a problem, as well as the relevant lines of script. Use the [code] tag to format scripts.



Post new topic Reply to topic  [ 51 posts ]  Go to page Previous  1, 2, 3, 4  Next
Author Message
PostPosted: Tue Jan 13, 2009 11:57 pm 
Eileen-Class Veteran
User avatar

Joined: Mon Sep 19, 2005 2:15 am
Posts: 1284
Location: Florida
PyTom wrote:
That error is due to not calling theme.roundrect() or one of the other theme functions in init code.


I see, thank you.

Now, if only I could figure out why eval didn't work ...

My tests also turned up something interesting. If you call the random container again, you will get the same original result that was first called.
So assume $ random1= renpy.random.choice(['1','2','3']) and it calls "3".

Code:
"%(random1)s"
"%(random2)s"
"%(random1)s"


You'd get:

"3"
"something"
"3"

I have a container with over 100 different options so, and it definitely repeats it 1-4 times, no matter how many times I call it, it isn't random once it has already run.

Very frustrating ...

_________________
Obviously, this post has way too much text.

Love is my weapon and trust is my armor!


Top
 Profile Send private message  
 
PostPosted: Wed Jan 14, 2009 12:23 am 
Eileen-Class Veteran
User avatar

Joined: Fri Aug 31, 2007 7:02 am
Posts: 1265
Projects: 0 completed game. Still haven't made any meaningfully completed games...
You seem to have a lot of coding problems. May I suggest that you just get a coder. Maybe me (currently I'm coding for x_sinister but he gives me work a bit too slow for comfort.) If you want me as a coder, I be glad to code for you but my priority is still x_sinister's project. But that shouldn't be a problem unless he suddenly goes into overdrive. Because I put your project in second priority, you don't need to put me in the credits. And if I give you anything via PM, virus scan it first, because I'm still worried that somebody is hacking into my account (No proof though).

_________________
I suspect somebody is stealing my internet identity so don't believe everything I tell you via messages. I don't post or send messages anymore so don't believe anything I tell you via messages or posts.


Top
 Profile Send private message  
 
PostPosted: Wed Jan 14, 2009 12:28 am 
Eileen-Class Veteran
User avatar

Joined: Mon Sep 19, 2005 2:15 am
Posts: 1284
Location: Florida
I'm not going to give up ... I am going to get this to work the way I want it to if it kills me.

_________________
Obviously, this post has way too much text.

Love is my weapon and trust is my armor!


Top
 Profile Send private message  
 
PostPosted: Wed Jan 14, 2009 12:57 am 
Eileen-Class Veteran
User avatar

Joined: Fri Aug 31, 2007 7:02 am
Posts: 1265
Projects: 0 completed game. Still haven't made any meaningfully completed games...
BCS wrote:
I'm not going to give up ... I am going to get this to work the way I want it to if it kills me

Good for you (the not giving up part not the if it kills me part)

BCS wrote:
Now, if only I could figure out why eval didn't work ...

But it worked with mine. I using Renpy version 6.8.1 by the way. I just pasted the code Dusty had given. Maybe there something wrong somewhere else.

_________________
I suspect somebody is stealing my internet identity so don't believe everything I tell you via messages. I don't post or send messages anymore so don't believe anything I tell you via messages or posts.


Top
 Profile Send private message  
 
PostPosted: Wed Jan 14, 2009 1:11 am 
Regular
User avatar

Joined: Fri Jul 25, 2008 11:51 pm
Posts: 126
I have no idea why eval() didn't work for you, because it did for me. Sorry.

BCS wrote:
My tests also turned up something interesting. If you call the random container again, you will get the same original result that was first called.


That's supposed to happen.

As you might have figured out,
-warning, kindergarten teacher mode-

Simplest way I know how to explain this:

With pictures... ;D

Right now, random1-box has no value:
#random1[ ]

<renpy.random.choice([1, 2, 3])> spits out a value and then stores it in random1-box:
$ random1 = renpy.random.choice([1, 2, 3])
#<renpy.random.choice> -> 1 -> random1[]


Now, random1-box is 1:
#random1[1]

<r.r.choice()> spits out another value and then stores it in random2-box:
$ random2 = renpy.random.choice([1, 2, 3])
#3<renpy.random.choice> -> 3 -> random2[]


Now, random1-box is still 1, but random2-box is now 2:
#random1[1]
#random2[2]


random1-box does not want to let the value in its box go until the evil del-adventurer takes it away:
$ del random1
#random1[] now has no value. The value'll probably be sold in the market/on eBay :(


random1-box does not want to change its value until the evil = sign tells it to again, so if you keep calling on it to raise its number-hand, it will keep raising the 1 until the = sign comes again to tell it to change its number.
---
Summary: The container (variable) isn't random, the jar it comes out of (renpy.random.choice) is. So if you want random variables every time, you need to do it the long way.


Top
 Profile Send private message  
 
PostPosted: Wed Jan 14, 2009 1:56 am 
Miko-Class Veteran
User avatar

Joined: Tue Jul 24, 2007 12:58 pm
Posts: 526
Plus renpy.random.choice will give the same values if you rollback and forth over it.


Top
 Profile Send private message  
 
PostPosted: Wed Jan 14, 2009 1:58 am 
Eileen-Class Veteran
User avatar

Joined: Mon Sep 19, 2005 2:15 am
Posts: 1284
Location: Florida
Quote:
[b]$ del random1

Summary: The container (variable) isn't random, the jar it comes out of (renpy.random.choice) is. So if you want random variables every time, you need to do it the long way.


Got it. Thanks. Delete it, roll again, right?

_________________
Obviously, this post has way too much text.

Love is my weapon and trust is my armor!


Top
 Profile Send private message  
 
PostPosted: Wed Jan 14, 2009 4:36 am 
Eileen-Class Veteran
User avatar

Joined: Mon Sep 19, 2005 2:15 am
Posts: 1284
Location: Florida
I have defeated it! Sort of. It was sloppy, but I managed it. Results in last page of Twilight Princess epilogue beta thread in Hentai Works in Progress and Recruitment.

_________________
Obviously, this post has way too much text.

Love is my weapon and trust is my armor!


Top
 Profile Send private message  
 
PostPosted: Wed Jan 14, 2009 4:40 am 
Eileen-Class Veteran
User avatar

Joined: Fri Aug 31, 2007 7:02 am
Posts: 1265
Projects: 0 completed game. Still haven't made any meaningfully completed games...
BCS wrote:
I have defeated it!

Congratulations! I guess you didn't need a coder after all.

_________________
I suspect somebody is stealing my internet identity so don't believe everything I tell you via messages. I don't post or send messages anymore so don't believe anything I tell you via messages or posts.


Top
 Profile Send private message  
 
PostPosted: Wed Jan 14, 2009 4:57 am 
Eileen-Class Veteran
User avatar

Joined: Mon Sep 19, 2005 2:15 am
Posts: 1284
Location: Florida
Nope, even the worst programmar can conquer problems (if they have solutions) with three simple tactics:

-Save and launch for every major code block, to catch typos that cause traceback errors.
-Once a problem is found, isolate it by deleting irrelevant code and saving it as a second version, then keep on modifying it until it goes away.
-Keep on hunting for code examples or usage, so that bad format doesn't gum everything up.

For example, I know about very little actionscript, but I still manage to make Flash games using lots of tutorials and trial and error.

I have to thank Dusty, though, I couldn't have done it without knowing about $ del command for variables.

_________________
Obviously, this post has way too much text.

Love is my weapon and trust is my armor!


Top
 Profile Send private message  
 
PostPosted: Wed Jan 14, 2009 5:33 am 
Eileen-Class Veteran
User avatar

Joined: Fri Aug 31, 2007 7:02 am
Posts: 1265
Projects: 0 completed game. Still haven't made any meaningfully completed games...
BCS wrote:
Nope, even the worst programmar can conquer problems (if they have solutions) with three simple tactics

You missed out one thing: A strong will. The worst programmer probably end up as the worst cause he gave up too easily unlike you who had a never give up attitude.

_________________
I suspect somebody is stealing my internet identity so don't believe everything I tell you via messages. I don't post or send messages anymore so don't believe anything I tell you via messages or posts.


Top
 Profile Send private message  
 
PostPosted: Wed Jan 14, 2009 8:38 am 
Support Hero
User avatar

Joined: Sat Jun 17, 2006 7:28 pm
Posts: 3767
BCS wrote:
Got it. Thanks. Delete it, roll again, right?


You don't even need to delete it, really - just assign a new value over the top and it'll replace what was already there. The distinction is just that the variable will always contain whatever value it was last given, and can't go off and find a new random number on its own - you have to explicitly generate and assign a new random number each time you want it to change.

_________________
Image


Top
 Profile Send private message  
 
PostPosted: Wed Jan 14, 2009 10:28 am 
Eileen-Class Veteran
User avatar

Joined: Mon Sep 19, 2005 2:15 am
Posts: 1284
Location: Florida
Jake wrote:
BCS wrote:
Got it. Thanks. Delete it, roll again, right?


You don't even need to delete it, really - just assign a new value over the top and it'll replace what was already there. The distinction is just that the variable will always contain whatever value it was last given, and can't go off and find a new random number on its own - you have to explicitly generate and assign a new random number each time you want it to change.


I think I "got" it by the time I reached the end of my script, instead of copying and pasting gobs of text over. You can use a "call" function to accomplish this repeatedly, right?

_________________
Obviously, this post has way too much text.

Love is my weapon and trust is my armor!


Top
 Profile Send private message  
 
PostPosted: Wed Jan 14, 2009 1:05 pm 
Eileen-Class Veteran
User avatar

Joined: Fri Aug 31, 2007 7:02 am
Posts: 1265
Projects: 0 completed game. Still haven't made any meaningfully completed games...
BCS wrote:
I think I "got" it by the time I reached the end of my script, instead of copying and pasting gobs of text over. You can use a "call" function to accomplish this repeatedly, right?

Yeah. Just remember to add a return at the end of called script.

_________________
I suspect somebody is stealing my internet identity so don't believe everything I tell you via messages. I don't post or send messages anymore so don't believe anything I tell you via messages or posts.


Top
 Profile Send private message  
 
PostPosted: Wed Jan 14, 2009 7:21 pm 
Eileen-Class Veteran
User avatar

Joined: Mon Sep 19, 2005 2:15 am
Posts: 1284
Location: Florida
I wonder if there is any way to prevent a random container from selecting the same thing twice ... ?

_________________
Obviously, this post has way too much text.

Love is my weapon and trust is my armor!


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 51 posts ]  Go to page Previous  1, 2, 3, 4  Next

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: Google [Bot]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Protected by Anti-Spam ACP
Powered by phpBB® Forum Software © phpBB Group