Skip to content

Quests ~ CLI Display

elizabethli31 edited this page Jun 2, 2022 · 6 revisions

Quests are currently formatted where each player can have multiple quests, and each quest has a task tree associated with it. We worked with the CLI and Action Management teams to have quests, task trees, and tasks displayable through the command line. Once the game starts running, the player can type view quests which will display all the quests that the player currently holds.

Quest: Find Steve, Status: Completed
Quest: Vanquish Steve, Status: Started

The player can then type in view quest [quest id] which would allow them to look at the task tree that the quest hold. Typing in view quest "Find Steve" will show the tasks it has. As the player accomplishes tasks, the statuses will update accordingly. Once the player choose one path, the other branch of the tree will be entirely set to inactive.

     --------------------------------------------------                                                                                                                                            
    |                                                 |                                                                                                                                           
    Talk to Ground Scout                              Talk to Sea Scout                                                                                                                           
    Status: Completed!                                Status: Inactive                                                                                                                         
                                                                                                                                                                                             
    |                                                 |                                                                                                                                           
     -------------------------                         -------------------------                                                                                                                   
    |                        |                        |                        |
    Enter Steve's Lair       Talk to Steve's Mom      Obtain the Pirates' Ma   Interrogate the Pirate
    Status: Completed!       Status: Inactive         p                         Captain
                                                      Status: Inactive         Status: Inactive

If the player wanted to look at the specifics regarding a task, they can type in view task [task id] which will display information about the status, mission, and prerequisites. As an example, the player types in view task "Talk to Ground Scout" and sees this:

TASK: talk to ground scout
    Status: Incomplete
    Mission: Meet NPC (ground scout)
    Rewards: 100 xp and search warrant
    Prerequisites: 0 hp and 0 level
    Prerequisite Tasks:
    Prerequisite Quests:

Action management and CLI helped us actually implement these features into the command line, and we provided them with the following functions to store what we wanted to have printed.

/* Function for cli that will put all quests the player has in a string
 *
 * Parameters:
 * - player: the player of the game
 *
 * Returns:
 * - a string of all the quests a player has
 */
char* show_quests(player_t *player);

/* Function for cli that will display the task tree associated with a quest
 *
 * Parameters:
 * - quest_id: the quest holding the task tree
 * - player: the player of the game
 * - all_quests: all of the quests in the game
 *
 * Returns:
 * - a string of the task tree
 */
char* show_task_tree(char* quest_id, player_t *player, quest_hash_t *all_quests);

/* Function for cli that will display the info of a task
 *
 * Parameters:
 * - task_id: the task that will be displayed
 * - player: the player of the game
 * - all_quests: all of the quests in the game
 *
 * Returns:
 * - a string of the task elements
 */
char* show_task(char* task_id, player_t *player, quest_hash_t *all_quests);

Future Issues

  • We also worked with GUI this quarter, and they created a graphical display of task trees. It would be cool to have this triggered through the command line
  • Have different modes for the player to choose what exactly they want displayed. For example, if the player only wants to see the particular mission with the task, we should have the functionality to provide that
Clone this wiki locally