diff --git a/.github/workflows/mkdocs.yml b/.github/workflows/mkdocs.yml index 5a9536ac..4d1cfef2 100644 --- a/.github/workflows/mkdocs.yml +++ b/.github/workflows/mkdocs.yml @@ -26,7 +26,7 @@ jobs: uses: actions/cache@v1 with: path: ~/.local/share/virtualenvs - key: ${{ runner.os }}-venv-${{ hashFiles('**/Pipfile.lock') }} + key: ${{ runner.os }}-pipenv-${{ hashFiles('**/Pipfile.lock') }} - name: Install dependencies if: steps.cache-dependencies.outputs.cache-hit != 'true' diff --git a/.gitignore b/.gitignore index df624487..c0830248 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ site/ -mkdocs/ \ No newline at end of file +mkdocs/ diff --git a/docs/CNAME b/docs/CNAME index e69de29b..52a8a6e5 100644 --- a/docs/CNAME +++ b/docs/CNAME @@ -0,0 +1 @@ +api.tabletopsimulator.com diff --git a/docs/atom.md b/docs/atom.md index 4aa65307..6e0f7a6d 100644 --- a/docs/atom.md +++ b/docs/atom.md @@ -89,8 +89,8 @@ The plugin will automatically check for updates when Atom is started. If a new u These are just a few basic tips to help get the most out of Atom. * Print Messages - * All print() functions automatically send their messages to Atom's console (ctrl + alt + i). + * All print() functions automatically send their messages to Atom's console (ctrl + shift + i). * Error Messages - * All Lua errors are automatically sent to Atom's console (ctrl + alt + i). + * All Lua errors are automatically sent to Atom's console (ctrl + shift + i). * Quick Save + Play * Hitting Ctrl + Shift + S will trigger Save & Play. diff --git a/docs/base.md b/docs/base.md index fa65660b..4e37871b 100644 --- a/docs/base.md +++ b/docs/base.md @@ -18,7 +18,7 @@ getObjectFromGUID([](types.md) guid) | Returns group([](types.md) objects) | Groups objects together, like how the `G` key does for players. | [](types.md) | [](#group) paste([](types.md) parameters) | Pastes Objects in-game that were copied to the in-game clipboard. Works with [copy(...)](#copy). | [](types.md) | [](#paste) setLookingForPlayers([](types.md) lfp) | Enables/disables looking for group. This is visible in the server browsers, indicating if you are recruiting for a game. | [](types.md) | -spawnObject([](types.md) parameters) | Spawns an Object. View the [Spawnable Object](spawnableobjects.md) page for Objects that can be spawned. | [](types.md) | [](#spawnobject) +spawnObject([](types.md) parameters) | Spawns an Object. See [Built-in](built-in-object.md) and [Custom](custom-game-objects.md) Spawnable Object pages for further details. | [](types.md) | [](#spawnobject) spawnObjectJSON([](types.md) parameters) | Spawns an Object using a JSON string. Works with [getJSON()](object.md#getjson). | [](types.md) | [](#spawnobjectjson) startLuaCoroutine([](types.md) function_owner, [](types.md) function_name) | Start a coroutine. | [](types.md) | [](#startluacoroutine) stringColorToRGB([](types.md) player_color) | Converts a [Player Color](player-color.md) string into a Color Table for tinting. | [](types.md#color) | [](#stringcolortorgb) @@ -130,7 +130,7 @@ end ####spawnObject(...) -[](types.md) Spawn an Object. View the [Spawnable Objects](spawnableobjects.md) page for Objects that can be spawned. +[](types.md) Spawns an Object. See [Built-in](built-in-object.md) and [Custom](custom-game-objects.md) Spawnable Objects pages for details of specific spawnable objects. If you are spawning a **custom Object**, you should call [setCustomObject](object.md#setcustomobject) immediately after spawnObject to set its custom properties. @@ -139,7 +139,7 @@ If you are spawning a **custom Object**, you should call [setCustomObject](objec !!!info "spawnObject(parameters)" * [](types.md) **parameters**: A Table of parameters used to determine how spawnObject will act. - * [](types.md) **parameters.type**: [Spawnable Object](spawnableobjects.md) type. + * [](types.md) **parameters.type**: [Built-in](built-in-object.md) or [Custom](custom-game-objects.md) Game Object name. * [](types.md#vector) **parameters.position**: Position to place Object. * {>>Optional, defaults to {x=0, y=3, z=0}.<<} * [](types.md#vector) **parameters.rotation**: Rotation of the Object. @@ -197,10 +197,6 @@ Spawns an Object using a JSON string. Works with [getJSON()](object.md#getjson). * {>>Optional, defaults to JSON's value.<<} * [](types.md#vector) **parameters.scale**: Scale of the Object. * {>>Optional, defaults to JSON's value.<<} - * [](types.md) **parameters.sound**: If the spawned Object noise is played. - * {>>Optional, defaults to JSON's value.<<} - * [](types.md) **parameters.snap_to_grid**: If snap-to-grid is active on the Object. - * {>>Optional, defaults to JSON's value.<<} * [](types.md#function) **parameters.callback_function**: The function to activate after the Object has finished spawning into the scene. * {>>Optional, defaults to not being used.<<} * {>>A reference to the object spawned is always passed to callback_function. See the example for how to access it.<<} diff --git a/docs/built-in-object.md b/docs/built-in-object.md index 98c6b0e1..47588799 100644 --- a/docs/built-in-object.md +++ b/docs/built-in-object.md @@ -1,154 +1,353 @@ -Objects can be spawned by any script using the [spawnObject()](base.md#spawnobject) function. These are the `type` Strings used to designate the type of Object to spawn. - - -##Boards - -* backgammon_board -* CardBot_Board -* Checker_Board -* Chess_Board -* Chinese_Checkers_Board -* Go_Board -* Pachisi_Board -* reversi_board - -##Containers - -* Bag -* Bowl -* Cup -* go_game_bowl_black -* go_game_bowl_white -* Infinite_Bag - -##Figurines - -* Figurine_Card_Bot -* Figurine_Kimi_Kat -* Figurine_Knil -* Figurine_Mara -* Figurine_Sir_Loin -* Figurine_Zeke -* Figurine_Zomblor - -##Game Pieces - -* backgammon_piece_brown -* backgammon_piece_white -* BlockRectangle -* BlockSquare -* BlockTriangle -* Card -* Checker_black -* Checker_red -* Checker_white -* Chess_Bishop -* Chess_King -* Chess_Knight -* Chess_Pawn -* Chess_Queen -* Chess_Rook -* Chinese_Checkers_Piece -* Chip_10 -* Chip_50 -* Chip_100 -* Chip_500 -* Chip_1000 -* Deck -* Die_4 -* Die_6 -* Die_6_Rounded -* Die_8 -* Die_10 -* Die_12 -* Die_20 -* Die_Piecepack -* Domino -* go_game_piece_black -* go_game_piece_white -* Mahjong_Coin -* Mahjong_Stick -* Mahjong_Tile -* Metal Ball -* PiecePack_Arms -* PiecePack_Crowns -* PiecePack_Moons -* PiecePack_Suns -* PlayerPawn -* Quarter -* reversi_chip - -##RPG Figurines - -* rpg_BARGHEST -* rpg_BASILISK -* rpg_BEAR -* rpg_BLACK_DRAGON -* rpg_CENTAUR -* rpg_CERBERUS -* rpg_CHIMERA -* rpg_CRASC -* rpg_CYCLOP -* rpg_DARKNESS_WARLORD -* rpg_DRAGONIDE -* rpg_EVIL_WATCHER -* rpg_GHOUL -* rpg_GIANT_VIPER -* rpg_GOBLIN -* rpg_GOLEM -* rpg_GRIFFON -* rpg_HYDRA -* rpg_KNIGHT -* rpg_KOBOLD -* rpg_LIZARD_WARRIOR -* rpg_MAGE -* rpg_MANTICORA -* rpg_MUMMY -* rpg_OGRE -* rpg_ORC -* rpg_RANGER -* rpg_RAT -* rpg_SKELETON_KNIGHT -* rpg_TEMPLATE -* rpg_THIEF -* rpg_TREE_ENT -* rpg_TROLL -* rpg_VAMPIRE -* rpg_WARRIOR -* rpg_WEREWOLF -* rpg_WYVERN - -##Tilesets - -* Tileset_Barrel -* Tileset_Chair -* Tileset_Chest -* Tileset_Corner -* Tileset_Floor -* Tileset_Rock -* Tileset_Table -* Tileset_Tree -* Tileset_Wall - -##Tools - -* Calculator -* Counter -* Digital_Clock -* Notecard -* Tablet - -##Triggers - -* ScriptingTrigger - * A Scripting Zone, a zone used for scripting -* FogOfWarTrigger - * A [Hidden Zone](https://kb.tabletopsimulator.com/game-tools/zone-tools/#hidden-zone) -* FogOfWar - * A [Fog of War Zone](https://kb.tabletopsimulator.com/game-tools/zone-tools/#fog-of-war-zone) - -##Other - -* 3DText - * The text that the [Text Tool](https://kb.tabletopsimulator.com/game-tools/text-tool/) spawns. +This page has information on each type of non-custom object, including the internal names used in the object's save data, which can be used in the `json.Name`, `data.Name`, and `type` fields of [`spawnObjectJSON()`](base.md#spawnobjectjson), [`spawnObjectData()`](base.md#spawnobjectdata), and [`spawnObject()`](base.md#spawnobject) respectively. + +For Custom Objects, see [Custom Game Objects](custom-game-objects.md). + +## Object Types + +Each item listed below is treated as a unique object type. (ie. A red checker tinted black will not stack on top of a regular black checker.) + +### Blocks + +Name | Tag | Description | Notes +-- | -- | -- | -- +BlockRectangle | `Block` | A blue rectangular prism. | +BlockSquare | `Block` | A red cube. | +BlockTriangle | `Block` | A green triangular prism. | + +### Boards + +All boards spawn locked by default. + +Name | Tag | Description | Notes +-- | -- | -- | -- +backgammon_board | `Board` | The fold-open board of Backgammon. | Includes snap-points along each triangle, totalling 120. +CardBot_Board | `Board` | The main board and 4 player boards of CardBots, Build & Destroy. | Includes snap-points on each card and deck location, totally 79. +Checker_Board | `Board` | The 8x8 board of Checkers. | Includes snap-points on each grid square, totalling 64. +Chess_Board | `Board` | The 8x8 board of Chess. | Includes snap-points on each grid square, totalling 64. +Chinese_Checkers_Board | `Board` | The 6-pointed board of Sternhalma, or Chinese Checkers. | Includes snap-points on each indent, totalling 121. +Go_Board | `Board` | The 9-starred board of Go. | Includes snap-points on each line intersection, totalling 361. +Pachisi_board | `Board` | A 6-player Pachisi board. | Includes snap-points on each indent, totall 133. +reversi_board | `Board` | The 8x8 board of Reversi. | Includes snap-points on each grid square, totalling 64. + +### Cards + +Name | Tag | Description | Notes +-- | -- | -- | -- +Card | `Card` | A blank card, standard playing card, or Cardbots card. | +Deck | `Deck` | A deck of the 52 standard playing cards. | Shuffles immediately when spawned. +Deck_CardBot_Head | `Deck` | A deck of the 10 head cards for CardBots, Build & Destroy. | Shuffles immediately when spawned. +Deck_CardBot_Main | `Deck` | A deck of the 152 main cards for CardBots, Build & Destroy. | Shuffles immediately when spawned. + +### Checkers + +Name | Tag | Description | Notes +-- | -- | -- | -- +Checker_black | `Checker` | A black checker with a crown emblem on the top side. | +Checker_red | `Checker` | A red checker with a crown emblem on the top side. | +Checker_white | `Checker` | A white checker with a crown emblem on the top side. | +Chinese_Checkers_Piece | `Checker` | A marble for use in Sternhalma, or Chinese Checkers. | + +### Chess Pieces + +Name | Tag | Description | Notes +-- | -- | -- | -- +Chess_Bishop | `Chess` | A chrome Chess bishop. | Faces visually to the left. +Chess_King | `Chess` | A chrome Chess king. | +Chess_Knight | `Chess` | A chrome Chess knight. | Faces visually backward (a common chess practice). +Chess_Pawn | `Chess` | A chrome Chess pawn. | +Chess_Queen | `Chess` | A chrome Chess queen. | +Chess_Rook | `Chess` | A chrome Chess rook. | + +### Chips + +Name | Tag | Description | Notes +-- | -- | -- | -- +Chip_10 | `Chip` | A blue casino chip worth $10 | Faces visually to the left. +Chip_50 | `Chip` | A green casino chip worth $50 | Faces visually to the left. +Chip_100 | `Chip` | A red casino chip worth $100 | Faces visually to the left. +Chip_500 | `Chip` | A silver casino chip worth $500 | Faces visually to the left. +Chip_1000 | `Chip` | A gold casino chip worth $1000 | Faces visually to the left. + +### Dice + +Name | Tag | Description | Notes +-- | -- | -- | -- +Die_4 | `Dice` | A 4-sided die. | +Die_6 | `Dice` | A 6-sided die with dots. | +Die_6_Rounded | `Dice` | A 6-sided die with dots and rounded corners. | +Die_8 | `Dice` | An 8-sided die. | +Die_10 | `Dice` | A 10-sided die. | +Die_12 | `Dice` | A 12-sided die. | +Die_20 | `Dice` | A 20-sided die. | +Die_Piecepack | `Dice` | A wooden 6-sided die. | + +### Dominos + +Name | Tag | Description | Notes +-- | -- | -- | -- +Domino | `Domino` | A blank domino. | +Mahjong_Coin | `Domino` | A coin used in Mahjong. | +Mahjong_Stick | `Domino` | A stick used in Mahjong. | +Mahjong_Tile | `Domino` | A tile used in Mahjong. | + +### Figurines + +Name | Tag | Description | Notes +-- | -- | -- | -- +Figurine_Card_Bot | `Figurine` | A rectangle-based figurine of a CardBot from CardBots, Build & Destroy. | Faces visually to the side. +Figurine_Kimi_Kat | `Figurine` | A rectangle-based figurine of two sitting cats. | +Figurine_Knil | `Figurine` | A baseless figurine of a sword-wielding knight in full-plate armor. | +Figurine_Mara | `Figurine` | A baseless figurine of a bearded man in slacks. | +Figurine_Sir_Loin | `Figurine` | A rectangle-based figurine of a sword-wielding warrior with a shield on his back. | Faces visually backwards. +Figurine_Zeke | `Figurine` | A baseless figurine of a cloaked character wielding a sword. | +Figurine_Zomblor | `Figurine` | A baseless figurine of a zombified riot-officer with knives for hands, wearing a skirt. | +Metal Ball | `Figurine` | A metallic marble. | This object's internal name includes a space character and not an underline. +PlayerPawn | `Figurine` | A small game piece representing a player. | + +### Go Pieces + +Name | Tag | Description | Notes +-- | -- | -- | -- +go_game_piece_black | `GoPiece` | A black Go stone. | Spawned from a [black Go bowl](#go_game_bowl_black). +go_game_piece_white | `GoPiece` | A white Go stone. | Spawned from a [white Go bowl](#go_game_bowl_white). +go_game_bowl_black | `GoPiece` | A bowl that any number of [Black Go Stones](#go_game_piece_black) can be taken from and dropped back into. | +go_game_bowl_white | `GoPiece` | A bowl that any number of [White Go Stones](#go_game_piece_white) can be taken from and dropped back into. | + +### Piecepack + +Name | Tag | Description | Notes +-- | -- | -- | -- +PiecePack_Arms | `Piecepack` | A wooden coin with a blue fleur-de-lis on the underside. | +PiecePack_Crowns | `Piecepack` | A wooden coin with a green crown on the underside. | +PiecePack_Moons | `Piecepack` | A wooden coin with a black moon on the underside. | +PiecePack_Suns | `Piecepack` | A wooden coin with a red sun on the underside. | + +### RPG Figurines + +Name | Tag | Description | Notes +-- | -- | -- | -- +rpg_BARGHEST | `rpgFigurine` | An animated figurine of a mythical barghest. | +rpg_BASILISK | `rpgFigurine` | An animated figurine of a mythical basilisk (a.k.a. cockatrice). | +rpg_BEAR | `rpgFigurine` | An animated figurine of a bear. | +rpg_BLACK_DRAGON | `rpgFigurine` | An animated figurine of an eastern dragon. | +rpg_CENTAUR | `rpgFigurine` | An animated figurine of an armoured centaur. | +rpg_CERBERUS | `rpgFigurine` | An animated figurine of an infernal 3-headed dog. | +rpg_CHIMERA | `rpgFigurine` | An animated figurine of a mythical chimera. | +rpg_CRASC | `rpgFigurine` | An animated figurine of a one-eyed manta-like creature. | +rpg_CYCLOP | `rpgFigurine` | An animated figurine of a club-wielding cyclops. | +rpg_DARKNESS_WARLORD | `rpgFigurine` | An animated figurine of an armoured, morningstar-wielding orc. | +rpg_DRAGONIDE | `rpgFigurine` | An animated figurine of an armored humanoid lizard. | +rpg_EVIL_WATCHER | `rpgFigurine` | An animated figurine of a cycloptic scaled head with eye-stalks and bat-wings. | +rpg_GHOUL | `rpgFigurine` | An animated figurine of an undead humanoid | +rpg_GIANT_VIPER | `rpgFigurine` | An animated figurine of a large snake. | +rpg_GOBLIN | `rpgFigurine` | An animated figurine of a lightly-armored goblin with two knives. | +rpg_GOLEM | `rpgFigurine` | An animated figurine of a large earthen golem. | +rpg_GRIFFON | `rpgFigurine` | An animated figurine of a mythical griffon. | +rpg_HYDRA | `rpgFigurine` | An animated figurine of a large 3-headed lizard. | +rpg_KNIGHT | `rpgFigurine` | An animated figurine of a knight in full-plate armor wielding a sword and shield. | +rpg_KOBOLD | `rpgFigurine` | An animated figurine of a small helmeted humanoid. | +rpg_LIZARD_WARRIOR | `rpgFigurine` | An animated figurine of a sword-wielding lizard-like humanoid | +rpg_MAGE | `rpgFigurine` | An animated figurine of a staff-wielding mage. | +rpg_MANTICORA | `rpgFigurine` | An animated figurine of a mythical manticore. | This type is spelled with an A. +rpg_MUMMY | `rpgFigurine` | An animated figurine of a living mummy. | +rpg_OGRE | `rpgFigurine` | An animated figurine of a large boiled humanoid. | +rpg_ORC | `rpgFigurine` | An animated figurine of an axe-wielding orc. | +rpg_RANGER | `rpgFigurine` | An animated figurine of a bow-wielding ranger. | +rpg_RAT | `rpgFigurine` | An animated figurine of a giant rat. | +rpg_SKELETON_KNIGHT | `rpgFigurine` | An animated figurine of an armored living skeleton. | +rpg_TEMPLATE | `rpgFigurine` | The base of an RPG figurine. | It has the same animatable triggers as any other RPG Figurine, but no associated animations. +rpg_THIEF | `rpgFigurine` | An animated figurine of a cowled knife-wielding thief. | +rpg_TREE_ENT | `rpgFigurine` | An animated figurine of a large tree creature. | +rpg_TROLL | `rpgFigurine` | An animated figurine of a large green humanoid. | +rpg_VAMPIRE | `rpgFigurine` | An animated figurine of a large wingless bat. | +rpg_WARRIOR | `rpgFigurine` | An animated figurine of a stout, bearded, axe-wielding warrior in scale mail. | +rpg_WEREWOLF | `rpgFigurine` | An animated figurine of a mythical werewolf. | +rpg_WYVERN | `rpgFigurine` | An animated figurine of a mythical wyvern. | + +### Tileset Pieces + +Name | Tag | Description | Notes +-- | -- | -- | -- +Tileset_Barrel | `Tileset` | A small barrel for use in RPG Tilesets. | +Tileset_Chair | `Tileset` | A small chair for use in RPG Tilesets. | +Tileset_Chest | `Tileset` | A small chest for use in RPG Tilesets. | +Tileset_Corner | `Tileset` | A floor tile with two walls for use in RPG Tilesets. | +Tileset_Floor | `Tileset` | A floor tile for use in RPG Tilesets. | +Tileset_Rock | `Tileset` | A small rock for use in RPG Tilesets. | +Tileset_Table | `Tileset` | A small table for use in RPG Tilesets. | +Tileset_Tree | `Tileset` | A small tree for use in RPG Tilesets. | +Tileset_Wall | `Tileset` | A floor tile with a wall for use in RPG Tilesets. | + +### Other + +Name | Tag | Description | Notes +-- | -- | -- | -- +backgammon_piece_brown | `Backgammon Piece` | A brown Backgammon piece. | +backgammon_piece_white | `Backgammon Piece` | A white Backgammon piece. | +Bag | `Bag` | A pouch that objects can be stored in and taken from. | +Bowl | `Generic` | A wooden bowl that objects can be dropped in. | The bowl does not have an inventory, objects merely rest within it visually. +Calculator | `Calculator` | An interactive calculator. | Faces visually backwards. +Counter | `Counter` | An interactive digital counter. | +Digital_Clock | `Clock` | An interactive digital clock. | +Infinite_Bag | A pouch that any number of copies of a single object can be taken from and dropped back into. | An object must be put into the bag to become the source object. +Notecard | `Notecard` | An editable notecard. | +Quarter | `Coin` | An american quarter minted in 1942. | Spawns tails-up, facing to the right. +reversi_chip | `Generic` | A dual-colored Reversi chip. | Spawns white-side up. +Tablet | `Tablet` | A tablet that displays a webpage. | + +### Scripting + +Name | Description | Notes +-- | -- | -- +ScriptingTrigger | A Scripting Zone. | +FogOfWarTrigger | A [Hidden Zone](https://kb.tabletopsimulator.com/game-tools/zone-tools/#hidden-zone) | +FogOfWar | A [Fog of War Zone](https://kb.tabletopsimulator.com/game-tools/zone-tools/#fog-of-war-zone) | +3DText | The text that the [Text Tool](https://kb.tabletopsimulator.com/game-tools/text-tool/) spawns. | + +## Spawnable Names + +When using [`spawnObject()`](base.md#spawnobject), the `type` parameter can be any of the above object types, or any of the below names, which spawns an object of a certain type, and with certain properties different from default. + +Alternate Name | Object | Differences +-- | -- | -- +Arms Dice | [`Die_Piecepack`](#Die_Piecepack) | `MaterialIndex` of `0`. +Backgammon Board | [`backgammon_board`](#backgammon_board) | Snaps to table level immediately upon spawn. +Barrel | [`Tileset_Barrel`](#Tileset_Barrel) | *(none)* +Bear | [`rpg_BEAR`](#rpg_BEAR) | *(none)* +Bishop Cast Iron | [`Chess_Bishop`](#Chess_Bishop) | `MaterialIndex` of `1`. +Bishop Chrome | [`Chess_Bishop`](#Chess_Bishop) | `MaterialIndex` of `0`. +Bishop Dark Wood | [`Chess_Bishop`](#Chess_Bishop) | `MaterialIndex` of `3`. +Bishop Light Wood | [`Chess_Bishop`](#Chess_Bishop) | `MaterialIndex` of `2`. +Black Ball | [`Chinese_Checkers_Piece`](#Chinese_Checkers_Piece) | `MaterialIndex` of `6`. +Black Checker | [`Checker_black`](#Checker_black) | *(none)* +Black Pawn | [`PlayerPawn`](#PlayerPawn) | `MaterialIndex` of `8`. +Blue 10 | [`Chip_10`](#Chip_10) | *(none)* +Blue Ball | [`Chinese_Checkers_Piece`](#Chinese_Checkers_Piece) | `MaterialIndex` of `4`. +Blue Pawn | [`PlayerPawn`](#PlayerPawn) | `MaterialIndex` of `5`. +Blue Rectangle | [`BlockRectangle`](#BlockRectangle) | *(none)* +Brown Backgammon | [`backgammon_piece_brown`](#backgammon_piece_brown) | *(none)* +CardBot | [`Figurine_Card_Bot`](#Figurine_Card_Bot) | *(none)* +CardBots Head Deck | [`Deck_CardBot_Head`](#Deck_CardBot_Head) | *(none)* +CardBots Main Deck | [`Deck_CardBot_Main`](#Deck_CardBot_Main) | *(none)* +Chair | [`Tileset_Chair`](#Tileset_Chair) | *(none)* +Checkers Board | [`Checker_Board`](#Checker_Board) | Snaps to table level immediately upon spawn. +Chess Board | [`Chess_Board`](#Chess_Board) | Snaps to table level immediately upon spawn. +Chest | [`Tileset_Chest`](#Tileset_Chest) | *(none)* +Chimera | [`rpg_CHIMERA`](#rpg_CHIMERA) | *(none)* +Chinese Checkers Board | [`Chinese_Checkers_Board`](#Chinese_Checkers_Board) | Snaps to table level immediately upon spawn. +Corner | [`Tileset_Corner`](#Tileset_Corner) | *(none)* +Crowns Dice | [`Die_Piecepack`](#Die_Piecepack) | `MaterialIndex` of `1`. +Custom Board | [`Custom_Board`](#Custom_Board) | Snaps to table level immediately upon spawn. +Custom Deck | [`DeckCustom`](#DeckCustom) | *(none)* +Custom Figurine | [`Figurine_Custom`](#Figurine_Custom) | *(none)* +Custom Model | [`Custom_Model`](#Custom_Model) | *(none)* +Cyclops | [`rpg_CYCLOP`](#rpg_CYCLOP) | *(none)* +D10 | [`Die_10`](#Die_10) | `MaterialIndex` of `0`. +D10 Chrome | [`Die_10`](#Die_10) | `MaterialIndex` of `1`, `AltSound` of `true`. +D12 | [`Die_12`](#Die_12) | `MaterialIndex` of `0`. +D12 Chrome | [`Die_12`](#Die_12) | `MaterialIndex` of `1`, `AltSound` of `true`. +D20 | [`Die_20`](#Die_20) | `MaterialIndex` of `0`. +D20 Chrome | [`Die_20`](#Die_20) | `MaterialIndex` of `1`, `AltSound` of `true`. +D4 | [`Die_4`](#Die_4) | `MaterialIndex` of `0`. +D4 Chrome | [`Die_4`](#Die_4) | `MaterialIndex` of `1`, `AltSound` of `true`. +D6 | [`Die_6`](#Die_6) | `MaterialIndex` of `0`. +D6 Black | [`Die_6_Rounded`](#Die_6_Rounded) | `MaterialIndex` of `0`. +D6 Blue | [`Die_6_Rounded`](#Die_6_Rounded) | `MaterialIndex` of `3`. +D6 Chrome | [`Die_6`](#Die_6) | `MaterialIndex` of `1`, `AltSound` of `true`. +D6 Green | [`Die_6_Rounded`](#Die_6_Rounded) | `MaterialIndex` of `2`. +D6 Red | [`Die_6_Rounded`](#Die_6_Rounded) | `MaterialIndex` of `1`. +D8 | [`Die_8`](#Die_8) | `MaterialIndex` of `0`. +D8 Chrome | [`Die_8`](#Die_8) | `MaterialIndex` of `1`, `AltSound` of `true`. +Digital Clock | [`Digital_Clock`](#Digital_Clock) | *(none)* +Dragonide | [`rpg_DRAGONIDE`](#rpg_DRAGONIDE) | *(none)* +Evil Watcher | [`rpg_EVIL_WATCHER`](#rpg_EVIL_WATCHER) | *(none)* +Floor | [`Tileset_Floor`](#Tileset_Floor) | *(none)* +Ghoul | [`rpg_GHOUL`](#rpg_GHOUL) | *(none)* +Giant Rat | [`rpg_RAT`](#rpg_RAT) | *(none)* +Giant Viper | [`rpg_GIANT_VIPER`](#rpg_GIANT_VIPER) | *(none)* +Go Board | [`Go_Board`](#Go_Board) | Snaps to table level immediately upon spawn. +GO Bowl Black | [`go_game_bowl_black`](#go_game_bowl_black) | *(none)* +GO Bowl White | [`go_game_bowl_white`](#go_game_bowl_white) | *(none)* +GO Piece Black | [`go_game_piece_black`](#go_game_piece_black) | *(none)* +GO Piece White | [`go_game_piece_white`](#go_game_piece_white) | *(none)* +Goblin | [`rpg_GOBLIN`](#rpg_GOBLIN) | *(none)* +Gold 1000 | [`Chip_1000`](#Chip_1000) | *(none)* +Golem | [`rpg_GOLEM`](#rpg_GOLEM) | *(none)* +Green 50 | [`Chip_50`](#Chip_50) | *(none)* +Green Ball | [`Chinese_Checkers_Piece`](#Chinese_Checkers_Piece) | `MaterialIndex` of `3`. +Green Pawn | [`PlayerPawn`](#PlayerPawn) | `MaterialIndex` of `4`. +Green Triangle | [`BlockTriangle`](#BlockTriangle) | *(none)* +Griffon | [`rpg_GRIFFON`](#rpg_GRIFFON) | *(none)* +Hydra | [`rpg_HYDRA`](#rpg_HYDRA) | *(none)* +Joker | [`Card`](#Card) | `CardID` of `52`. +Kimi Kat | [`Figurine_Kimi_Kat`](#Figurine_Kimi_Kat) | *(none)* +King Cast Iron | [`Chess_King`](#Chess_King) | `MaterialIndex` of `1`. +King Chrome | [`Chess_King`](#Chess_King) | `MaterialIndex` of `0`. +King Dark Wood | [`Chess_King`](#Chess_King) | `MaterialIndex` of `3`. +King Light Wood | [`Chess_King`](#Chess_King) | `MaterialIndex` of `2`. +Knight Cast Iron | [`Chess_Knight`](#Chess_Knight) | `MaterialIndex` of `1`. +Knight Chrome | [`Chess_Knight`](#Chess_Knight) | `MaterialIndex` of `0`. +Knight Dark Wood | [`Chess_Knight`](#Chess_Knight) | `MaterialIndex` of `3`. +Knight Light Wood | [`Chess_Knight`](#Chess_Knight) | `MaterialIndex` of `2`. +Knight of Knil | [`Figurine_Knil`](#Figurine_Knil) | *(none)* +Kobold | [`rpg_KOBOLD`](#rpg_KOBOLD) | *(none)* +Lizard Warrior | [`rpg_LIZARD_WARRIOR`](#rpg_LIZARD_WARRIOR) | *(none)* +Loot Bag | [`Bag`](#Bag) | *(none)* +Manticora | [`rpg_MANTICORA`](#rpg_MANTICORA) | *(none)* +Mara | [`Figurine_Mara`](#Figurine_Mara) | *(none)* +Moons Dice | [`Die_Piecepack`](#Die_Piecepack) | `MaterialIndex` of `2`. +Mummy | [`rpg_MUMMY`](#rpg_MUMMY) | *(none)* +Ogre | [`rpg_OGRE`](#rpg_OGRE) | *(none)* +Orange Pawn | [`PlayerPawn`](#PlayerPawn) | `MaterialIndex` of `2`. +Orc | [`rpg_ORC`](#rpg_ORC) | *(none)* +Pachisi Board | [`Pachisi_board`](#Pachisi_board) | Snaps to table level immediately upon spawn. +Pawn Cast Iron | [`Chess_Pawn`](#Chess_Pawn) | `MaterialIndex` of `1`. +Pawn Chrome | [`Chess_Pawn`](#Chess_Pawn) | `MaterialIndex` of `0`. +Pawn Dark Wood | [`Chess_Pawn`](#Chess_Pawn) | `MaterialIndex` of `3`. +Pawn Light Wood | [`Chess_Pawn`](#Chess_Pawn) | `MaterialIndex` of `2`. +Pink Ball | [`Chinese_Checkers_Piece`](#Chinese_Checkers_Piece) | `MaterialIndex` of `5`. +Pink Pawn | [`PlayerPawn`](#PlayerPawn) | `MaterialIndex` of `7`. +Purple Pawn | [`PlayerPawn`](#PlayerPawn) | `MaterialIndex` of `6`. +Quarter | [`Quarter`](#Quarter) | *(none)* +Queen Cast Iron | [`Chess_Queen`](#Chess_Queen) | `MaterialIndex` of `1`. +Queen Chrome | [`Chess_Queen`](#Chess_Queen) | `MaterialIndex` of `0`. +Queen Dark Wood | [`Chess_Queen`](#Chess_Queen) | `MaterialIndex` of `3`. +Queen Light Wood | [`Chess_Queen`](#Chess_Queen) | `MaterialIndex` of `2`. +Random Card | [`Card`](#Card) | Random `CardID` between `0` and `51` (inclusive). +Random Domino | [`Domino`](#Domino) | Random `MeshIndex` between `0` and `27` (inclusive). +Random Mahjong | [`Mahjong_Tile`](#Mahjong_Tile) | Random `MeshIndex` between `0` and `35` (inclusive). +Red 100 | [`Chip_100`](#Chip_100) | *(none)* +Red Ball | [`Chinese_Checkers_Piece`](#Chinese_Checkers_Piece) | `MaterialIndex` of `1`. +Red Checker | [`Checker_red`](#Checker_red) | *(none)* +Red Pawn | [`PlayerPawn`](#PlayerPawn) | `MaterialIndex` of `1`. +Red Square | [`BlockSquare`](#BlockSquare) | *(none)* +Reversi Board | [`reversi_board`](#reversi_board) | Snaps to table level immediately upon spawn. +Reversi Chip | [`reversi_chip`](#reversi_chip) | *(none)* +Rock | [`Tileset_Rock`](#Tileset_Rock) | *(none)* +Rook Cast Iron | [`Chess_Rook`](#Chess_Rook) | `MaterialIndex` of `1`. +Rook Chrome | [`Chess_Rook`](#Chess_Rook) | `MaterialIndex` of `0`. +Rook Dark Wood | [`Chess_Rook`](#Chess_Rook) | `MaterialIndex` of `3`. +Rook Light Wood | [`Chess_Rook`](#Chess_Rook) | `MaterialIndex` of `2`. +Silver 500 | [`Chip_500`](#Chip_500) | *(none)* +Sir Loin | [`Figurine_Sir_Loin`](#Figurine_Sir_Loin) | *(none)* +Skeleton Knight | [`rpg_SKELETON_KNIGHT`](#rpg_SKELETON_KNIGHT) | *(none)* +Standard Deck | [`Deck`](#Deck) | *(none)* +Suns Dice | [`Die_Piecepack`](#Die_Piecepack) | `MaterialIndex` of `3`. +Table | [`Tileset_Table`](#Tileset_Table) | *(none)* +Tree | [`Tileset_Tree`](#Tileset_Tree) | *(none)* +Tree Ent | [`rpg_TREE_ENT`](#rpg_TREE_ENT) | *(none)* +Troll | [`rpg_TROLL`](#rpg_TROLL) | *(none)* +Vampire | [`rpg_VAMPIRE`](#rpg_VAMPIRE) | *(none)* +Wall | [`Tileset_Wall`](#Tileset_Wall) | *(none)* +Werewolf | [`rpg_WEREWOLF`](#rpg_WEREWOLF) | *(none)* +White Backgammon | [`backgammon_piece_white`](#backgammon_piece_white) | *(none)* +White Ball | [`Chinese_Checkers_Piece`](#Chinese_Checkers_Piece) | `MaterialIndex` of `0`. +White Checker | [`Checker_white`](#Checker_white) | *(none)* +White Pawn | [`PlayerPawn`](#PlayerPawn) | `MaterialIndex` of `0`. +Wolf | [`rpg_WOLF`](#rpg_WOLF) | *(none)* +Wyvern | [`rpg_WYVERN`](#rpg_WYVERN) | *(none)* +Yellow Ball | [`Chinese_Checkers_Piece`](#Chinese_Checkers_Piece) | `MaterialIndex` of `2`. +Yellow Pawn | [`PlayerPawn`](#PlayerPawn) | `MaterialIndex` of `3`. +Zeke Kodoku | [`Figurine_Zeke`](#Figurine_Zeke) | *(none)* +Zomblor | [`Figurine_Zomblor`](#Figurine_Zomblor) | *(none)* diff --git a/docs/changelog.md b/docs/changelog.md deleted file mode 100644 index 26a12d5e..00000000 --- a/docs/changelog.md +++ /dev/null @@ -1,219 +0,0 @@ -This is an ongoing list of scripting changes that have been implemented to scripting and Custom UI side of Tabletop Simulator. - - -######4/3/19 - v11.2 -!!!info "" - * Lua: - * Added access to Components and Children of Unity objects. All details on this process are outlined on the new Component page. - - -######2/05/19 - v11.1 - -!!!info "" - * Lua: - * Added group(table). This allows you to group a table of objects, in the same way the "G" key would for a player! It returns a list of the grouped objects. - * Added addDecal(table), getDecals(), and setDecals(table). Now scripting can add decals into the game world. - * Added object.getJoints(). - * When a table of parameters for a joint is returned, it now includes joint_object_guid. This is the GUID for the object which is attached by the joint. - * Added desired_position to the list of parameters returned by .getCustomObject() when it is used on a Jigsaw Puzzle piece. This parameter is the "solved" position for the piece. - * New Time class added, used to easily fetch information like os.time(), but also other informations like time passed since last frame, total frames passed, etc. - pingTable(vector) added to the Player class. Now a script can emulate a player pinging. - * Added setComponentVar(componentName, varName, value) and getComponentVar(componentName, varName) as an object function. This allows you to access components that you have made part of your AssetBundle via scripting. For example, changing lights or colliders on the fly. These functions will also work on the components of default objects like "Collider" and "Light". - - - - -######11/06/18 - v11.0 - -!!!info "" - * Lua: - * Fog of War API elements added - * `object.getFogOfWarReveal()` and `object.setFogOfWarReveal(table)` to access an Object's ability to reveal Fog of War. - * `object.ignore_fog_of_war` member variable added (prevents object from being hidden) - * Play Area - * Change player area with `Physics.play_area` - * API Improvements - * Knowledge Base link added to left nav bar. - * Minor visual improvements - * Footer returns - - -######08/17/18 - v10.9 - -!!!info "" - * Lua: - * Updates to the new Wait class - * Added repetitions to Wait.time to better emulate Timer. Wait.time(func, time, number_repetitions). - * Using -1 will cause infinite repetitions - * Improvements to stop() so it should work more as expected. - * Returns from getObject and getStates improved to a common standard, includes: - * Name and Nickname - * Description - * Lua Script and Lua Script State - * New Object functions: - * `obj.drop()` causes the item, if held by a player, to be dropped. - * `setHiddenFrom(players)` Hides objects from a specific player/players. Uses "hand zone" hiding. - * `setInvisibleTo(players)` Hides objects from a specific player/players. Uses "hidden zone" hiding. - * `attachHider(...)` and `attachInvisibleHider(...)` are more advanced version of setHiddenFrom and setInvisibleTo, there to help handle complex situations easily. - * Old Object Functions (with new features!) - * `setRotationValues()` now allows you to start a name/value with a # and it won't display the value in the tooltip. - * `randomize(color)` Now an optional string can be added so that onObjectRandomized will trigger, indicating that player color triggered it. - * New base function: - * `get/setVectorLines()` Allows for lines to be placed via scripting using the new vector line tools` - * New Spawnable object: Custom Decks! - * Technically this was added before, but now it works and is documented! - * Spawn using spawnObject then set it using setCustomObject - * Clarifications to the Object class - * Some functions, let setSnapPoints or call, work on both Object and Global. - * To highlight which Object functions can be directed at the game world, they have been broken out on the Object page into a "Global Functions" section. - * New Object member Variables - * `use_rotation_value_flip` can be used to modify which direction objects flip. - * `is_face_down` determines if an object's "face" is pointed down (like with cards). The face is the direction that faces the positive Y value. - * `hide_when_face_down` hides an Object when it is face-down. Objects are hidden like if in a hidden zone. The face is the direction that faces the positive Y value. - * New Event - * `onObjectEnterContainer` has long been a requested event, and it is now available! - - - - - - -######7/9/18 - v10.8 - -!!!info "" - * Lua: - * putObject() now returns an Object. - * Using it to combine two cards will return an object reference to the newly formed deck - * Using it to put an object into a container/stack/deck will return the container/stack/deck it was made part of - * New class: **Notes** - * Contains notebook and set/getNotes functions - * Devalued the old "Base" versions of these functions - * {>>This means they are not in the documentation but will, for legacy reasons, still function.<<} - * New class: **Wait** - * This new class allows you to easily trigger functions after some form of delay - * Contains frames, time, condition, and stop functions - * Devalued Timer class entirely - * {>>This means Timer is removed from documentation but, for legacy reasons, still functions.<<} - * New Object functions: - * **obj.cut(int)** - Cuts a deck at the given card index - * **obj.split(int)** - Splits a deck in a number of stacks - * **obj.getRotationValue** - Returns the current rotationValue of an object (see: gizmo tool) - * This function existed previously, but was not documented. - * New Event functions: - * **onObjectPeeked(player, object)** - Triggers when peek is used by a player - * **onPeek(player)** - Triggers when a specific object is peeked - * **onRandomize(player)** - Triggers when randomize (R) is used on an object. - * Player Color strings convert automatically - * Example: printToAll("Hello", "Green") - * Snap points created on objects use Vectors local to the Object, rather than global - * This applies to both position and rotation - * Fix for optional parameters of spawnObjectJSON() - * New Object Member Variables - * loading_custom - Indicates if the assets of a custom element are being loaded. - * spawning - Indicates if any object is currently in the process of spawning. - * These are helpful to determine if elements are loaded into the game fully - * Especially useful with the new Wait class! - * Callback Changes - * Callback methods are being devalued (still work, but not documented) - * Being replaced with callback_function which directly triggers a function at the same time a callback would have been triggered. - * Done with takeObject, spawnObject(s) and webRequest(s). - * Custom UI: - * New Lua function: - * **UI.setValue(string id, string value)** - Updates the value that appears within element tags {>>(ex: THIS)<<} - * **UI.getValue(string id)** - Obtains the value that appears within element tags {>>(ex: THIS)<<} - * Both support Rich Text! - * New InputField attribute - * **placeholder** - Greyed out text that appears in the input if there is no text present. - * New Lua Function: - * **get/setCustomAssets()** - Allows you to obtain custom UI assets uploaded to the UI Assets window. Works on global or on object's assets. - - -######6/18/18 - v10.7 - -!!!info "" - * Custom UI: - * Visibility attribute now supports admin, host, and team names. - * Clicking button won't block your hotkeys anymore. - * Added getXmlTable() setXmlTable(). - * Fixed onValueChanged recursive event loop. - * Fixed setAttribute() not working if it thought there wasn't a change. - * Fixed not being able to setXml() with an empty string. - * Fix support for RichText in Get/SetXmlTable(). - * Fixed zombie Xml UI when opening File Browser. - * Lua: - * Added Player.getAvailableColors() and Player.getColors(). - * Added SetSnapPoints() and GetSnapPoints(). - * Added JointTo(). - * Lots of scripting improvements to make it easier to convert between Lua Tables and C# types. - * Fixed Hotseat crash when using scripting input fields. - * Fixed camera triggering scripting zone. - * Fixed Turns.getNextColor() returning name instead of color. - - - -######5/30/18 - v10.6.1 - -!!!info "" - * Custom UI: - * Added getXmlTable() and setXmlTable() for dealing with Xml easier with Lua tables. - * Changed setXml() from changing the actual Xml for the save file so everything is runtime changes only. - * Changed getXml() to return the current Xml string including any runtime changes from setAttribute(). - * Fixed event recursion causing a potential lock up. - * Fixed setXml() not working with empty string. - * Lua: - * Added a 'debug_external_api' console command to show logging for external api messages. - * Fixed logging an empty table throwing null. - -######5/25/18 - v10.6 - -!!!info "" - * Custom UI: - * 3D UI added for objects (simialar to createButton/Input) - * Each object can have its own assets (images) - * Point scripting towards an object UI with `object.UI.setAttribute(...)` - * Events called from an object's UI will automatically go to that object's Script. To override that feature and send it to Global, use `Global/functionName` for the attribute's name. - * `UI.getXml()` and `UI.setXml()` added: - * Allows for dynamic UI creation from a string - * This OVERWRITES THE CURRENT XML on the target Global/object!!! - * Click sounds added for inputs - * Text universal attributes outlined in attributes section - * setLookingForPlayers() added. - * FIXED: Player colors now match TTS colors. For example, "red" is now equivalent to the player color red exactly. - * FIXED: Dragging is improved so the element doesn't snap to its rectAlignment when dragged. - * FIXED: When changing active attribute from script visibility would sometimes not work correctly - - - -######5/9/18 - v10.5.1 - -!!!info "" - * Custom UI: - * Added UI.show(id) and UI.hide(id) for disabling and enabling ui with animations. - * Now support the Image tag for custom images. - * Supports overriding the look of the UI using this custom image support. - * Fixed visibility attribute not working correctly on elements with no id attribute or layout tag. - * Fixed offsetXY set/getAttribute() not working. - * Added Tooltip attribute for all objects - -######5/7/18 - v10.5 - -!!!info "" - * Addition of XML Custom UI and associated documentation as part of this documentation. - * onSearchStart/onSearchEnd/onObjectSearchStart/onObjectSearchEnd added to Events. - * The log() command's "label" and "tag" parameters were reversed to `log(object, label, tags)` - * Scripted object button changes - * The click_function of scripted object buttons now passes an argument for alt_click. This allows determining if anything besides left click was used on the button (like right click) - * hover_color and press_color added as optional parameters - * getJSON() and spawnObjectJSON() created. - * Turns global static class added - * Member variables for controlling how turns work - * New event trigger for player turns beginning (onPlayerTurn) - * Devalued previous onPlayerTurn events - * Changelog moved under Getting Started due to the fact that it applies to the UI API as well as the scripting API. But I guess you figured that out already, didn't ya. - * Added getJSON and spawnObjectJSON to Object/Base, respectively. - - -######3/26/18 - v10.4 Hotfix 2 - -!!!info "" - * New Tabletop Simulator Scripting Documentation is created. diff --git a/docs/css/theme.css b/docs/css/theme.css index 2d880fb2..ccbf0699 100644 --- a/docs/css/theme.css +++ b/docs/css/theme.css @@ -94,7 +94,7 @@ td {position: relative;} .anchor { position: absolute; top: 0px; - margin: -48px 0 0; /* negative fixed header height */ + margin: -4.8rem 0 0; /* negative fixed header height */ } /*prevent left/right scrollbar @@ -122,3 +122,7 @@ disabled due to lack of need currently, but works*/ left:1.3rem; top:-0.5rem; } + +code { + white-space: nowrap; + } diff --git a/docs/event.md b/docs/event.md index b46d439f..9ebde8a3 100644 --- a/docs/event.md +++ b/docs/event.md @@ -69,21 +69,28 @@ onSearchEnd([](types.md) player_color) | Calle onSearchStart([](types.md) player_color) | Called when a player starts searching this Object. | [](#onsearchstart) +--- +##Function Details (Global & Object) +###filterObjectEnterContainer(...) +Called when an object attempts to enter a container. The object is prevented from entering unless "true" is returned. +!!!info "filterObjectEnter(container, enter_object)" + * [](types.md) **container**: The container the Object is trying to enter. + * [](types.md) **enter_object**: The Object entering the container. - - - - +``` Lua +function filterObjectEnterContainer(container, enter_object) + print(enter_object.getName()) -- Print entering object's name + return true -- Allows object to enter. +end +``` --- -##Function Details (Global & Object) - ###onChat(...) This function is called when a message is sent through the in-game chat. It does not trigger when global chat messages are sent. Using `#!lua return false` inside of this function prevents the chat message which triggered it to be suppressed. @@ -285,8 +292,8 @@ end Called whenever any object is dropped by a player. !!!info "onObjectDrop(player_color, dropped_object)" + * [](types.md) **player_color**: [Player Color](player-color) of the Player who dropped the Object. * [](types.md) **dropped_object**: The Object in game which was dropped. - * [](types.md) **player_color**: [Player Color](player-color.md) of the Player who dropped the Object. ``` Lua function onObjectDrop(colorName, obj) diff --git a/docs/externaleditorapi.md b/docs/externaleditorapi.md index 74a7a30d..78fa5c89 100644 --- a/docs/externaleditorapi.md +++ b/docs/externaleditorapi.md @@ -151,11 +151,13 @@ TTS listens for a JSON message with an ID of 1 containing an array of the Lua Sc "messageID": 1, "scriptStates": [ { + "name": "Global", "guid": "-1", "script": "...", "ui": "..." }, { + "name": "Block Rectangle", "guid": "a0b2d5", "script": "..." }, diff --git a/docs/intro.md b/docs/intro.md index c601b11c..ff303464 100644 --- a/docs/intro.md +++ b/docs/intro.md @@ -3,7 +3,7 @@ In this section, you will find details on all events/classes/functions specific ##Using TTS Documentation ###Left Column -This is the top-level list of classes and other information needed when scripting with Lua in Tabletop Simulator. Event, Base and Object are the three pages you will use the most, with the rest referring to niche information you can access as you go. It is a good idea to familiarize yourself with the contents of those three pages in order to have a good high-level understanding of off what scripting is capable of doing. +This is the top-level list of classes and other information needed when scripting with Lua in Tabletop Simulator. Event, Base and Object are the three pages you will use the most, with the rest referring to niche information you can access as you go. It is a good idea to familiarize yourself with the contents of those three pages in order to have a good high-level understanding of what scripting is capable of doing. ###Right Column The Table of Contents will lay out the contents of the page you are on. It always starts with high-level summary information first and, if needed, detailed information towards the bottom. The next to a summary element will take you directly down to the relevant detailed explanation below. @@ -20,7 +20,7 @@ Just click the link in the pencil icon in the top-right of an article, or visit ##TTS Terms ###Object -On in-game physical Object that currently exists in the scene. If an Object is placed inside of a bag/deck/etc, it stops existing and is no longer in the scene until it is pulled back out. +An in-game physical Object that currently exists in the scene. If an Object is placed inside of a bag/deck/etc, it stops existing and is no longer in the scene until it is pulled back out. ###Player A person in the game. Each Player is assigned a color, with spectators being "Grey". If you are attempting to identify a Player, you would use the color of the seat they are in to do so. @@ -29,7 +29,7 @@ A person in the game. Each Player is assigned a color, with spectators being "Gr The Global script, which is a script that is not attached to any particular Object. It is always present during a game. ###Object Script -A script that is attached to an in-game Objecet, and is saved as part of it. This is similar to any other property like its scale or tint. Some functions ask for an Object reference in order to attempt to run a function on it. In these cases, Global (exactly as written here) is also a valid Object reference. +A script that is attached to an in-game Object, and is saved as part of it. This is similar to any other property like its scale or tint. Some functions ask for an Object reference in order to attempt to run a function on it. In these cases, Global (exactly as written here) is also a valid Object reference. ###GUID In Tabletop Simulator, a GUID is a unique 6-character [string](types.md) which can be used to identify in-game [Objects](object.md). GUIDs are automatically assigned when objects exist within the scene. @@ -47,7 +47,7 @@ If an object is duplicated, it will sometimes have the same GUID for 1 frame bef ###Classes -Defining class requires further knowledge on object-oriented programming to really understand. However for the purposes of Tabletop Simulator Lua scripting, you can think of a class as a standard or collection that handles categories of objects. +Defining classes requires further knowledge of object-oriented programming to really understand. However for the purposes of Tabletop Simulator Lua scripting, you can think of a class as a standard or collection that handles categories of objects. ####Object Classes Associated with in-game Objects. diff --git a/docs/object.md b/docs/object.md index 79e977fb..b3ae34b5 100644 --- a/docs/object.md +++ b/docs/object.md @@ -46,7 +46,7 @@ Variable | Description | Type value | The value of the object for summing up selected objects. Only works if the apropriate bits are set in `obj.value_flags` | [](types.md) !!! bug - The `drag_selectable`, `value_flags` and `value` member variables do not persist when the object is reloaded (such as loading a save and entering/exiting containers). + The `value_flags` and `value` member variables do not persist when the object is reloaded (such as loading a save and entering/exiting containers). These member variables are classes of their own, and have their own member variables. Each one is for a special type of Object. @@ -183,8 +183,8 @@ Function Name | Description | Return |   addAttachment([](types.md) Object) | The Object supplied as param is destroyed and becomes a dummy Object child. | [](types.md) removeAttachment([](types.md) index) | Removes a child with the given index. Use [getAttachments()](#getattachments) to find out the index property. | [](types.md) removeAttachments() | Detaches the children of this Object. Returns a table of object references | [](types.md) -destroyAttachment([](types.md) index) | Destroys an attachment with the given index. | [](types.md) -destroyAttachments() | Destroys all attachments. | [](types.md) +destroyAttachment([](types.md) index) | Destroys an attachment with the given index. | [](types.md) +destroyAttachments() | Destroys all attachments. | [](types.md) addToPlayerSelection([](types.md) player_color) | Adds object to player's selection. | [](types.md) removeFromPlayerSelection([](types.md) player_color) | Removes object from player's selection. | [](types.md) flip() | Flips Object over. | [](types.md) | @@ -260,6 +260,7 @@ setSnapPoints([](types.md) parameters) | Spawn setVar([](types.md) func_name, [](types.md) data) | Creates/updates a variable in another entity's script. Cannot set a table. | [](types.md) | setVectorLines([](types.md) parameters) | Spawns Vector Lines from a list of parameters on this entity. | [](types.md) | [](#setvectorlines) + --- @@ -842,7 +843,7 @@ Removing an index instantly causes all other higher indexes to shift down 1. ####getCustomObject() -[](types.md) Returns a Table with the Custom Object information of a Custom Object. See the [Spawnable Objects](spawnableobjects.md) page for the kind of information returned. +[](types.md) Returns a Table with the Custom Object information of a Custom Object. See the [Custom Game Objects](custom-game-objects.md) page for the kind of information returned. ``` Lua -- Example returned Table for a custom token @@ -1118,7 +1119,7 @@ Tablet | Returns String of the current URL. [](types.md) Sets a custom Object's properties. It can be used after [spawnObject](base.md#spawnobject) or on an already existing custom Object. If used on an already existing custom Object, you must use [reload](#reload) on the object after setCustomObject for the changes to be displayed. !!!info "setCustomObject(parameters)" - The Table of parameters varies, depending on which type of custom Object it is. See the [Spawnable Object](spawnableobjects.md) page for the parameters needed. + The Table of parameters varies, depending on which type of custom Object it is. See the [Custom Game Objects](custom-game-objects.md) page for the parameters needed. ``` Lua -- Example of a custom token @@ -1355,7 +1356,7 @@ self.jointTo(obj, { ["break_torgue"] = 1000.0, ["motor_force"] = 100.0, ["motor_velocity"] = 10.0, - ["motor_freeSpin"] = true + ["motor_free_spin"] = true }) ``` diff --git a/docs/player.md b/docs/player.md index 777a1456..bf7e2105 100644 --- a/docs/player.md +++ b/docs/player.md @@ -37,7 +37,7 @@ getHandTransform([](types.md) hand_index) | Re getHoldingObjects() | Objects a Player is holding in their hand. | [](types.md) getHoverObject() | Object that the Player's pointer is hovering over. | [](types.md) getPointerPosition() | Player's pointer coordinates. | [](types.md#vector) -getPointerRotation() | Player's pointer rotation. | [](types.md#vector) +getPointerRotation() | Player's pointer rotation on Y axis. | [](types.md) getSelectedObjects() | Objects that the Player has selected with an area selection. | [](types.md) clearSelectedObjects() | Clears a player's current selection. | [](types.md) kick() | Kicks Player out of the room. | [](types.md) diff --git a/docs/types.md b/docs/types.md index c69f70d4..49a82dd0 100644 --- a/docs/types.md +++ b/docs/types.md @@ -132,7 +132,7 @@ Local | The center of the Object's model is `{x=0, y=0, z=0}`. The center of an #####Rotation -X is pitch (nodding your head), Y is yaw (shaking you head), Z is roll (tilting your head). +X is pitch (nodding your head), Y is yaw (shaking your head), Z is roll (tilting your head). #####Direction diff --git a/docs/ui.md b/docs/ui.md index 2dc7d41b..cf306ad6 100644 --- a/docs/ui.md +++ b/docs/ui.md @@ -125,7 +125,7 @@ end ``` Lua -string = UI.getAttribute("testElement") +string = UI.getValue("testElement") print(string) ``` diff --git a/docs/ui/attributes.md b/docs/ui/attributes.md index b6695fbd..2cc33fd2 100644 --- a/docs/ui/attributes.md +++ b/docs/ui/attributes.md @@ -1,4 +1,4 @@ -boundaryAs mentioned in the [Introduction](introUI.md), attributes are modifiers that can be applied to elements. They can be applied to individual elements or to whole groups of them. +As mentioned in the [Introduction](introUI.md), attributes are modifiers that can be applied to elements. They can be applied to individual elements or to whole groups of them. !!!important They consists of two parts, a **tag** and a **value**. ***The value is always in quotation marks.*** diff --git a/mkdocs.yml b/mkdocs.yml index 55558d54..43a88876 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,4 +1,5 @@ site_name: Tabletop Simulator API +site_url: https://nabbydude.github.io/Tabletop-Simulator-API theme: name: 'material' palette: @@ -38,7 +39,7 @@ markdown_extensions: permalink: "\u0020" repo_name: 'GitHub Source' -repo_url: 'https://github.com/tts-community/api' +repo_url: 'https://github.com/Berserk-Games/Tabletop-Simulator-API' extra: @@ -53,53 +54,52 @@ extra: link: 'https://www.youtube.com/user/berserkgames' nav: - - 'Getting Started': - - 'Introduction': index.md - - 'Overview': overview.md - - 'Atom': atom.md - - 'External Editor API': externaleditorapi.md - - 'Learning Lua': learninglua.md - - 'System Console': systemconsole.md - - 'Virtual Reality': vr.md - - 'Changelog': changelog.md - - 'Scripting API': - - 'Introduction': intro.md - - 'Types': types.md - - 'Base': base.md - - 'Event': event.md - - 'Game Component': - - 'Grid': grid.md - - 'Lighting': lighting.md - - 'Music Player': musicplayer.md - - 'Notes': notes.md - - 'Player': player.md - - 'Player Color': player-color.md - - 'Turns': turns.md - - 'Game Object': - - 'Object': object.md - - 'Object Component': component.md - - 'Built-in': built-in-object.md - - 'Custom Game Objects' : custom-game-objects.md - - 'AssetBundle': assetbundle.md - - 'Book': book.md - - 'Browser': browser.md - - 'Clock': clock.md - - 'Counter': counter.md - - 'RPGFigurine': rpgfigurine.md - - 'TextTool': texttool.md - - 'Scripting Component': - - 'Color': color.md - - 'JSON': json.md - - 'Physics': physics.md - - 'Time': time.md - - 'UI': ui.md - - 'Vector': vector.md - - 'Wait': wait.md - - 'Web Request': webrequest.md - - 'UI API': - - 'Introduction': ui/introUI.md - - 'Attributes': ui/attributes.md - - 'Basic Elements': ui/basicelements.md - - 'Input Elements': ui/inputelements.md - - 'Layout/Grouping': ui/layoutgrouping.md - - 'Defaults': ui/defaults.md + - Getting Started: + - Introduction: index.md + - Overview: overview.md + - Atom: atom.md + - External Editor API: externaleditorapi.md + - Learning Lua: learninglua.md + - System Console: systemconsole.md + - Virtual Reality: vr.md + - Patch Notes: https://www.tabletopsimulator.com/news/patch-notes + - Scripting API: + - Introduction: intro.md + - Types: types.md + - Event: event.md + - Base: base.md + - Object: object.md + - AssetBundle: assetbundle.md + - Book: book.md + - Browser: browser.md + - Clock: clock.md + - Color: color.md + - Component: component.md + - Counter: counter.md + - Grid: grid.md + - JSON: json.md + - Lighting: lighting.md + - Music Player: musicplayer.md + - Notes: notes.md + - Physics: physics.md + - Player: player.md + - Player Color: player-color.md + - RPGFigurine: rpgfigurine.md + - Spawnable Objects: + - Built-in: built-in-object.md + - Custom: custom-game-objects.md + - TextTool: texttool.md + - Time: time.md + - Timer: timer.md + - Turns: turns.md + - UI: ui.md + - Vector: vector.md + - Wait: wait.md + - Web Request: webrequest.md + - UI API: + - Introduction: ui/introUI.md + - Attributes: ui/attributes.md + - Basic Elements: ui/basicelements.md + - Input Elements: ui/inputelements.md + - Layout/Grouping: ui/layoutgrouping.md + - Defaults: ui/defaults.md