diff options
author | Bottinator22 <59987380+Bottinator22@users.noreply.github.com> | 2025-02-08 13:11:12 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-02-08 13:11:12 -0800 |
commit | 1002ca3255ffa04c5382d7097c44b7b8ab4cd58a (patch) | |
tree | be61a28889b09aa1b85b17760dea2feecebd1a2b /doc | |
parent | a3cdca7317f58c32831c2139acc36fcbcfa885d0 (diff) |
move root binding docs to their own file
Diffstat (limited to 'doc')
-rw-r--r-- | doc/lua/openstarbound/root.md | 104 |
1 files changed, 104 insertions, 0 deletions
diff --git a/doc/lua/openstarbound/root.md b/doc/lua/openstarbound/root.md new file mode 100644 index 0000000..c439c59 --- /dev/null +++ b/doc/lua/openstarbound/root.md @@ -0,0 +1,104 @@ + +# Root + +The root table now contains extra asset bindings and bindings to return the tile variant that is used for material and matmods at any position. + +--- + +#### `String[]` root.assetsByExtension(`String` extension) + +Returns an array containing all assets with the specified file extension. + +By the way, here's a list of every file extension the game does Special Things™ for when loading assets. + +<details><summary><b>File Extensions</b></summary> + +- Items: `item`, `liqitem`, `matitem`, `miningtool`, `flashlight`, `wiretool`, `beamaxe`, `tillingtool`, `painttool`, `harvestingtool`, `head`, `chest`, `legs`, `back`, `currency`, `consumable`, `blueprint`, `inspectiontool`, `instrument`, `thrownitem`, `unlock`, `activeitem`, `augment` +- Materials: `material`, `matmod` +- Liquids: `liquid` +- NPCs: `npctype` +- Tenants: `tenant` +- Objects: `object` +- Vehicles: `vehicle` +- Monsters: `monstertype`, `monsterpart`, `monsterskill`, `monstercolors` +- Plants: `modularstem`, `modularfoliage`, `grass`, `bush` +- Projectiles: `projectile` +- Particles: `particle` +- Name Gen: `namesource` +- AI Missions: `aimission` +- Quests: `questtemplate` +- Radio Messages: `radiomessages` +- Spawn Types: `spawntypes` +- Species: `species` +- Stagehand: `stagehand` +- Behaviors: `nodes`, `behavior` +- Biomes: `biome`, `weather` +- Terrain: `terrain` +- Treasure: `treasurepools`, `treasurechests` +- Codex Entries: `codex` +- Collections: `collection` +- Statistics: `event`, `achievement` +- Status Effects: `statuseffect` +- Functions: `functions`, `2functions`, `configfunctions` +- Tech: `tech` +- Damage: `damage` +- Dances: `dance` +- Effect Sources: `effectsource` +- Command Macros: `macros` +- Recipes: `recipe` +</details> + +#### `String` root.assetData(`String` path) + +Returns the raw data of an asset. + +#### `String, Maybe<LuaTable>` root.assetOrigin(`String` path, [`bool` getPatches]) + +Returns the asset source path of an asset, or nil if the asset doesn't exist. If you specify getPatches as true then also returns the patches for the asset as an array, each element containing the source path and patch path in indexes 1 and 2 respectively. + +#### `LuaTable` root.assetSourcePaths([`bool` withMetadata]) + +Without metadata: Returns an array with all the asset source paths. +With metadata: Returns a table, key/value being source path/metadata. + +#### `Image` root.assetImage(`String` image) + +Returns an image. + +#### `Json` root.assetFrames(`String` imagePath) + +Returns an array containing a `file` (the frames file used for the image) and `frames` (the frame data of the image). + +#### `JsonArray` root.assetPatches(`String` asset) + +Returns a list of asset sources which patch the specified asset and the paths to those patches. + +--- + +#### `Json` root.getConfiguration(`String` key) + +Gets a configuration value in `/storage/starbound.config`. + +#### `Json` root.getConfigurationPath(`String` path) + +Gets a configuration value in `/storage/starbound.config` by path. + +*Both getters will error if you try to get `title`, as that can contain the player's saved server login.* + +#### `Json` root.setConfiguration(`String` key, `Json` value) + +Sets a configuration value in `/storage/starbound.config`. + +#### `Json` root.setConfigurationPath(`String` path, `Json` value) + +Sets a configuration value in `/storage/starbound.config` by path. + +*Both setters will error if you try to set `safeScripts`, as that can break Starbound's sandbox.* + +--- + +#### `JsonArray` root.allRecipes() + +Returns all recipes. + +--- |