DECK_AB_GUID = "830c08" DECK_CD_GUID = "84c77d" DECK_EF_GUID = "77af79" DECK_GH_GUID = "929121" ACT_GUIDS = { AB_ALEJANDRO = { { "a52236", "18484e", "b5a536" }, { "20530b", "e2efc3", "b5a536" } }, AB_HARLAN = { { "a52236", "f98fb6", "109829" }, { "20530b", "6245bd", "109829" } }, CD_POLICE = { { "615d10", "f286ef", "9bec2d" }, { "859829", "e0833c", "9bec2d" } }, CD_SEARCH = { { "615d10", "b6ced7", "16d653" }, { "859829", "4c8add", "16d653" } }, EF_LISTEN = { { "62d299", "6284eb", "362420" }, { "13c95f", "a263c3", "362420" } }, EF_LEAVE = { { "62d299", "8207f0", "5611a1" }, { "13c95f", "fbe6b9", "5611a1" } }, GH_SOURCE = { { "2a9786", "51bb93", "fd53f2" }, { "8e8cb0", "42f93b", "fd53f2" } }, GH_ROOT = { { "2a9786", "8e8f75", "aed489" }, { "8e8cb0", "4b1cdc", "aed489" } } } ASSEMBLY = { position = { x=68, y=2, z=36 }, rotation = { x=0, y=180, z=0 } } SET_ASIDE = { position = { x=-2.52, y=2, z=14.87 }, rotation = { x=0, y=180, z=0 } } function onload() self.createButton({ label="Alejandro Vela has the relic", click_function="alejandro_relic", function_owner=self, position={0,0.1,-0.5}, height=150, width=1500, scale={x=2, y=2, z=2}, font_color={ r=0, g=0, b=0 }, color={ r=1, g=1, b=1 } }) self.createButton({ label="Harlan Earnstone has the relic", click_function="harlan_relic", function_owner=self, position={0,0.1,0.5}, height=150, width=1500, scale={x=2, y=2, z=2}, font_color={ r=0, g=0, b=0 }, color={ r=1, g=1, b=1 } }) math.randomseed(os.time()) end function alejandro_relic(obj, color, alt_click) makeActDeck(DECK_AB_GUID, "AB", "ALEJANDRO", color) Wait.time(|| cd_setup(), 1); end function harlan_relic(obj, color, alt_click) makeActDeck(DECK_AB_GUID, "AB", "HARLAN", color) Wait.time(|| cd_setup(), 1); end function cd_setup() DISABLED = false self.editButton({ index = 0, label = "Go to the police", click_function = "police_alejandro" }) self.editButton({ index = 1, label = "Find Alejandro on your own", click_function = "search_alejandro" }) end function police_alejandro(obj, color, alt_click) makeActDeck(DECK_CD_GUID, "CD", "POLICE", color) Wait.time(|| ef_setup(), 1); end function search_alejandro(obj, color, alt_click) makeActDeck(DECK_CD_GUID, "CD", "SEARCH", color) Wait.time(|| ef_setup(), 1); end function ef_setup() DISABLED = false self.editButton({ index = 0, label = "You listened to Ichtaca's tale", click_function = "listen_ichtaca" }) self.editButton({ index = 1, label = "Ichtaca left without you", click_function = "leave_ichtaca" }) end function listen_ichtaca(obj, color, alt_click) makeActDeck(DECK_EF_GUID, "EF", "LISTEN", color) Wait.time(|| gh_setup(), 1); end function leave_ichtaca(obj, color, alt_click) makeActDeck(DECK_EF_GUID, "EF", "LEAVE", color) Wait.time(|| gh_setup(), 1); end function gh_setup() if getObjectFromGUID(DECK_GH_GUID) == nil then return end DISABLED = false self.editButton({ index = 0, label = "Find the source", click_function = "source_story" }) self.editButton({ index = 1, label = "Find the root of the problem", click_function = "root_story" }) end function source_story(obj, color, alt_click) makeActDeck(DECK_GH_GUID, "GH", "SOURCE", color) DISABLED = true end function root_story(obj, color, alt_click) makeActDeck(DECK_GH_GUID, "GH", "ROOT", color) DISABLED = true end function makeActDeck(actDeckGuid, actType, choice, color) if DISABLED then return end DISABLED = true local deck = getObjectFromGUID(actDeckGuid) if deck == nil then printToColor("Act deck not found", color) return end local act_guids = ACT_GUIDS[actType.."_"..choice][math.random(2)] local pos = deck.getPosition() deck.setPosition(ASSEMBLY.position) for i,guid in ipairs(act_guids) do deck.takeObject({ position = { pos.x, i+1, pos.z }, smooth = false, guid = guid }) end deck.setPosition(SET_ASIDE.position) end