Ren'Py Callisto - Hint System Bug

Xavster

Well-Known Member
Game Developer
Mar 27, 2018
1,243
7,572
The current game I am working on has a hint system implemented into the map interface where quests are indicated by the presence of different colours of stars. Gold - main quest, Silver - miscellaneous, Blue - NSFW. Whilst this system works for the most part, bugs occur in the values within the arrays. If these were repeatable, then I would able to identify the problem, however they are unfortunately fairly random. I suspect the issue is in how I am handling the arrays.
As a brief summary, the update_quest and update_interact labels are called periodically to update the arrays, dependent upon the current status of the quest tracking variables. Given the quests are initiated in various locations at various times it is a matter of setting the room array to true for the correct day / time.
I have attached the relevant rpy file rather than listing the code is it's about 1700 lines long. Any assistance the community can provide will be appreciated.
 

Xavster

Well-Known Member
Game Developer
Mar 27, 2018
1,243
7,572
I believe I have identified the source of the issue. It was in the way I was resetting the array to false, prior to repopulating. I made the following changes to code.
Replaced:
Python:
$ interact_hold = i_hold
with:
Python:
$ resetFalse( "interact_hold")

init python:
    def resetFalse( listName):
         myList = getattr( store, listName )
         for i in range( 0, len( myList ) ):
             for j in range( 0, len( myList ) ):
                 myList[i][j] = False
If you spot any other issues please let me know.
 

the66

beware, the germans are cumming
Modder
Donor
Respected User
Jan 27, 2017
7,667
23,783
not actually causing problems, but with your function you convert your 7x6 items array into a 7x7 items array.
better use something like
Python:
def resetFalse(listName):
    myList = getattr(store, listName)
    outerLength = len(myList)
    innerLength = len(myList[0])
    for i in range(outerLength):
        for j in range(innerLength):
            myList[i][j] = False
and you can safely remove the string formatting method in all "star" imagebuttons when you don't use replacement fields (the curly braces).
Python:
#imagebutton auto ("q_star_%s.webp".format(chr)) action [SetVariable("map_active",0),Hide("c_map"),Jump("hold")] tooltip "main story"
imagebutton auto ("q_star_%s.webp") action [SetVariable("map_active",0),Hide("c_map"),Jump("hold")] tooltip "main story"
 
  • Like
Reactions: Xavster