Questlog show hidden goal

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.
Post Reply
Message
Author
User avatar
Devon Andersson
Newbie
Posts: 7
Joined: Sun Nov 12, 2017 9:10 am
Contact:

Questlog show hidden goal

#1 Post by Devon Andersson »

Hi,

I am using this code as questlog:
viewtopic.php?t=25245#p310193

The way I understand it, the code has the option to hide parts (goals) of the quest. That works fine for me by using the following code:

Code: Select all

##Quest1
goals = [ ]
stages = [ ]

goals.append(Goal("find_cookie", "Find the cookie"))
# This quest-part is hidden, the last True sets it to hidden
goals.append(Goal("eat_cookie", "Eat the cookie",0,0,True,True))

stages.append(Stage("find_cookie,eat_cookie", "atlast"))

quests.append(Quest("More cookies!", "This is a dummy quest-descript-text.", "QuestTab1", goals, stages))
Now the player finds the cookie. I use the following code to mark part 1 as complete.

Code: Select all

$ log.markdone("find_cookie")
Now how do I show (or "unhide") the next part of the quest?

Edit:
I finally found a way to do it. Apparently the questlog does not have a function to unhide a goal ... so I had to figure out how to add my own.
The parameter must be a valid goal-name that was defined when creating the quests. This function must be added to the Questlog-class.

Code: Select all

def unhide_goal(self, goal):
    # find quest from goal
    q = self._findquest(goal)
    if not q:
        return None
    q.goal(goal).hidden(False)
Following the example above the goal would be "eat_cookie" and making quest-progress in ren'py would look like this:

Code: Select all

$ log.markdone("find_cookie")
$ log.unhide_goal("eat_cookie")

Post Reply

Who is online

Users browsing this forum: Ocelot