Help? Can't add to values more than once in a scene..
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.
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.
- namastaii
- Eileen-Class Veteran
- Posts: 1350
- Joined: Mon Feb 02, 2015 8:35 pm
- Projects: Template Maker for Ren'Py, What Life
- Github: lunalucid
- Skype: Discord: lunalucid#1991
- Soundcloud: LunaLucidMusic
- itch: lunalucid
- Location: USA
- Contact:
Help? Can't add to values more than once in a scene..
I hope this makes sense but in my story, the character can go back to their room and choose from a list of things to do until the time for the day is up or they're out of energy. etc.
Once they complete a task, it adds the new values, to their energy or their money or intelligence or whatever it may be, but then it jumps back to the room again to give them the choices again (i want it this way) but when i tell them to do another task, no matter what the task is... none of the values will change like they are supposed to.
for example.. lets say she did her chores. she gained 3 dollars of allowance and 2 hours have gone by.
jump back to room scene for more options
she chooses to do her chores again. money stays the same and hours are at the same and wont change.
so i try to choose something else like study. which should add intelligence points and take away more time...but it doesnt. Does anyone know what I'm doing wrong to solve this issue?
Thanks
Once they complete a task, it adds the new values, to their energy or their money or intelligence or whatever it may be, but then it jumps back to the room again to give them the choices again (i want it this way) but when i tell them to do another task, no matter what the task is... none of the values will change like they are supposed to.
for example.. lets say she did her chores. she gained 3 dollars of allowance and 2 hours have gone by.
jump back to room scene for more options
she chooses to do her chores again. money stays the same and hours are at the same and wont change.
so i try to choose something else like study. which should add intelligence points and take away more time...but it doesnt. Does anyone know what I'm doing wrong to solve this issue?
Thanks
Re: Help? Can't add to values more than once in a scene..
It would probably help if you post your script.
- namastaii
- Eileen-Class Veteran
- Posts: 1350
- Joined: Mon Feb 02, 2015 8:35 pm
- Projects: Template Maker for Ren'Py, What Life
- Github: lunalucid
- Skype: Discord: lunalucid#1991
- Soundcloud: LunaLucidMusic
- itch: lunalucid
- Location: USA
- Contact:
Re: Help? Can't add to values more than once in a scene..
Code: Select all
label room:
if energy <= 0:
jump sleep
scene bg mybedroom
with dissolve
#after first day:
$ hours += 16
show screen day_and_time_screen
"What would you like to do?"
if job is "unemployed":
menu:
"Study":
$ energy -= 3
$ hours += 3
$ intelligence += 5
"You studied."
jump room
"Find a Job":
menu:
"Apply at Bakery Store":
$ energy -= 1
$ hours += 1
$ job = "Bakery"
"Your application was sent in!"
jump room
"Apply at Library":
$ energy -= 1
$ hours += 1
$ job = "Library"
"Your application was sent in!"
jump room
"Go to the Store":
jump store
"Do your Chores - allowance $3":
$ energy -= 3
$ money += 3
show screen inv_screen
"You parents have given you your allowance."
jump room
"Sleep":
jump sleep
if job is "Bakery":
menu:
"Study":
$ energy -= 3
$ hours += 3
$ intelligence += 5
"You studied."
jump room
"Go to work":
$ energy -= 3
$ hours += 5
$ money += 11
"You went to work."
jump room
"Go to the Store":
jump store
"Do your Chores - allowance $3":
$ energy -= 3
$ money += 3
show screen inv_screen
"You parents have given you your allowance."
jump room
"Sleep":
jump sleep
if job is "Library":
menu:
"Study":
$ energy -= 3
$ hours += 3
$ intelligence += 5
"You studied."
jump room
"Go to work":
$ energy -= 3
$ hours += 5
$ money += 15
$ intelligence += 1
"You went to work."
jump room
"Go to the Store":
jump store
"Do your Chores - allowance $3":
$ energy -= 3
$ money += 3
show screen inv_screen
"You parents have given you your allowance."
jump room
"Sleep":
"Good Night!"
jump sleep
Re: Help? Can't add to values more than once in a scene..
It's not that the variables themselves aren't updating, it's that whatever you're using to track the variables isn't (I would assume a screen). If you press shift+r or put in a line of dialogue after every menu choice that says, for example, "intelligence [intelligence]" you'll see that the variable itself has changed.
I don't quite understand what the issue is with the screens not updating, but you can fix it by hiding and showing the screen again.
I don't quite understand what the issue is with the screens not updating, but you can fix it by hiding and showing the screen again.
- namastaii
- Eileen-Class Veteran
- Posts: 1350
- Joined: Mon Feb 02, 2015 8:35 pm
- Projects: Template Maker for Ren'Py, What Life
- Github: lunalucid
- Skype: Discord: lunalucid#1991
- Soundcloud: LunaLucidMusic
- itch: lunalucid
- Location: USA
- Contact:
Re: Help? Can't add to values more than once in a scene..
Thank you. I could try hiding and re showing them 
Who is online
Users browsing this forum: Google [Bot]