OK, so I'm a newbie trying to develop my first Ren'Py game, and 90% of my time is spent debugging, but I'm almost literally hitting my head on the keyboard with stuff which previously worked but now doesn't when I add something new which (as far as I can see) doesn't affect what I've done already. I'm on version 7.3.5.606.
Interpolations suddenly stop working and the contents of lists aren't interpreted correctly. There's obviously something simple which I'm missing. In this example, I want a task to be defined in a location. I've reduced the number of locations to one for simplicity. Here's the relevant part of the code:
It returned the location before, so what's the problem? Any help would be much appreciated.
Interpolations suddenly stop working and the contents of lists aren't interpreted correctly. There's obviously something simple which I'm missing. In this example, I want a task to be defined in a location. I've reduced the number of locations to one for simplicity. Here's the relevant part of the code:
Code:
label start:
$ area_name = ["City"]
label generate_tasks:
$ ntasks = 2
$ itask = 0
$ tasklocationlist = []
label new_task:
# Choose task location
$ randomlocation = renpy.random.randint(0,len(area_name)-1) # This returns: 0, obviously
$ tasklocation = area_name[randomlocation]
"Location [tasklocation]" # This returns: Location City
# (Various other task-related statements)
# ...
if itask < ntasks:
$ tasklocationlist.append(tasklocation) # This is supposed to add the location of this task to the list of locations
"Task locations: [tasklocationlist]" # This returns: [u'City'] and then [u'City',u'City']
$ newloc = tasklocationlist[itask]
"Location [newloc]" # This returns: Location [newloc]
$ itask += 1
jump new_task