[Solved] What is the correct way to change the value of a local screen variable?

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
henvu50
Veteran
Posts: 337
Joined: Wed Aug 22, 2018 1:22 am
Contact:

[Solved] What is the correct way to change the value of a local screen variable?

#1 Post by henvu50 »

EDIT: I don't think we're ever supposed to set a value like that in a screen. Alter your logic to something else.

What is the correct way to change the value of a local screen variable? There is no example of this in the documentation.

Code: Select all

screen test50():
    default localScreenVariable = 123
   
   # WHICH ONE?!  Why can't this basic info be in the documentation? 
    SetScreenVariable(localScreenVariable, 456)   
    $ SetScreenVariable(localScreenVariable, 456) 
    $ localScreenVariable = 456                   
    invoke Action SetScreenVariable(localScreenVariable, 456)

Post Reply

Who is online

Users browsing this forum: Baidu [Spider], Bing [Bot], Google [Bot]