Skip to content
Don Renpy edited this page Jul 9, 2022 · 41 revisions

Quest system

alt text

The system of quests is a bit more complicated, it consists of Quests containing one or more Stages which in turn may contain one or more Goals. The stage can belong to the Quest or Stage dictionary. To create Quests you just have to enter the right values in Quests and Quest_stages.

Quest

The Quest() class is a set of stages, which follow each other in an orderly fashion. It is mandatory to define id and title. In addition as description and stages_id the other parameters:

bg: in the information you can see the image inserted in bg, in case it is not defined in Stage

development = True: when the quest is completed a text will be displayed explaining that this is the temporary end of the quest.

icon & category: have not been implemented yet.

define quests = {
    "alice"     :   Quest(id = "alice", title = _("Help [a]"), bg="bg alice terrace talk", 
    stages_id = ["talk alice1", "order products", "take products", "talk alice2"], 
    description = _("To learn more about how the repo works, Talk to [a]. \nGoing when she is there will automatically start an \"Event\" (see routine*.rpy to learn more). \nAfter that an action (action*.rpy) will be added to open the pc, in MC room. \n\n(during the quest you can talk to [a] and you will see her talking during the quests of the same Quest)")),

    "ann"       :   Quest(id = "ann", title = _("Help [an]"), stages_id = ["talk al about ann"], development = True),
}

To start a Quest:

quests["alice"].start()
quests["ann"].start()

Move on to the next Stage, only if the Stage has been completed

quests["alice"].next_stage()

To check which stage number a Quest has arrived at:

if (quests_levels["alice"] == 2):
    # ...
Stage

The Stage() class is the necle of the Quest system. It is mandatory to define idQuestOrTask: it is the id of the quest it belongs to, or it is the id of the Task (explained later). In addition as title, description, description_request and advice the other parameters:

bg: in the information you can see the image inserted in bg

goals = []: the Goals to be passed (explained later)

days_late: days_late must pass since we "reached" the stage to start it

bl_requests = []: the bl_values (explained later) must be set to True to start the quest

quests_levels_requests = {
    "quest id"  :   level,
}

quests_levels_requests: to start the stage: quests_levels[quest] < level

label_start: label which will be started at the beginning of the quest

label_end: label which will be started at the end of the stage

label_check: (has not been implemented yet)

define quest_stages = {
    # Quest "alice"
    "talk alice1"           :   Stage(idQuestOrTask = "alice", title = _("Talk [a]"), 
    description = _("Talk [a] on the terrace."), label_start="stagestart_talkalice"),
    "order products"        :   Stage(idQuestOrTask = "alice", title = _("Order products"), 
    description = _("Order the products with your PC.")),
    "take products"         :   Stage(idQuestOrTask = "alice", title = _("Take products"), 
    description = _("Take products on the Terrace."), 
    description_request = _("Wait for the products you ordered to arrive (2 day)"), 
    days_late = 2, label_start="add_product"),
    "talk alice2"           :   Stage(idQuestOrTask = "alice", title = _("Talk [a]"), description = _("Talk [a].")),
    # Quest "ann"
    "talk al about ann"     :   Stage(idQuestOrTask = "ann", title = _("Talk [a]"), description = _("Talk [a].")),
    "visit ann"             :   Stage(idQuestOrTask = "ann", title = _("Visit [an]"), 
    description = _("Go to the house of [an].")),
}
Task

(in process)

Goal

(in process)

Routine system

alt text

To skim the routines, simply compile df_routine and correctly add Commitment to sp_routine (the difference is explained later). The Commitment() class has the following parameters:

tm_start & tm_stop (required): start time & end time

chs={"alice" : TalkObject(bg_before_after="bg alice roomsleep", label_talk="talk_sleep")

chs = {} (mandatory): list of characters (with whom you can talk) participating in the routine,

id_location & id_room: Id della Location & Room

day_deadline: day on which it is deleted (only for sp_routine)

label_event: a scene that starts as soon as the MC is in that room at that time (only for sp_routine)

name & type: have not been implemented

For character icons you have to compile ch_icons.

Default routine
define df_routine = {
        "alice_sleep"       :   Commitment(chs={"alice" : TalkObject(bg_before_after="bg alice roomsleep", label_talk="talk_sleep")}, tm_start=20, tm_stop=10, id_location="house", id_room="alice_room"),
        "alice_lounge"      :   Commitment(chs={"alice" : TalkObject(bg_before_after=None, bg_talk=None)}, tm_start=10, tm_stop=14, id_location="house", id_room="lounge"),
        "alice_go_school"   :   Commitment(chs={"alice" : TalkObject(bg_before_after=None, bg_talk=None)}, tm_start=10, tm_stop=14, name="school", type="no_week"),
        "alice_read"        :   Commitment(chs={"alice" : TalkObject(bg_before_after="bg alice terrace", bg_talk="bg alice terrace talk")}, tm_start=14, tm_stop=20, id_location="house", id_room="terrace"),
    }

These are the fixed routines in case there are no sp_routines for NCP at the current time, then the NCP will have to perform df_routines. Do not have a deadline.

ATTENTION cannot be an event (a scene that starts as soon as the MC is in that room at that time), only sp_routines can be events.

Special routine
default sp_routine = {}

Initially it will be voting and during the game routines will be added to change the position of the characters.

They are added after completing missions or for some other reason.

If there is another commitment in the default routine at the same time, it will be "overwritten"

Clone this wiki locally