Sharing
Packages
A package is a folder of ready-made things for your game: scripts, new kinds of blocks, sounds,
models, animations and example levels. Open Window → Package Manager (or drop a package .zip
onto the editor) to add one.
Installing
| From | How |
|---|---|
| Ember's built-in packages | Package Manager → Ember packages → pick one → Install |
A folder or .zip on disk |
Add from... → choose it, or drag the .zip onto the editor window |
| A Git repository | Add from... → paste the URL (GitHub / GitLab; the archive of the default branch is downloaded) |
| An online registry | Online → paste the address of an index.json (format below) → Add → Refresh online packages |
Installing copies the package into <project>/assets/packages/<name>/, so its files are ordinary
project assets: you can open, edit and export them like your own. Dependencies are installed
automatically. If two packages need incompatible versions of the same dependency, nothing is
installed and the Package Manager says which ones disagree. Remove refuses while another
installed package still needs the one you are removing.
assets/packages.json records what is installed, which version and where it came from. Commit it
with your project.
What a package can contain
my-package/
package.json
scripts/ Lua. Usable with require("file_name") and as entity scripts
blocks/ *.json block definitions: new categories in the Blocks editor
models/ textures/ sounds/ anims/ scenes/
package.json
{
"name": "com.you.grappling-hook",
"display_name": "Grappling Hook",
"version": "1.2.0",
"description": "Swing from any surface.",
"author": "You",
"license": "MIT",
"category": "Gameplay",
"keywords": ["movement"],
"dependencies": { "com.ember.retro-sfx": "^1.0.0" }
}
Version ranges follow npm: 1.2.3 (exact), ^1.2 (same major), ~1.2.0 (same minor),
>=1.0, >1.0 <2.0, 1.x, *.
Making a package
Package Manager → Make a package turns a folder of your project into a .zip with a
package.json, ready to share. Anyone can install that zip with Add from....
Hosting a registry
A registry is a single index.json anywhere on the web (a GitHub Pages site works):
{
"packages": [
{
"name": "com.you.grappling-hook",
"display_name": "Grappling Hook",
"version": "1.2.0",
"description": "Swing from any surface.",
"category": "Gameplay",
"author": "You",
"license": "MIT",
"dependencies": {},
"url": "https://example.com/grappling-hook-1.2.0.zip"
}
]
}
url points at the package's .zip. List each version you want to offer as its own entry; the
Package Manager shows the newest and offers it as an update to projects with an older one.
Built-in packages
Day & Night, Weather, Minimap, Dialogue, Waypoints, Vehicle Physics, Save System, Leaderboard,
Retro Sound Effects, FPS Kit, Platformer Kit and Fun Blocks. They are generated by
tools/make_packages.py and tested by tools/test_packages.py.