Skip to content

Research Tasks

Xander Forrest edited this page Jul 12, 2024 · 5 revisions

Research Tasks is a quest driven, server sided mod for Cobblemon

Driving player engagement by adding permanent "Assignments" players can complete for rewards, along with daily and weekly tasks randomly selected from a pool with reward weights.

Permanent Assignments

When players open the Research Tasks main menu, they're presented with three options: assignments, weekly tasks, and daily tasks.

Assignments are defined in the assignments folder, found in

/config/ResearchTasks/Assignments/

Assignments are a top level holder of "Research Tasks", which further hold "Objectives" (aka Quests). Assignments can have names, custom items, descriptions, and rewards. Assignments can be linear, meaning Research Tasks must be completed in the order they're defined, or can be completed in any order.

Assignments are configured using JSON. Creating a new assignment is as simple as creating a JSON file with a few required fields:

{
  "id": "grasstypeguys",
  "tasks": []
}

The "id" field is how player progress is stored. This field must be unique, and changing it will result in all players losing their progress (til it's changed back).

This assignment is looking pretty bare, so we can add some settings to make the GUI button look nicer.

  "id": "grasstypeguys",
  "name": "<green><bold>Grass Type Guys",
  "description": "<green>We need your help researching these Grass Type Pokemon!",
  "item": "minecraft:grass_block",
  "tasks": []

Name & description both support the MiniMessage format. The "item" key can take either an item ID directly as seen above, or an object with more information, similar to GGyms & PPokedex's Item Support.

  "item": {
    "id": "minecraft:popped_chorus_fruit",
    "CustomModelData": 17
  }

Moving on from aesthetics, Assignments have a "linear" key which can be true/false, which commands whether Research Tasks need to be completed in order. Assignments can also have rewards, defined in the same fashion as with PPokedex.

  "id": "grasstypeguys",
  "name": "<green><bold>Grass Type Guys",
  "description": "<green>We need your help researching these Grass Type Pokemon!",
  "item": "minecraft:grass_block",
  "linear": true,
  "rewards": [
    {
      "type": "command",
      "value": "give {player} minecraft:oak_sapling",
      "display": "<green>1x Oak Sapling"
    }
  ],
  "tasks": []

With command rewards, just about everything can be done. The reward's display field is shown in the Assignment GUI button. When a player has completed all of an Assignment's tasks, they can click the GUI button to claim their rewards.

Time to add a task. The format is identical to assignments, except with "objectives" instead of "tasks" as their children.

    {
      "name": "Mushrooms and Lettuce",
      "id": "mushroomsandlettuce",
      "item": "minecraft:mushroom_stew",
      "objectives": [
        {
          "type": "CatchPokemonQuest",
          "name": "Shroom Picking",
          "id": "shroompicking",
          "pokeMatch": {
            "species": "cobblemon:shroomish",
            "form": "any"
          },
          "taskMessage": "Catch 3x Shroomish",
          "amount": 3
        },
        {
          "type": "CatchPokemonQuest",
          "name": "Picking Lettuce",
          "id": "pickinglettuce",
          "pokeMatch": {
            "species": "cobblemon:bulbasaur",
            "form": "any"
          },
          "taskMessage": "Catch 3x Bulbasaur",
          "amount": 3
        }
      ]
    }

Here we have the "Mushrooms and Lettuce" Research Task. We define a unique ID, along with display settings (item/name). It can also support descriptions & linear settings.

Objectives

Objectives, defined in a list under the "objectives" keys, are the things that players actually work to complete. They use our Quest system, which is on the Rib side, meaning any Rib update adding a new Quest lets you use them in RT without updating. More mod specific Quests (i.e., GGyms, PokeSell) will be added soon.

You can learn more about the various Quest types and their formats in their Wiki section: Quests. Like Assignments and Tasks, Objectives can also hold rewards.

Objective Preview

Custom GUIs

All GUI pages are fully customisable. Custom GUIs can also be created for specific assignments, meaning no more ugly empty element spaces.

{
  "id": "assignments",
  "gui_type": "G9X5",
  "gui": [
    "#########",
    "#########",
    "##X#X#X##",
    "#########",
    "#########"
  ],
  "keys": {
    "#": "defaultFillItem",
    "X": "defaultElementFillItem"
  }
}

The Assignments menu, opened with /researchtasks, comes with this config by default. GUIs can be any abstract size (3x5 -> 9x5) and can have any custom items, meaning full resource pack GUIs can be made without any code.

The "keys" section defines what items should be placed on the GUI. Items can either be defined in this file, or can be defined in a global "GUI Items" file, as they are by default.

{
  "defaultFillItem": {
    "id": "minecraft:black_stained_glass_pane",
    "name": ""
  },
  "defaultElementFillItem": {
    "id": "minecraft:gray_stained_glass_pane",
    "name": ""
  }
}

Keys & items are passed into GUIs in the code. In the Assignments menu, all loaded Assignments are passed in and will replace the "X" key. If there aren't enough items to fill the space, the default provided in the config is placed instead. In this case, that'd be Gray Stained Glass Panes.

Research Tasks menu

Clone this wiki locally