Autoraise: true ColorDiffuse: b: 1.0 g: 1.0 r: 1.0 CustomImage: CustomTile: Stackable: false Stretch: true Thickness: 0.1 Type: 0 ImageScalar: 1.0 ImageSecondaryURL: http://cloud-3.steamusercontent.com/ugc/1266023567852787336/4AF14B79224F17C153CF45EF9B5F6CE5B7D3C9D8/ ImageURL: http://cloud-3.steamusercontent.com/ugc/1266023567852787336/4AF14B79224F17C153CF45EF9B5F6CE5B7D3C9D8/ WidthScale: 0.0 Description: Right-click and select "Bind to my color" DragSelectable: true GMNotes: '' GUID: def1c0 Grid: true GridProjection: false Hands: false HideWhenFaceDown: false IgnoreFoW: false LayoutGroupSortIndex: 0 Locked: false LuaScript: !include 'Custom_Tile White Search Assistant def1c0.ttslua' LuaScriptState: '{"playerColor":"White","playerPosition":"p1"}' MeasureMovement: false Name: Custom_Tile Nickname: White Search Assistant Snap: true States: '2': Autoraise: true ColorDiffuse: b: 0.168627322 g: 0.7019608 r: 0.192156732 CustomImage: CustomTile: Stackable: false Stretch: true Thickness: 0.1 Type: 0 ImageScalar: 1.0 ImageSecondaryURL: http://cloud-3.steamusercontent.com/ugc/1266023567852787336/4AF14B79224F17C153CF45EF9B5F6CE5B7D3C9D8/ ImageURL: http://cloud-3.steamusercontent.com/ugc/1266023567852787336/4AF14B79224F17C153CF45EF9B5F6CE5B7D3C9D8/ WidthScale: 0.0 Description: Right-click and select "Bind to my color" DragSelectable: true GMNotes: '' GUID: 351d93 Grid: true GridProjection: false Hands: false HideWhenFaceDown: false IgnoreFoW: false LayoutGroupSortIndex: 0 Locked: false LuaScript: "-- p1 is White, clockwise order\n\nSET_ASIDE_POSITIONS = {\n p1={\ \ x=-64.2, y=2, z=27.2 },\n p2={ x=-64.2, y=2, z=-27.2 },\n p3={ x=-11,\ \ y=2, z=36 },\n p4={ x=-11, y=2, z=-36}\n}\n\nDRAW_DECK_POSITIONS = {\n\ \ p1={ x=-55, y=2.5, z=4.5 },\n p2={ x=-55, y=2.5, z=-22.7 },\n p3={\ \ x=-37, y=2.5, z=26.5 },\n p4={ x=-18.9, y=2.5, z=-26.7 }\n}\n\nHAND_ZONE_POSITIONS\ \ = {\n p1={ x=-65, z=13 },\n p2={ x=-65, z=-13 },\n p3={ x=-28, z=36\ \ },\n p4={ x=-28, z=-36 }\n}\n\nMAT_GUIDS = {\n p1=\"8b081b\",\n p2=\"\ bd0ff4\",\n p3=\"383d8b\",\n p4=\"0840d5\"\n}\n\nfunction onLoad(save_state)\n\ \ self.addContextMenuItem(\"Bind to my color\", bindColor)\n\n playerPosition\ \ = \"p1\"\n playerColor = \"White\"\n\n if save_state ~= nil then\n \ \ local obj = JSON.decode(save_state)\n if obj ~= nil and obj.playerColor\ \ ~= nil and obj.playerPosition ~= nil then\n playerColor = obj.playerColor\n\ \ playerPosition = obj.playerPosition\n end\n end\nend\n\ \nfunction onSave()\n return JSON.encode({\n playerColor = playerColor,\n\ \ playerPosition = playerPosition\n })\nend\n\nfunction bindColor(player_color)\n\ \ playerColor = player_color\n local pos = Player[playerColor].getHandTransform().position\n\ \n matchingPos = nil\n for k in pairs(HAND_ZONE_POSITIONS) do\n \ \ zonePos = HAND_ZONE_POSITIONS[k]\n if pos.x > (zonePos.x-1) and pos.x\ \ < (zonePos.x+1) and pos.z > (zonePos.z-1) and pos.z < (zonePos.z+1) then\n\ \ matchingPos = k\n break\n end\n end\n\n \ \ if matchingPos ~= nil then\n playerPosition = matchingPos\n else\n\ \ print(\"Matching hand zone was not found for \" .. playerColor .. \"\ \ player\")\n end\n\n self.setName(playerColor .. \" Search Assistant\"\ )\nend\n\nfunction getDrawDeck ()\n mat.call(\"getDrawDiscardDecks\")\n \ \ return mat.getVar(\"drawDeck\")\nend\n\nfunction shuffleDrawDeck ()\n \ \ local deck = getDrawDeck()\n if deck ~= nil then\n deck.shuffle()\n\ \ end\nend\n\nfunction setAside ()\n local rot = mat.getRotation()\n \ \ local offset = Vector(0, 0.2, 0)\n local targetPos = Vector(SET_ASIDE_POSITIONS[playerPosition])\ \ + Vector(0, 6, 0)\n local hand = Player[playerColor].getHandObjects()\n\ \ for i=#hand,1,-1 do\n local card = hand[i]\n card.setPosition(targetPos\ \ - i*offset)\n card.setRotation(Vector(rot.x, rot.y, 180))\n end\n\ end\n\nfunction drawSetAside ()\n local objs = Physics.cast({\n origin\ \ = SET_ASIDE_POSITIONS[playerPosition],\n direction = { x=0, y=1, z=0\ \ },\n type = 3,\n size = { 2, 5, 2}\n })\n for i,v in ipairs(objs)\ \ do\n local obj = v.hit_object\n if obj.tag == \"Deck\" then\n\ \ Wait.time(function ()\n obj.deal(#obj.getObjects(),\ \ playerColor)\n end, 1)\n break\n end\n end\n\ end\n\nfunction updateSearchNumber (player, value, id)\n searchNumber = value\n\ \ if searchNumber ~= nil then\n searchNumber = tonumber(searchNumber)\n\ \ end\nend\n\nfunction search (player, value, id)\n if searchNumber ==\ \ nil then return end\n\n self.UI.hide(\"startSearch\")\n self.UI.show(\"\ endSearch\")\n mat = getObjectFromGUID(MAT_GUIDS[playerPosition])\n setAside()\n\ \ local deck = getDrawDeck()\n Wait.time(function ()\n deck.deal(searchNumber,\ \ playerColor)\n end, 1)\nend\n\nfunction doneSearching (player, shuffle)\n\ \ -- place hand back into deck and optionally shuffle\n local hand = Player[playerColor].getHandObjects()\n\ \ local offset = Vector(0, 0.2, 0)\n local rot = mat.getRotation()\n \ \ local targetPos = Vector(DRAW_DECK_POSITIONS[playerPosition]) + Vector(0,\ \ 8, 0)\n for i=#hand,1,-1 do\n local card = hand[i]\n card.setPosition(targetPos\ \ - i*offset)\n card.setRotation(Vector(rot.x, rot.y, 180))\n end\n\ \ if shuffle == \"true\" then\n Wait.time(|| shuffleDrawDeck(), 2)\n\ \ end\n\n self.UI.hide(\"endSearch\")\n self.UI.show(\"startSearch\"\ )\n drawSetAside()\nend" LuaScriptState: '{"playerColor":"Green","playerPosition":"p3"}' MeasureMovement: false Name: Custom_Tile Nickname: Green Search Assistant Snap: true Sticky: true Tooltip: true Transform: posX: -19.88309 posY: 1.51967812 posZ: 35.487 rotX: 359.9201 rotY: 270.015045 rotZ: 0.0168549716 scaleX: 1.0 scaleY: 1.0 scaleZ: 1.0 Value: 0 XmlUI: "\n \n \n\n\n\n \n \n \n \n\ \ \n \n\n" '3': Autoraise: true ColorDiffuse: b: 0.112999894 g: 0.3919999 r: 0.9559999 CustomImage: CustomTile: Stackable: false Stretch: true Thickness: 0.1 Type: 0 ImageScalar: 1.0 ImageSecondaryURL: http://cloud-3.steamusercontent.com/ugc/1266023567852787336/4AF14B79224F17C153CF45EF9B5F6CE5B7D3C9D8/ ImageURL: http://cloud-3.steamusercontent.com/ugc/1266023567852787336/4AF14B79224F17C153CF45EF9B5F6CE5B7D3C9D8/ WidthScale: 0.0 Description: Right-click and select "Bind to my color" DragSelectable: true GMNotes: '' GUID: 8f6c23 Grid: true GridProjection: false Hands: false HideWhenFaceDown: false IgnoreFoW: false LayoutGroupSortIndex: 0 Locked: false LuaScript: "-- p1 is White, clockwise order\n\nSET_ASIDE_POSITIONS = {\n p1={\ \ x=-64.2, y=2, z=27.2 },\n p2={ x=-64.2, y=2, z=-27.2 },\n p3={ x=-11,\ \ y=2, z=36 },\n p4={ x=-11, y=2, z=-36}\n}\n\nDRAW_DECK_POSITIONS = {\n\ \ p1={ x=-55, y=2.5, z=4.5 },\n p2={ x=-55, y=2.5, z=-22.7 },\n p3={\ \ x=-37, y=2.5, z=26.5 },\n p4={ x=-18.9, y=2.5, z=-26.7 }\n}\n\nHAND_ZONE_POSITIONS\ \ = {\n p1={ x=-65, z=13 },\n p2={ x=-65, z=-13 },\n p3={ x=-28, z=36\ \ },\n p4={ x=-28, z=-36 }\n}\n\nMAT_GUIDS = {\n p1=\"8b081b\",\n p2=\"\ bd0ff4\",\n p3=\"383d8b\",\n p4=\"0840d5\"\n}\n\nfunction onLoad(save_state)\n\ \ self.addContextMenuItem(\"Bind to my color\", bindColor)\n\n playerPosition\ \ = \"p1\"\n playerColor = \"White\"\n\n if save_state ~= nil then\n \ \ local obj = JSON.decode(save_state)\n if obj ~= nil and obj.playerColor\ \ ~= nil and obj.playerPosition ~= nil then\n playerColor = obj.playerColor\n\ \ playerPosition = obj.playerPosition\n end\n end\nend\n\ \nfunction onSave()\n return JSON.encode({\n playerColor = playerColor,\n\ \ playerPosition = playerPosition\n })\nend\n\nfunction bindColor(player_color)\n\ \ playerColor = player_color\n local pos = Player[playerColor].getHandTransform().position\n\ \n matchingPos = nil\n for k in pairs(HAND_ZONE_POSITIONS) do\n \ \ zonePos = HAND_ZONE_POSITIONS[k]\n if pos.x > (zonePos.x-1) and pos.x\ \ < (zonePos.x+1) and pos.z > (zonePos.z-1) and pos.z < (zonePos.z+1) then\n\ \ matchingPos = k\n break\n end\n end\n\n \ \ if matchingPos ~= nil then\n playerPosition = matchingPos\n else\n\ \ print(\"Matching hand zone was not found for \" .. playerColor .. \"\ \ player\")\n end\n\n self.setName(playerColor .. \" Search Assistant\"\ )\nend\n\nfunction getDrawDeck ()\n mat.call(\"getDrawDiscardDecks\")\n \ \ return mat.getVar(\"drawDeck\")\nend\n\nfunction shuffleDrawDeck ()\n \ \ local deck = getDrawDeck()\n if deck ~= nil then\n deck.shuffle()\n\ \ end\nend\n\nfunction setAside ()\n local rot = mat.getRotation()\n \ \ local offset = Vector(0, 0.2, 0)\n local targetPos = Vector(SET_ASIDE_POSITIONS[playerPosition])\ \ + Vector(0, 6, 0)\n local hand = Player[playerColor].getHandObjects()\n\ \ for i=#hand,1,-1 do\n local card = hand[i]\n card.setPosition(targetPos\ \ - i*offset)\n card.setRotation(Vector(rot.x, rot.y, 180))\n end\n\ end\n\nfunction drawSetAside ()\n local objs = Physics.cast({\n origin\ \ = SET_ASIDE_POSITIONS[playerPosition],\n direction = { x=0, y=1, z=0\ \ },\n type = 3,\n size = { 2, 5, 2}\n })\n for i,v in ipairs(objs)\ \ do\n local obj = v.hit_object\n if obj.tag == \"Deck\" then\n\ \ Wait.time(function ()\n obj.deal(#obj.getObjects(),\ \ playerColor)\n end, 1)\n break\n end\n end\n\ end\n\nfunction updateSearchNumber (player, value, id)\n searchNumber = value\n\ \ if searchNumber ~= nil then\n searchNumber = tonumber(searchNumber)\n\ \ end\nend\n\nfunction search (player, value, id)\n if searchNumber ==\ \ nil then return end\n\n self.UI.hide(\"startSearch\")\n self.UI.show(\"\ endSearch\")\n mat = getObjectFromGUID(MAT_GUIDS[playerPosition])\n setAside()\n\ \ local deck = getDrawDeck()\n Wait.time(function ()\n deck.deal(searchNumber,\ \ playerColor)\n end, 1)\nend\n\nfunction doneSearching (player, shuffle)\n\ \ -- place hand back into deck and optionally shuffle\n local hand = Player[playerColor].getHandObjects()\n\ \ local offset = Vector(0, 0.2, 0)\n local rot = mat.getRotation()\n \ \ local targetPos = Vector(DRAW_DECK_POSITIONS[playerPosition]) + Vector(0,\ \ 8, 0)\n for i=#hand,1,-1 do\n local card = hand[i]\n card.setPosition(targetPos\ \ - i*offset)\n card.setRotation(Vector(rot.x, rot.y, 180))\n end\n\ \ if shuffle == \"true\" then\n Wait.time(|| shuffleDrawDeck(), 2)\n\ \ end\n\n self.UI.hide(\"endSearch\")\n self.UI.show(\"startSearch\"\ )\n drawSetAside()\nend" LuaScriptState: '{"playerColor":"Orange","playerPosition":"p2"}' MeasureMovement: false Name: Custom_Tile Nickname: Orange Search Assistant Snap: true Sticky: true Tooltip: true Transform: posX: -19.8830948 posY: 1.51967812 posZ: 35.4870033 rotX: 359.9201 rotY: 270.015045 rotZ: 0.0168557111 scaleX: 1.0 scaleY: 1.0 scaleZ: 1.0 Value: 0 XmlUI: "\n \n \n\n\n\n \n \n \n \n\ \ \n \n\n" '4': Autoraise: true ColorDiffuse: b: 0.09399993 g: 0.09999994 r: 0.856 CustomImage: CustomTile: Stackable: false Stretch: true Thickness: 0.1 Type: 0 ImageScalar: 1.0 ImageSecondaryURL: http://cloud-3.steamusercontent.com/ugc/1266023567852787336/4AF14B79224F17C153CF45EF9B5F6CE5B7D3C9D8/ ImageURL: http://cloud-3.steamusercontent.com/ugc/1266023567852787336/4AF14B79224F17C153CF45EF9B5F6CE5B7D3C9D8/ WidthScale: 0.0 Description: Right-click and select "Bind to my color" DragSelectable: true GMNotes: '' GUID: 09b9ed Grid: true GridProjection: false Hands: false HideWhenFaceDown: false IgnoreFoW: false LayoutGroupSortIndex: 0 Locked: false LuaScript: "-- p1 is White, clockwise order\n\nSET_ASIDE_POSITIONS = {\n p1={\ \ x=-64.2, y=2, z=27.2 },\n p2={ x=-64.2, y=2, z=-27.2 },\n p3={ x=-11,\ \ y=2, z=36 },\n p4={ x=-11, y=2, z=-36}\n}\n\nDRAW_DECK_POSITIONS = {\n\ \ p1={ x=-55, y=2.5, z=4.5 },\n p2={ x=-55, y=2.5, z=-22.7 },\n p3={\ \ x=-37, y=2.5, z=26.5 },\n p4={ x=-18.9, y=2.5, z=-26.7 }\n}\n\nHAND_ZONE_POSITIONS\ \ = {\n p1={ x=-65, z=13 },\n p2={ x=-65, z=-13 },\n p3={ x=-28, z=36\ \ },\n p4={ x=-28, z=-36 }\n}\n\nMAT_GUIDS = {\n p1=\"8b081b\",\n p2=\"\ bd0ff4\",\n p3=\"383d8b\",\n p4=\"0840d5\"\n}\n\nfunction onLoad(save_state)\n\ \ self.addContextMenuItem(\"Bind to my color\", bindColor)\n\n playerPosition\ \ = \"p1\"\n playerColor = \"White\"\n\n if save_state ~= nil then\n \ \ local obj = JSON.decode(save_state)\n if obj ~= nil and obj.playerColor\ \ ~= nil and obj.playerPosition ~= nil then\n playerColor = obj.playerColor\n\ \ playerPosition = obj.playerPosition\n end\n end\nend\n\ \nfunction onSave()\n return JSON.encode({\n playerColor = playerColor,\n\ \ playerPosition = playerPosition\n })\nend\n\nfunction bindColor(player_color)\n\ \ playerColor = player_color\n local pos = Player[playerColor].getHandTransform().position\n\ \n matchingPos = nil\n for k in pairs(HAND_ZONE_POSITIONS) do\n \ \ zonePos = HAND_ZONE_POSITIONS[k]\n if pos.x > (zonePos.x-1) and pos.x\ \ < (zonePos.x+1) and pos.z > (zonePos.z-1) and pos.z < (zonePos.z+1) then\n\ \ matchingPos = k\n break\n end\n end\n\n \ \ if matchingPos ~= nil then\n playerPosition = matchingPos\n else\n\ \ print(\"Matching hand zone was not found for \" .. playerColor .. \"\ \ player\")\n end\n\n self.setName(playerColor .. \" Search Assistant\"\ )\nend\n\nfunction getDrawDeck ()\n mat.call(\"getDrawDiscardDecks\")\n \ \ return mat.getVar(\"drawDeck\")\nend\n\nfunction shuffleDrawDeck ()\n \ \ local deck = getDrawDeck()\n if deck ~= nil then\n deck.shuffle()\n\ \ end\nend\n\nfunction setAside ()\n local rot = mat.getRotation()\n \ \ local offset = Vector(0, 0.2, 0)\n local targetPos = Vector(SET_ASIDE_POSITIONS[playerPosition])\ \ + Vector(0, 6, 0)\n local hand = Player[playerColor].getHandObjects()\n\ \ for i=#hand,1,-1 do\n local card = hand[i]\n card.setPosition(targetPos\ \ - i*offset)\n card.setRotation(Vector(rot.x, rot.y, 180))\n end\n\ end\n\nfunction drawSetAside ()\n local objs = Physics.cast({\n origin\ \ = SET_ASIDE_POSITIONS[playerPosition],\n direction = { x=0, y=1, z=0\ \ },\n type = 3,\n size = { 2, 5, 2}\n })\n for i,v in ipairs(objs)\ \ do\n local obj = v.hit_object\n if obj.tag == \"Deck\" then\n\ \ Wait.time(function ()\n obj.deal(#obj.getObjects(),\ \ playerColor)\n end, 1)\n break\n end\n end\n\ end\n\nfunction updateSearchNumber (player, value, id)\n searchNumber = value\n\ \ if searchNumber ~= nil then\n searchNumber = tonumber(searchNumber)\n\ \ end\nend\n\nfunction search (player, value, id)\n if searchNumber ==\ \ nil then return end\n\n self.UI.hide(\"startSearch\")\n self.UI.show(\"\ endSearch\")\n mat = getObjectFromGUID(MAT_GUIDS[playerPosition])\n setAside()\n\ \ local deck = getDrawDeck()\n Wait.time(function ()\n deck.deal(searchNumber,\ \ playerColor)\n end, 1)\nend\n\nfunction doneSearching (player, shuffle)\n\ \ -- place hand back into deck and optionally shuffle\n local hand = Player[playerColor].getHandObjects()\n\ \ local offset = Vector(0, 0.2, 0)\n local rot = mat.getRotation()\n \ \ local targetPos = Vector(DRAW_DECK_POSITIONS[playerPosition]) + Vector(0,\ \ 8, 0)\n for i=#hand,1,-1 do\n local card = hand[i]\n card.setPosition(targetPos\ \ - i*offset)\n card.setRotation(Vector(rot.x, rot.y, 180))\n end\n\ \ if shuffle == \"true\" then\n Wait.time(|| shuffleDrawDeck(), 2)\n\ \ end\n\n self.UI.hide(\"endSearch\")\n self.UI.show(\"startSearch\"\ )\n drawSetAside()\nend" LuaScriptState: '{"playerColor":"Red","playerPosition":"p4"}' MeasureMovement: false Name: Custom_Tile Nickname: Red Search Assistant Snap: true Sticky: true Tooltip: true Transform: posX: -19.8831 posY: 1.51967812 posZ: 35.4870071 rotX: 359.9201 rotY: 270.015045 rotZ: 0.0168568883 scaleX: 1.0 scaleY: 1.0 scaleZ: 1.0 Value: 0 XmlUI: "\n \n \n\n\n\n \n \n \n \n\ \ \n \n\n" Sticky: true Tooltip: true Transform: posX: 34.55 posY: 1.43 posZ: -19.47 rotX: 359.92 rotY: 269.99 rotZ: 0.02 scaleX: 1.0 scaleY: 1.0 scaleZ: 1.0 Value: 0 XmlUI: "\n \n\ \ \n\n\n\n \n \n\ \ \n \n \n \n\n"