Modding

From Sandboxels Wiki
Jump to navigation Jump to search

Modding allows players to change various aspects of Sandboxels, including the creation or changing of elements.

This tutorial will get you started with making mods using JavaScript. Coding experience isn't required, but it is extremely beneficial.

Chapters

Follow a chapter below to get started on modding.

Getting Started

This chapter is highly recommended for beginners.

Topics discussed:

  • Required software
  • Installing Sandboxels locally
  • Creating your mod
  • Testing your mod
  • Troubleshooting

Basics

Topics discussed:

  • Creating your first element
  • Assigning properties
  • Categories (Existing and new)
  • Changing and removing existing elements

Basic Behaviors

Topics discussed:

  • Assigning custom behaviors to elements
  • Behavior grids and cells
  • Behavior presets

Element Properties

Topics discussed:

  • Basic and advanced properties of elements

Tick Functions

Topics discussed:

  • Custom behaviors using raw JavaScript (tick property)
  • Basic pixel properties
  • Global tick functions (runPerPixel, runEveryTick)
  • Element events (onPlace, onDelete, etc.)

Tools

Topics discussed:

  • Custom tools (Useable on pixels)

Reactions

Topics discussed:

  • Custom reactions between different elements
  • Reactions for new elements
  • Reactions for existing elements
  • Reaction properties
  • Removing existing reactions

Rendering

Topics discussed:

  • Custom element renderers (renderer property)
  • Custom global renderers (renderEachPixel, renderPrePixel, renderPostPixel)
  • Custom view modes
  • Custom canvas layers
  • Proper function overriding (i.e. drawPixels)

Dependency

Topics discussed:

  • Running code when other mods are enabled
  • Loading other mods automatically

Example

Topics discussed:

  • Full example mod

Putting it online

Topics discussed:

  • Publishing your mod to the GitHub
  • Externally-hosted mods (https://…)