Mods / [DEPRECATED]QP's Quests & Progression API (Pre-Release/Testing)

Category: #Utility
Author: QPTech
Side: Both
Created: Jan 16th at 8:56 PM
Last modified: Jan 16th at 9:39 PM
Downloads: 271
Follow Unfollow 15

Latest file for Various v1.19.x:
quests.zip 1-click install


I think I won't develop this any further, due to relative lack of interest and there are better mods out there.



Preview Release, intended for testing and comment for mod makers etc!


With this mod API you can easily add tech progression style quests to your mods, or easily make your own quest mods! Multiple quest lines can be added with item requirements and rewards. You can add custom icons and backgrounds to your questlines.

Note for this preview release I have added a few temporary quests - these quests are for demo purposes and will be removed when I do the full release!

Features
- easily add quests with just json (and optionally including your own graphics files)
- achievements - these quests are announced server wide when completed by each player
- multiple quest lines
- one or more items can be optionally required to complete a quest
- one or more items can be optionally rewarded
- admin tools for listing and resetting quests
- you can just add the appropriate files without requiring the mod, and if they QP's Quests installed they'll get the quests

Instructions press the \ key to open your quest book. Available quest lines will appear on the left, as well as a hand in quest button. Pressing the buttons for the quest lines will show the currently available tasks. Pressing the hand-in quest buttons will complete all quests you have the items for.

Admin Tools

Spoiler!
- these tools only accessible to people with the "gamemode" permission on the server
- run them from the chat window
- you can list or reset quests with the /quests command:
   - /quests list all- list every quest including relevant IDs and questline data
   - /quests list <playername> - lists all unlocked and completed quests for the given player
   - /quests reset <playername> all - resets the progress on all quests for the given player
   - /quests reset <playername> <quest id> - resets the progress for the given player and quest

Setting up your mod to support quests

Spoiler!

- (tried to use colored highlights here so you can hopefully see how the information is linked)
- you'll need to add at least two json files, plus add entries to your en.json file
questlines.json - place in assets/<yourmod/config/questlines.json - this file contains info for quest lines, or groups of quests
quests.json - place in assets/<yourmod/config/quests.json - this file contains all the info for the individual quests

Sample questline.json file: (contains a single quest line called demo, the game will expect the language file and any custom graphics to be in assets/mymod)
[
{"questlineid":"demo",
 "domain":"mymod"}
]

Sample quest.json file (shows two quests, note here that completing the "sticks" quest would unlock the "stones1" quest)

[{"id": "sticks",
"questline":"demo"
"domain": "mymod",
"requireall": true,
"requirements": [{"name":"game:stick","qty": 1}],
"rewards":[{"name":"game:stick","qty":4}],
"hidden": false,
"startunlocked": true,
"unlocks": ["stones1"],
"achievement": true
},
{"id": "stones1",
"domain": "mymod",
"questline":"demo",
"requireall": false,
"requirements": [{"name":"game:stone-andesite","qty": 2},{"name":"game:stone-chert","qty": 2},{"name":"game:stone-granite","qty": 2},{"name":"game:stone-basalt","qty": 2},{"name":"game:stone-obsidian","qty": 2},{"name":"game:stone-peridotite","qty": 2},{"name":"game:flint","qty": 2}],
"rewards":[],
"hidden": false,
"startunlocked": false,
"unlocks": ["knifeknap"],
"achievement": false
},]

Sample entries to the en.json file, which for this set would be in assets/mymod/lang/en.json
"questlinetitle-demo": "My Demo Quests",
"questtitle-sticks": "Getting Sticky",
"questtext-sticks": "Now bear with me (hopefully there's no bears right now), go and grab yourself a <strong>stick</strong> either off the ground or by breaking a branchy leaf.",
"questtitle-stones1": "Banging Two Stones Together",
"questtext-stones1": "There's stones and then there's stones. Some are hard enough to work with. Find <strong>two stones both of the same type that are hard enough to knap with</strong>",

Setting up your own quests reference

Spoiler!

