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.
Hey all I'm trying to display gold on the screen but theirs a problem I create the gold amount first with "$ coins = 0" inside my label then I just want to add to the pile of gold "$ coins += 1" and i get an error that says gold is not defined I also have this part as my display window
$ a = 0
$ b = 0
screen simple_example_inventory:
frame xalign 0.5 ypos 0.1:
vbox:
$ a = "[coins]" # amount of coins
$ b = "coins" # just the text coins
text "[b]: [a]"
Last edited by dosa0733 on Sun Nov 15, 2015 6:50 pm, edited 1 time in total.
Why don't you just keep the text "coins" as just "coins?" Why does it need to be a variable? Are you planning on altering the text throughout the game?
Also, why don't you just use "$ a += 1" to increase the number? Why do you need to redefine it elsewhere?
I solved the problem whit it . As for the reason of writing like that i will add more currency types dependig on the region where the player is playing in the game