TeamMonumenta / scripted-quests

JSON-driven Minecraft Spigot plugin for creating quests
GNU Affero General Public License v3.0
9 stars 3 forks source link

Scripted Quests

JSON-driven Minecraft Paper plugin for creating quests

Table of Contents

Description

This plugin is a Minecraft game developer's toolbox, greatly expanding and simplifies what you can do with minecraft commands.

The idea is to be able to create complex mechanisms without having to write any plugin code. With ScriptedQuests, you can build things like quest interactions between players and NPCs (and much more) by creating configuration files with the provided web editor.

Highlighted features:

This plugin was developed for use with Monumenta, a Minecraft Complete-The-Monument MMORPG server. It has proven to be perhaps the most generally valuable & reusable tool we have built over several years, and we hope others will find it useful too.

Download

ScriptedQuests works on Paper 1.18.2 or higher. It also requires CommandAPI version 6.x. Other CommandAPI versions may also work, worth giving it a shot. It'll be immediately obvious as if the version is incompatible, the plugin won't load or no commands will work.

You can download ScriptedQuests from GitHub Packages. This is automatically updated every time new changes are made. Click on the com.scriptedquests... link, and download the .jar file from the "Assets" category on the right side of the page.

Sample

Here is an example of interacting with a villager named Aimee: Example quest interaction

Quests are made up of two-way dialog - the NPC can "talk" to the player, and the player can reply by clicking one of the available options in chat. At each stage in the process arbitrary actions can occur, such as setting scoreboard values, running commands/functions, sending more dialog, etc.

The quest compass is just a simple mapping between scoreboard values and locations. For example, if you have score Quest01 = 1, left clicking with an ordinary compass will make it point to some coordinates. For example:

Example quest compass

Additonally, the compass will point to locations where you have died since the server last restarted, and tells you how long ago those deaths were.

You can also create quests that involve the player dying in-game. These "death" quest elements can trigger actions when the player dies if they meet specific pre-requisites. This can involve keeping the player's inventory, respawning at a different location than normal, etc.

Getting Started / Tutorial

This plugin requires Paper 1.18.2+.

Creating Quests with the Online Editor

Creating these by hand is a pain - use the web editor! The web editor not only helps you structure things correctly but is also the primary documentation for the various quest options

Structure of a Quests File:

Each quest file has the following info:

Quest components contain optional pre-requisites and actions. If the pre-requisites are met, the actions are run. Every time a player interacts with an NPC, quest components are run in-order (more than one may be executed).

List of Commands / Permissions

Player commands

/clickable <label>

/interactNpc <npcName> [EntityType] /interactNpc <npc>

/leaderboard <@a> <objective> <descending> <page>

/monumenta music play <now or next> <players> <music path> <duration in seconds> [<is loop, default false>] [<music category, default record>] [<volume>] [<pitch>] /monumenta music cancel <now or next> <players>

/questTrigger

/race leaderboard <players> <raceLabel> <page>

/line <from> <to> <block>

/generatecode <@a> "<seed>"

/execute store result score <scoreboardplayer> <objective> run getdate <field>

/giveloottable <@a> "<namespace:path/to/table>" [count]

/haspermission <@a> <permission.node>

/execute store result score <scoreboardplayer> <objective> run randomnumber <min> <max>

/random sample <entities> <objective> <min> <max>

/race start <players> <raceLabel>

/race stop <players>

/race win <players>

/reloadQuests

/clock ~ ~ ~ always <period> [repeater] /clock ~ ~ ~ player <period> [repeater] /clock ~ ~ ~ range <range> <period> [repeater]

/schedule function <namespace:path/to/function> <ticks>

/setvelocity <@e> <x> <y> <z>

/testzone <x> <y> <z> <namespaceName> [propertyName]

/debugzones <player> /debugzones <position>

/showzones hide /showzones show <namespaceName> [propertyName]

/timerdebug <enabledOnly>

By default, prerequisites are and'ed together - all must be true.

actions:

Maven dependency

<repository>
    <id>monumenta</id>
    <name>Monumenta Maven Repo</name>
    <url>https://maven.playmonumenta.com/releases</url>
</repository>
<dependencies>
    <dependency>
        <groupId>com.playmonumenta</groupId>
        <artifactId>scripted-quests</artifactId>
        <version>7.0</version>
        <scope>provided</scope>
    </dependency>
</dependencies>

Gradle (kotlin):

maven {
    name = "monumenta"
    url = uri("https://maven.playmonumenta.com/releases")
}

dependencies {
    compileOnly("com.playmonumenta:scripted-quests:7.0")
}

Gradle (groovy):

maven {
    name "monumenta"
    url "https://maven.playmonumenta.com/releases"
}

dependencies {
    compileOnly "com.playmonumenta:scripted-quests:7.0"
}