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.
SOLVED- I had dumb code plugged in elsewhere for no reason
In my game's time manager a player is given the choice of 3 locations for free time, when they make 1 of 3 choices the variable decide is changed to either library, gym, or lounge.
THEN the free time count is adjusted so that the events of each place are somewhat linear.
Basically if they go to the library 5 times, it should call library event 6 the next time it's chosen.
But if Gym is chosen it should call gym event 1. but its not doing that. It's calling gym event 6 ????
I can't figure out why it's doing that. This section of code is the only time the count variables are changed and I can't figure out why it isn't working ??? help????
side note: if the days are 2, 4, 6, or 7 a whole different set up happens and that works fine.
call screen choice_map
with dissolve
if decide == "library":
scene bg library
with fade
if day == 1 or day == 3 or day == 5:
$ li_cnt += 1
$ fte_cnt = li_cnt
if decide == "gym":
scene bg gym
with fade
if day == 1 or day == 3 or day == 5:
$ ge_cnt += 1
$ fte_cnt = ge_cnt
if decide == "lounge":
scene bg lounge
with fade
if not lonVisited:
call lonIntro from _call_lonIntro
$ lonVisited = True
return
else:
if day == 1 or day == 3 or day == 5:
$ be_cnt += 1
$ fte_cnt = be_cnt
if day == 1 or day == 3 or day == 5:
if fte_cnt <= freetime_max:
call expression str(decide) + "_fixed_event_" + str(fte_cnt) from _call_expression_17
else:
call expression str(decide) + "_event_done" from _call_expression_19
else:
call expression str(decide) + "_generic_event" from _call_expression_18
Last edited by Scribbles on Wed Dec 12, 2018 8:13 pm, edited 1 time in total.
I can't seem to find any problem in the code you've posted here, at least testing it in a brand new project with some quickly-typed labels to test out. My only guess is that fte_cnt is not being set properly somewhere, as it is the variable that you use to determine wich event to call. If you want I can post my test code, though it is a bit large.
I went through and found some random code that set all the counters to 13 for some reason???? not sure why I wrote that or left it in > < Only found it by slowly testing!