ah_sce_unpacked/unpacked/Checker_white Token Spawner 36b4ee.ttslua

92 lines
21 KiB
Plaintext
Raw Normal View History

2021-02-13 12:12:29 -05:00
---
--- Generated by EmmyLua(https://github.com/EmmyLua)
--- Created by Whimsical.
--- DateTime: 2021-01-14 1:10 a.m.
---
local TILE_TYPE_CIRCLE = 2
local HEIGHT_ADJUSTMENT = 1.0
2021-03-23 10:59:55 -04:00
local VALID_INDEX = {false, false, false, true, true, true, true, true, true}
2021-02-13 12:12:29 -05:00
local INDEX_DAMAGE = 4
2021-03-23 10:59:55 -04:00
local INDEX_PATH = 5
2021-02-13 12:12:29 -05:00
local INDEX_HORROR = 6
2021-03-23 10:59:55 -04:00
local INDEX_CLUE = 8
local INDEX_DOOM = 7
2021-02-13 12:12:29 -05:00
local INDEX_RESOURCE = 9
local TOKEN_CLUE = "https://i.imgur.com/wfCaVU0.png"
local TOKEN_DOOM = "https://i.imgur.com/EoL7yaZ.png"
local TOKEN_RESOURCE = "https://i.imgur.com/j5v5E3j.png"
local CLOOM_SCALE = Vector(0.25, 1, 0.25)
local RESOURCE_SCALE = Vector(0.17, 0.17, 0.17)
2021-03-23 10:59:55 -04:00
local PATH_SCALE = Vector(1,1,1)
2021-02-13 12:12:29 -05:00
local DAMAGE_JSON = "{\"GUID\":\"142b55\",\"Name\":\"Custom_Token\",\"Transform\":{\"posX\":-38.6177826,\"posY\":1.688475,\"posZ\":10.7887154,\"rotX\":359.9204,\"rotY\":270.009583,\"rotZ\":0.0172974449,\"scaleX\":0.25,\"scaleY\":1,\"scaleZ\":0.25},\"Nickname\":\"Damage\",\"Description\":\"\",\"GMNotes\":\"\",\"ColorDiffuse\":{\"r\":1,\"g\":1,\"b\":1},\"LayoutGroupSortIndex\":0,\"Locked\":false,\"Grid\":false,\"Snap\":false,\"IgnoreFoW\":false,\"MeasureMovement\":false,\"DragSelectable\":true,\"Autoraise\":true,\"Sticky\":true,\"Tooltip\":true,\"GridProjection\":false,\"HideWhenFaceDown\":false,\"Hands\":false,\"CustomImage\":{\"ImageURL\":\"https://i.imgur.com/XIJHw3J.png\",\"ImageSecondaryURL\":\"\",\"ImageScalar\":1,\"WidthScale\":0,\"CustomToken\":{\"Thickness\":0.1,\"MergeDistancePixels\":5,\"StandUp\":false,\"Stackable\":false}},\"LuaScript\":\"\",\"LuaScriptState\":\"\",\"XmlUI\":\"\",\"States\":{\"2\":{\"GUID\":\"c6ddbe\",\"Name\":\"Custom_Token\",\"Transform\":{\"posX\":-28.3444748,\"posY\":1.112169,\"posZ\":19.0119534,\"rotX\":0.000318417122,\"rotY\":270.007721,\"rotZ\":359.99176,\"scaleX\":0.25,\"scaleY\":1,\"scaleZ\":0.25},\"Nickname\":\"Damage\",\"Description\":\"\",\"GMNotes\":\"\",\"ColorDiffuse\":{\"r\":1,\"g\":1,\"b\":1},\"LayoutGroupSortIndex\":0,\"Locked\":false,\"Grid\":false,\"Snap\":false,\"IgnoreFoW\":false,\"MeasureMovement\":false,\"DragSelectable\":true,\"Autoraise\":true,\"Sticky\":true,\"Tooltip\":true,\"GridProjection\":false,\"HideWhenFaceDown\":false,\"Hands\":false,\"CustomImage\":{\"ImageURL\":\"https://i.imgur.com/55w514N.png\",\"ImageSecondaryURL\":\"\",\"ImageScalar\":1,\"WidthScale\":0,\"CustomToken\":{\"Thickness\":0.1,\"MergeDistancePixels\":5,\"StandUp\":false,\"Stackable\":false}},\"LuaScript\":\"\",\"LuaScriptState\":\"\",\"XmlUI\":\"\"},\"3\":{\"GUID\":\"a0f2a0\",\"Name\":\"Custom_Token\",\"Transform\":{\"posX\":-28.3444748,\"posY\":1.11216891,\"posZ\":19.0119534,\"rotX\":0.0003119017,\"rotY\":270.007874,\"rotZ\":359.99173,\"scaleX\":0.25,\"scaleY\":1,\"scaleZ\":0.25},\"Nickname\":\"Damage\",\"Description\":\"\",\"GMNotes\":\"\",\"ColorDiffuse\":{\"r\":1,\"g\":1,\"b\":1},\"LayoutGroupSortIndex\":0,\"Locked\":false,\"Grid\":false,\"Snap\":false,\"IgnoreFoW\":false,\"MeasureMovement\":false,\"DragSelectable\":true,\"Autoraise\":true,\"Sticky\":true,\"Tooltip\":true,\"GridProjection\":false,\"HideWhenFaceDown\":false,\"Hands\":false,\"CustomImage\":{\"ImageURL\":\"https://i.imgur.com/eqRC712.png\",\"ImageSecondaryURL\":\"\",\"ImageScalar\":1,\"WidthScale\":0,\"CustomToken\":{\"Thickness\":0.1,\"MergeDistancePixels\":5,\"StandUp\":false,\"Stackable\":false}},\"LuaScript\":\"\",\"LuaScriptState\":\"\",\"XmlUI\":\"\"},\"4\":{\"GUID\":\"24c940\",\"Name\":\"Custom_Token\",\"Transform\":{\"posX\":-28.3444748,\"posY\":1.11216891,\"posZ\":19.0119534,\"rotX\":0.0003254045,\"rotY\":270.008026,\"rotZ\":359.99173,\"scaleX\":0.25,\"scaleY\":1,\"scaleZ\":0.25},\"Nickname\":\"Damage\",\"Description\":\"\",\"GMNotes\":\"\",\"ColorDiffuse\":{\"r\":1,\"g\":1,\"b\":1},\"LayoutGroupSortIndex\":0,\"Locked\":false,\"Grid\":false,\"Snap\":false,\"IgnoreFoW\":false,\"MeasureMovement\":false,\"DragSelectable\":true,\"Autoraise\":true,\"Sticky\":true,\"Tooltip\":true,\"GridProjection\":false,\"HideWhenFaceDown\":false,\"Hands\":false,\"CustomImage\":{\"ImageURL\":\"https://i.imgur.com/2j2uZm4.png\",\"ImageSecondaryURL\":\"\",\"ImageScalar\":1,\"WidthScale\":0,\"CustomToken\":{\"Thickness\":0.1,\"MergeDistancePixels\":5,\"StandUp\":false,\"Stackable\":false}},\"LuaScript\":\"\",\"LuaScriptState\":\"\",\"XmlUI\":\"\"},\"5\":{\"GUID\":\"ec79a1\",\"Name\":\"Custom_Token\",\"Transform\":{\"posX\":-28.3444748,\"posY\":1.11216879,\"posZ\":19.0119534,\"rotX\":0.000309352879,\"rotY\":270.008,\"rotZ\":359.99173,\"scaleX\":0.25,\"scaleY\":1,\"scaleZ\":0.25},\"Nickname\":\"Damage\",\"Description\":\"\",\"GMNotes\":\"\",\"ColorDiffuse\":{\"r\":1,\"g\":1,\"b\":1},\"LayoutGroupSortIndex\":0,\"Locked\":false,\"Grid\":false,\"Snap\":false,\"IgnoreFoW\":false,\"MeasureMovement\":false,\"DragSelectable\":true,\"Autoraise\":tr
local HORROR_JSON = "{\"GUID\":\"36be72\",\"Name\":\"Custom_Token\",\"Transform\":{\"posX\":-44.08369,\"posY\":1.69583237,\"posZ\":9.886347,\"rotX\":359.9201,\"rotY\":270.008972,\"rotZ\":0.0168560985,\"scaleX\":0.25,\"scaleY\":1,\"scaleZ\":0.25},\"Nickname\":\"Horror\",\"Description\":\"\",\"GMNotes\":\"\",\"ColorDiffuse\":{\"r\":1,\"g\":1,\"b\":1},\"LayoutGroupSortIndex\":0,\"Locked\":false,\"Grid\":false,\"Snap\":false,\"IgnoreFoW\":false,\"MeasureMovement\":false,\"DragSelectable\":true,\"Autoraise\":true,\"Sticky\":true,\"Tooltip\":true,\"GridProjection\":false,\"HideWhenFaceDown\":false,\"Hands\":false,\"CustomImage\":{\"ImageURL\":\"https://i.imgur.com/Bh0BO47.png\",\"ImageSecondaryURL\":\"\",\"ImageScalar\":1,\"WidthScale\":0,\"CustomToken\":{\"Thickness\":0.1,\"MergeDistancePixels\":5,\"StandUp\":false,\"Stackable\":false}},\"LuaScript\":\"\",\"LuaScriptState\":\"\",\"XmlUI\":\"\",\"States\":{\"2\":{\"GUID\":\"5c2361\",\"Name\":\"Custom_Token\",\"Transform\":{\"posX\":-27.7533741,\"posY\":1.210006,\"posZ\":15.9442654,\"rotX\":-0.0000202706469,\"rotY\":270.015259,\"rotZ\":0.0000220759175,\"scaleX\":0.25,\"scaleY\":1,\"scaleZ\":0.25},\"Nickname\":\"Horror\",\"Description\":\"\",\"GMNotes\":\"\",\"ColorDiffuse\":{\"r\":1,\"g\":1,\"b\":1},\"LayoutGroupSortIndex\":0,\"Locked\":false,\"Grid\":false,\"Snap\":false,\"IgnoreFoW\":false,\"MeasureMovement\":false,\"DragSelectable\":true,\"Autoraise\":true,\"Sticky\":true,\"Tooltip\":true,\"GridProjection\":false,\"HideWhenFaceDown\":false,\"Hands\":false,\"CustomImage\":{\"ImageURL\":\"https://i.imgur.com/NM2enxD.png\",\"ImageSecondaryURL\":\"\",\"ImageScalar\":1,\"WidthScale\":0,\"CustomToken\":{\"Thickness\":0.1,\"MergeDistancePixels\":5,\"StandUp\":false,\"Stackable\":false}},\"LuaScript\":\"\",\"LuaScriptState\":\"\",\"XmlUI\":\"\"},\"3\":{\"GUID\":\"3a3415\",\"Name\":\"Custom_Token\",\"Transform\":{\"posX\":-27.7533741,\"posY\":1.210006,\"posZ\":15.9442368,\"rotX\":-0.0000104253941,\"rotY\":270.015137,\"rotZ\":0.0000102804506,\"scaleX\":0.25,\"scaleY\":1,\"scaleZ\":0.25},\"Nickname\":\"Horror\",\"Description\":\"\",\"GMNotes\":\"\",\"ColorDiffuse\":{\"r\":1,\"g\":1,\"b\":1},\"LayoutGroupSortIndex\":0,\"Locked\":false,\"Grid\":false,\"Snap\":false,\"IgnoreFoW\":false,\"MeasureMovement\":false,\"DragSelectable\":true,\"Autoraise\":true,\"Sticky\":true,\"Tooltip\":true,\"GridProjection\":false,\"HideWhenFaceDown\":false,\"Hands\":false,\"CustomImage\":{\"ImageURL\":\"https://i.imgur.com/pZvTKA7.png\",\"ImageSecondaryURL\":\"\",\"ImageScalar\":1,\"WidthScale\":0,\"CustomToken\":{\"Thickness\":0.1,\"MergeDistancePixels\":5,\"StandUp\":false,\"Stackable\":false}},\"LuaScript\":\"\",\"LuaScriptState\":\"\",\"XmlUI\":\"\"},\"4\":{\"GUID\":\"4a91a8\",\"Name\":\"Custom_Token\",\"Transform\":{\"posX\":-27.7533741,\"posY\":1.21000612,\"posZ\":15.9442348,\"rotX\":0.00000189065361,\"rotY\":270.01532,\"rotZ\":0.0000159575811,\"scaleX\":0.25,\"scaleY\":1,\"scaleZ\":0.25},\"Nickname\":\"Horror\",\"Description\":\"\",\"GMNotes\":\"\",\"ColorDiffuse\":{\"r\":1,\"g\":1,\"b\":1},\"LayoutGroupSortIndex\":0,\"Locked\":false,\"Grid\":false,\"Snap\":false,\"IgnoreFoW\":false,\"MeasureMovement\":false,\"DragSelectable\":true,\"Autoraise\":true,\"Sticky\":true,\"Tooltip\":true,\"GridProjection\":false,\"HideWhenFaceDown\":false,\"Hands\":false,\"CustomImage\":{\"ImageURL\":\"https://i.imgur.com/T7nvZBP.png\",\"ImageSecondaryURL\":\"\",\"ImageScalar\":1,\"WidthScale\":0,\"CustomToken\":{\"Thickness\":0.1,\"MergeDistancePixels\":5,\"StandUp\":false,\"Stackable\":false}},\"LuaScript\":\"\",\"LuaScriptState\":\"\",\"XmlUI\":\"\"},\"5\":{\"GUID\":\"887aae\",\"Name\":\"Custom_Token\",\"Transform\":{\"posX\":-27.7533741,\"posY\":1.21000612,\"posZ\":15.9442024,\"rotX\":-0.00003432232,\"rotY\":270.016,\"rotZ\":-0.00000373151761,\"scaleX\":0.25,\"scaleY\":1,\"scaleZ\":0.25},\"Nickname\":\"Horror\",\"Description\":\"\",\"GMNotes\":\"\",\"ColorDiffuse\":{\"r\":1,\"g\":1,\"b\":1},\"LayoutGroupSortIndex\":0,\"Locked\":false,\"Grid\":false,\"Snap\":false,\"IgnoreFoW\":false,\"MeasureMovement\":false,\"DragSel
2021-03-23 10:59:55 -04:00
local PATH_JSON = "{\"GUID\": \"7234af\",\"Name\": \"Custom_Tile\",\"Transform\": {\"posX\": -50.92423,\"posY\": 1.63760316,\"posZ\": 11.0779743,\"rotX\": 359.9201,\"rotY\": 270.00946,\"rotZ\": 0.0168931335,\"scaleX\": 1.0,\"scaleY\": 1.0,\"scaleZ\": 1.0},\"Nickname\": \"\",\"Description\": \"\",\"GMNotes\": \"\",\"ColorDiffuse\": {\"r\": 0.6045295,\"g\": 0.6045295,\"b\": 0.6045295},\"LayoutGroupSortIndex\": 0,\"Locked\": false,\"Grid\": true,\"Snap\": true,\"IgnoreFoW\": false,\"MeasureMovement\": false,\"DragSelectable\": true,\"Autoraise\": true,\"Sticky\": true,\"Tooltip\": true,\"GridProjection\": false,\"HideWhenFaceDown\": false,\"Hands\": false,\"CustomImage\": {\"ImageURL\": \"https://i.imgur.com/vppt2my.png\",\"ImageSecondaryURL\": \"https://i.imgur.com/vppt2my.png\",\"ImageScalar\": 1.0,\"WidthScale\": 0.0,\"CustomTile\": {\"Type\": 3,\"Thickness\": 0.1,\"Stackable\": false,\"Stretch\": true}},\"LuaScript\": \"\",\"LuaScriptState\": \"\",\"XmlUI\": \"\",\"States\": {\"2\": {\"GUID\": \"44b0c5\",\"Name\": \"Custom_Tile\",\"Transform\": {\"posX\": -39.7933121,\"posY\": 1.63758957,\"posZ\": 2.038383,\"rotX\": 359.9201,\"rotY\": 269.9961,\"rotZ\": 0.0168742146,\"scaleX\": 1.0,\"scaleY\": 1.0,\"scaleZ\": 1.0},\"Nickname\": \"\",\"Description\": \"\",\"GMNotes\": \"\",\"ColorDiffuse\": {\"r\": 0.6045295,\"g\": 0.6045295,\"b\": 0.6045295},\"LayoutGroupSortIndex\": 0,\"Locked\": false,\"Grid\": true,\"Snap\": true,\"IgnoreFoW\": false,\"MeasureMovement\": false,\"DragSelectable\": true,\"Autoraise\": true,\"Sticky\": true,\"Tooltip\": true,\"GridProjection\": false,\"HideWhenFaceDown\": false,\"Hands\": false,\"CustomImage\": {\"ImageURL\": \"https://i.imgur.com/HyfE8m8.png\",\"ImageSecondaryURL\": \"https://i.imgur.com/HyfE8m8.png\",\"ImageScalar\": 1.0,\"WidthScale\": 0.0,\"CustomTile\": {\"Type\": 3,\"Thickness\": 0.1,\"Stackable\": false,\"Stretch\": true}},\"LuaScript\": \"\",\"LuaScriptState\": \"\",\"XmlUI\": \"\"},\"3\": {\"GUID\": \"5b38c6\",\"Name\": \"Custom_Tile\",\"Transform\": {\"posX\": -38.8217163,\"posY\": 1.99356019,\"posZ\": 0.4159239,\"rotX\": 359.9201,\"rotY\": 272.9828,\"rotZ\": 0.01687373,\"scaleX\": 0.8,\"scaleY\": 1.0,\"scaleZ\": 0.8},\"Nickname\": \"\",\"Description\": \"\",\"GMNotes\": \"\",\"ColorDiffuse\": {\"r\": 0.6045295,\"g\": 0.6045295,\"b\": 0.6045295},\"LayoutGroupSortIndex\": 0,\"Locked\": false,\"Grid\": true,\"Snap\": true,\"IgnoreFoW\": false,\"MeasureMovement\": false,\"DragSelectable\": true,\"Autoraise\": true,\"Sticky\": true,\"Tooltip\": true,\"GridProjection\": false,\"HideWhenFaceDown\": false,\"Hands\": false,\"CustomImage\": {\"ImageURL\": \"https://i.imgur.com/dHKBLoD.png\",\"ImageSecondaryURL\": \"https://i.imgur.com/HyfE8m8.png\",\"ImageScalar\": 1.0,\"WidthScale\": 0.0,\"CustomTile\": {\"Type\": 3,\"Thickness\": 0.1,\"Stackable\": false,\"Stretch\": true}},\"LuaScript\": \"\",\"LuaScriptState\": \"\",\"XmlUI\": \"\"}}}"
local OBJECT_JSON = {}
OBJECT_JSON[INDEX_DAMAGE] = DAMAGE_JSON
OBJECT_JSON[INDEX_HORROR] = HORROR_JSON
OBJECT_JSON[INDEX_PATH] = PATH_JSON
2021-02-13 12:12:29 -05:00
---@param index number
---@param player_color string
function onScriptingButtonDown(index, player_color)
if not VALID_INDEX[index] then return end
local isResource = index==INDEX_RESOURCE
---@type Player
local player = Player[player_color]
local rotation = player:getPointerRotation()
local position = player:getPointerPosition()
position.y = position.y + HEIGHT_ADJUSTMENT
---@type SpawnObjectParams
local parameters = {
snap_to_grid = false,
position = position,
rotation = Vector(0, rotation, index==INDEX_DOOM and 180 or 0),
2021-03-23 10:59:55 -04:00
scale = isResource and RESOURCE_SCALE or (index==INDEX_PATH and PATH_SCALE or CLOOM_SCALE),
2021-02-13 12:12:29 -05:00
type = isResource and "Custom_Token" or "Custom_Tile",
2021-03-23 10:59:55 -04:00
sound = false,
---@param thing TTSObject
callback_function = function (thing)
thing.use_snap_points = false
end
2021-02-13 12:12:29 -05:00
}
if index<=INDEX_HORROR then
2021-03-23 10:59:55 -04:00
---@type SpawnObjectParamsJSON
parameters = parameters
parameters.json = OBJECT_JSON[index]
2021-02-13 12:12:29 -05:00
spawnObjectJSON(parameters)
else
local object = spawnObject(parameters)
if index==INDEX_RESOURCE then makeResource(object) else makeCloom(object) end
end
end
---@param object TTSObject
function makeCloom(object)
object:setCustomObject {
type = TILE_TYPE_CIRCLE,
image = TOKEN_CLUE,
image_bottom = TOKEN_DOOM,
stackable = true,
thickness = 0.1
}
end
---@param object TTSObject
function makeResource(object)
object:setCustomObject {
image = TOKEN_RESOURCE,
thickness = 0.3,
merge_distance = 5,
stackable = true
}
end