questline.json
properties:
- questlineid
- this is the ID code for your quest line (a quest line is just a group of quests) - this should be unique across all mods generally speaking, although you could use it to try and group with quests from other  mods, it oculd cause problems. I would recommend adding some numbers or something to the end of your questlineid to keep it separate from other quests. Eg instead of just "main" do like "main-mymodname". I'll see if I can come up with a better solution in the future. Note for IDs you don't need to make it readable, the nice human readable text will be from your language file!
- domain - this is basically what folders under assets your info is, for example for "mymodname" you might have assets/mymodname/lang/en.json this is what tells the program to look in the mymodname folder to find the language file. Also used if you specify custom graphics etc
icon (optional) - this is the filename of the 64x64 icon you want to be used in the quest list. it should be in assets/<domain>/textures For example if you have an icon file /assets/mymodname/textures/pig.png then just put pig here (and the domain would then be mymodname!)
- background (optional) - this is the filename of a .png file that will appear in the background of the list of quests for the questline

quests.json properties:
id - this id must be unique across all quests including those in other mods! So I would recommend adding extra info eg instead of "start" use "start-mymodname" - note for IDs you don't need to make it readable, the nice human readable text will be from your language file!
- domain - this is basically what folders under assets your info is, for example for "mymodname" you might have assets/mymodname/lang/en.json this is what tells the program to look in the mymodname folder to find the language file. Also used if you specify custom graphics etc
icon (optional) - this is the filename of the 64x64 icon you want to be used in the quest list. it should be in assets/<domain>/textures For example if you have an icon file /assets/mymodname/textures/pig.png then just put pig here (and the domain would then be mymodname!)
requirements (optional) - this is a list of items that need to be in player inventory to complete the quest
   - eg: [{"name":"game:stone-andesite","qty": 2}] - this requires the player have two andesite stone in their inventory. You can also use pattern matching eg: [{"name":"game:stone-*","qty": 2}] - this would require 2 of any (of the same) stone.
   - multiple requirements: [{"name":"game:stone-andesite","qty": 2},{"name":"game:stone-chert","qty": 2}] - requires 2 andesite and 2 chert stones
requireall (optional) - true/false - defaults to true - if you set htis to false and have multiple requirements, then the player will only need one of the requirements to pass, so for example if you had [{"name":"game:stone-andesite","qty": 2},{"name":"game:stone-chert","qty": 2}] as requirements and this is set to false, then you'd only need either 2 andesites stones or 2 chert stones to complete the quest
rewards (optional) - same format as requirements, however the player will receive the items (they'll be dropped beside the player)
  eg: [{"name":"game:stone-andesite","qty": 2}]  player woudl receive 2 andesite stones for completing the quest
- startunlocked : true/false, defaults to false - whether the player should see this quest right from the start. If it's false it would have to be unlocked by finishing another quest
unlocks (optional) - a list of other quest ids that are unlocked by completing this quest
  eg: "unlocks": ["knifeknap","sticks"] - completing this quest would unlock the knifeknap and sticks quests
achievement (true/false defaults to false) - whether this quest is an acheivement - an achievement is just a quest that announces competion to the whole server instead of just the player

en.json - you add the readable text to your en.json (and to any other language files you want to support) This must be the language file located in the appropriate doman
questtitle-<id> - this is the name of the quest <id> eg: "questtitle-sticks": "Getting Sticky" - would make the quest id "sticks" show up as "Getting Sticky"
questtext-<id> - this is the description of the quest, including any rewards or other information you want the player to have:
  eg: "questtext-sticks": "Now bear with me (hopefully there's no bears right now), go and grab yourself a <strong>stick</strong> either off the ground or by breaking a branchy leaf." - note the <strong> tag around the word stick - this would make that word bold. You can also use other VTML formatting, including links to items in the handbook etc.
questlinetitle-<questlineid> - this is the name of the Quest Line.
 eg: "questlinetitle-winter": "Winter is Coming" - This would set the quest line "winter" to have the name "Winter is Coming"

Version For Game version Downloads Release date Changelog Download 1-click mod install*
v1.0.0-pre.1 271 Jan 16th at 9:39 PM Show quests.zip Install now

3 Comments (oldest first | newest first)

💬 QPTechAuthor, Jan 23rd at 2:10 PM

DrinkedPB what is the crash, maybe go on the discord and i'll see what i can do.

💬 DrinkedPB, Jan 20th at 2:35 PM
💬 rampedindent, Jan 18th at 2:02 PM

This is really cool, I look forward to what people can do with this

(edit comment delete)