shippedplugin
Loads the plugins a game ships in its own folder.
Putting it in a scene
The engine loads a scene's plugins from the top-level plugins folder alone. A plugin that belongs to one game, such as its level, lives in that game's own folder as plugins/<name>/<name>.plugin.ts and exports a function of its name, which is called once as the engine calls any plugin. List shipped in the scene's plugins and name the game's plugins in world.shipped:
"plugins": ["loader", "shipped", "render3d"],
"world": {
"shipped": { "plugins": ["level"] }
}
Properties
Read from world.shipped, off the scene, since this plugin has no row.
.plugins : string[] = []
The names of the game's plugins, in the order they are imported and ticked. Each is found at plugins/<name>/<name>.plugin.ts under the page's own folder, and must export a function of that name. A name that a top-level plugin in the scene's plugins already has is refused.
What it does
On its first tick shipped imports every listed plugin, in order, and puts each on plugins.<name>. An actor or a plugin that ticks after shipped uses a game's plugin as it uses any other, and the game's plugins tick in that same frame. Every tick and afterTick of theirs runs at shipped's place in the scene's plugins, in the order of world.shipped.plugins. A plugin that depends on a game's plugin is listed after shipped. When the scene closes, close is called on them in the reverse order.
A game's plugin has a server half like any plugin, which the game's sim files import as they import any plugin's.
Mods
A game's plugin reaches another plugin, and is reached, through a mod as a top-level plugin is. The names in world.shipped.plugins are how a mod of a game's plugin is found: it is in the game's folder, beside the plugin. The order of that list is the order they tick in.