From accf9d7197d56bcce291667ba4ae6c22ff23783e Mon Sep 17 00:00:00 2001 From: Chr1Z93 Date: Sat, 30 Sep 2023 18:37:55 +0200 Subject: [PATCH] dynamic tourscript --- objects/PlayerCards.2d30ee.json | 1 + objects/Resourcetokens.9fadf9.json | 1 + objects/RulesReference.d99993.json | 1 + objects/ThePathtoCarcosa.aca04c.json | 1 + src/core/tour/TourManager.ttslua | 4 ++-- src/core/tour/TourScript.ttslua | 10 +++++----- 6 files changed, 11 insertions(+), 7 deletions(-) diff --git a/objects/PlayerCards.2d30ee.json b/objects/PlayerCards.2d30ee.json index 94839147..f05bd54c 100644 --- a/objects/PlayerCards.2d30ee.json +++ b/objects/PlayerCards.2d30ee.json @@ -36,6 +36,7 @@ "LuaScript": "require(\"playercards/PlayerCardPanel\")", "LuaScriptState": "{\"spawnBagState\":{\"placed\":[],\"placedObjects\":[]}}", "MeasureMovement": false, + "Memo": "{\"matColor\":\"Mythos\",\"type\":\"PlayerCardPanel\"}", "Name": "Custom_Tile", "Nickname": "Player Cards", "Snap": true, diff --git a/objects/Resourcetokens.9fadf9.json b/objects/Resourcetokens.9fadf9.json index 06da43f5..a39181d0 100644 --- a/objects/Resourcetokens.9fadf9.json +++ b/objects/Resourcetokens.9fadf9.json @@ -39,6 +39,7 @@ "LuaScriptState": "", "MaterialIndex": -1, "MeasureMovement": false, + "Memo": "{\"matColor\":\"Mythos\",\"type\":\"ResourceTokenBag\"}", "MeshIndex": -1, "Name": "Custom_Model_Infinite_Bag", "Nickname": "Resource tokens", diff --git a/objects/RulesReference.d99993.json b/objects/RulesReference.d99993.json index 4de14917..b00713d6 100644 --- a/objects/RulesReference.d99993.json +++ b/objects/RulesReference.d99993.json @@ -30,6 +30,7 @@ "LuaScript": "", "LuaScriptState": "", "MeasureMovement": false, + "Memo": "{\"matColor\":\"Mythos\",\"type\":\"RulesReference\"}", "Name": "Custom_PDF", "Nickname": "Rules Reference", "Snap": true, diff --git a/objects/ThePathtoCarcosa.aca04c.json b/objects/ThePathtoCarcosa.aca04c.json index dd39ca10..c7c855cd 100644 --- a/objects/ThePathtoCarcosa.aca04c.json +++ b/objects/ThePathtoCarcosa.aca04c.json @@ -45,6 +45,7 @@ "LuaScript": "require(\"core/DownloadBox\")", "LuaScriptState": "", "MeasureMovement": false, + "Memo": "{\"matColor\":\"Mythos\",\"type\":\"CampaignThePathToCarcosa\"}", "Name": "Custom_Model", "Nickname": "The Path to Carcosa", "Snap": true, diff --git a/src/core/tour/TourManager.ttslua b/src/core/tour/TourManager.ttslua index d0a37183..4f67e09a 100644 --- a/src/core/tour/TourManager.ttslua +++ b/src/core/tour/TourManager.ttslua @@ -123,8 +123,8 @@ do delay = delay + 0.5 end local lookPos - if TOUR_SCRIPT[cardIndex].showObj ~= nil then - local lookAtObj = getObjectFromGUID(TOUR_SCRIPT[cardIndex].showObj) + if TOUR_SCRIPT[cardIndex].objMemoData ~= nil then + local lookAtObj = Global.call("getObjectFromMemo", TOUR_SCRIPT[cardIndex].objMemoData) lookPos = lookAtObj.getPosition() lookPos.y = TOUR_SCRIPT[cardIndex].distanceFromObj or 0 -- Since camera isn't directly above the hook, changing the Y affects the visual position of diff --git a/src/core/tour/TourScript.ttslua b/src/core/tour/TourScript.ttslua index 2d92848a..d407de3c 100644 --- a/src/core/tour/TourScript.ttslua +++ b/src/core/tour/TourScript.ttslua @@ -15,7 +15,7 @@ TOUR_SCRIPT = { { narrator = "Daisy", text = "If you're new to the game, the library here has everything you'll need. A little research can go a long way, and looking into old newspapers for the weird and unusual can yield some surprisingly helpful information.\n\nI put a few right there that might prove enlightening.", - showObj = "d99993", + objMemoData = { matColor = "Mythos", type = "RulesReference" }, distanceFromObj = 20, position = "west", speakerSide = "right" @@ -23,7 +23,7 @@ TOUR_SCRIPT = { { narrator = "Mandy", text = "To survive what's coming you'll need a deck. If it's safely hidden away on ArkhamDB you can load it here, and even find the newest version after an upgrade without changing the ID.\n\nNo need to publish all your decks, use 'Private' and you can see it. Just make sure to select 'Make your decks public' in ArkhamDB.", - showObj = "a28140", + objMemoData = { matColor = "Mythos", type = "DeckImporter" }, distanceFromObj = -5, position = "northwest", skipCentering = true, @@ -31,7 +31,7 @@ TOUR_SCRIPT = { { narrator = "Daniela", text = "I prefer the hands-on approach to building things, if you do too you can build a deck yourself.\n\nAll the cards you could ever need are here, laid out like a disassembled engine. Place the cards on the table, copy them for your deck, and you'll be ready for anything.", - showObj = "2d30ee", + objMemoData = { matColor = "Mythos", type = "PlayerCardPanel" }, distanceFromObj = -7, position = "south", speakerSide = "right" @@ -39,7 +39,7 @@ TOUR_SCRIPT = { { narrator = "Finn", text = "Ready to face the unknown? We've smuggled shocking revelations and devious enemies from all over the world. Download the campaign you want to play, then Place it on the table to see the scenarios.\n\nJust remember - if it turns out to be too much for you, I was never here.", - showObj = "aca04c", + objMemoData = = { matColor = "Mythos", type = "CampaignThePathToCarcosa" }, distanceFromObj = 20, position = "northwest", }, @@ -77,7 +77,7 @@ TOUR_SCRIPT = { { narrator = "Preston", text = "I can afford to buy what I need, but for those less well-off we've provided an endless pool of tokens to track your game. Simply drag one out of the pools here.\n\nResources are my favorite of course, but damage and horror are as inevitable as taxes. I leave those to my bookkeeper though. Those tokens can work like counters, use the number keys to change the value.", - showObj = "9fadf9", + objMemoData = = { matColor = "Mythos", type = "ResourceTokenBag" }, position = "north", skipCentering = true, speakerSide = "right"