Skip to main content

Automatic region generation

RPGRegions can automatically generate a discoverable region from your integration, or a structure plugin. For example, a user creates a land using the Lands plugin, and at 10 chunks an area to discover is automatically created.

Or, a structure is randomly generated in the world by a plugin, which RPGRegions can then apply a region to.

Supported plugins

  • Lands
  • CustomStructures
info

At this time, only Lands and CustomStructures are supported. Please ask if you want support for another plugin.

Configuring generation

Configurations for all integrations can be found in plugins/RPGRegions/integrations. Open up the file for the integration you want to configure.

Lands

This is the lands.yml file:

# This is the file for editing the Lands integration.
# Should we automatically generate regions based on lands created?
auto-generate: true

# What is the minimum size in chunks of a land to automatically generate a region?
min-land-size: 10

# This is a group of template definitions. Templates are defined in plugins/RPGRegions/templates.
# You can use /rpgre to export a template region.
# The name of the file should be put here. The template will then be used to automatically generate a region.
templates:
10: # At >= 10 land size
template: "land_template_10.json"
20: # At >= 20 land size
template: "land_template_20.json"

When a land reaches a size of 10 chunks or more, it shall use the land_template_10 template region file.

Make sure that the min-land-size setting is set to the same as the minimum size in the templates list.

Custom Structures

This is the custom-structures.yml file:

# This is the file for additional support for the CustomStructures plugin.

# Should we automatically generate regions based on structures created?
auto-generate: true

# This is a group of template definitions. Templates are defined in plugins/RPGRegions/templates.
# You can use /rpgre to export a template region.
# The name of the file should be put here. The template will then be used to automatically generate a region.
templates:
demo: # For the "demo" structure...
template: "custom_structures_template_demo.json"
commands:
# You must specify a list of commands that create a valid region in your current integration
# {id} is replaced with the generated region id, e.g "demo_<random uuid>" and {world} with the world it was in
# {minX} {maxX}, etc. is the generated min/max positions of the structure.
- "rpgri create {id} cuboid {world}"
- "rpgri addpos {id} {world} {minX} {minY} {minZ}"
- "rpgri addpos {id} {world} {maxX} {maxY} {maxZ}"

The default demo configuration specifies the region template custom_structures_template_demo to generate a region from.

It then specifies a list of commands that execute on the console to create the region when the structure is generated.

List of valid placeholders:

PlaceholderDescription
{id}The randomly generated ID of the region
{world}The name of the world
{minX}The minimum x boundary of the region
{minY}The minimum y boundary of the region
{minZ}The minimum z boundary of the region
{maxX}The maximum x boundary of the region
{maxY}The maximum y boundary of the region
{maxZ}The maximum z boundary of the region
info

If you are not using the in-built RPGRegions integration, you will have to change the commands to use whatever integration you are using.

Generating templates

Exporting templates is easy. You will use the /rpgre command for this.

First, create a region anywhere of your choice using your integration plugin, then add it to RPGRegions using /rpgr add <region>.

You can then edit this region to contain requirements, rewards, etc., whatever you want!

Once you are happy with your region, export it using /rpgre export <region>.

These files are saved in the plugins/RPGRegions/templates folder. You can rename them.