'while loop' error in screen

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
visual00
Regular
Posts: 28
Joined: Fri Aug 22, 2014 8:28 am
IRC Nick: TaeIn
Contact:

'while loop' error in screen

#1 Post by visual00 »

I can't speak english very well. I'm sorry

In screen

while loop error occurs Why?

how do i?


this is my code and attached my proejct

Code: Select all

# why while error!? 
screen test:
    
    for item in ['a','b','c']:
        pass
    
    $ count = 10
    while count > 0:
        # process....
        $ count -= 1
        
# The game starts here.
label start:

    show screen test
            
    "test.."
    
    "test..test.."
    
    "test..test..test.."
            
    return
Attachments
name.zip
(1.45 MiB) Downloaded 24 times

User avatar
xela
Lemma-Class Veteran
Posts: 2481
Joined: Sun Sep 18, 2011 10:13 am
Contact:

Re: 'while loop' error in screen

#2 Post by xela »

Because it's a bad idea to use while loop inside of a screen. You can move it to python but it would still be a sh!tty idea. Handle your logic outside of the screen and use screens to display information and enable player to interact with the game.
Like what we're doing? Support us at:
Image

User avatar
visual00
Regular
Posts: 28
Joined: Fri Aug 22, 2014 8:28 am
IRC Nick: TaeIn
Contact:

Re: 'while loop' error in screen

#3 Post by visual00 »

xela wrote:Because it's a bad idea to use while loop inside of a screen. You can move it to python but it would still be a sh!tty idea. Handle your logic outside of the screen and use screens to display information and enable player to interact with the game.
It is a nice advice.
It has been very useful.
Thank you very much.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Majestic-12 [Bot]