From 200b85829e6c68e55edc3f11e0ad53ee6a1604eb Mon Sep 17 00:00:00 2001 From: Jorge Parra Date: Sun, 19 Mar 2023 14:49:10 -0400 Subject: [PATCH] Minor improvements with token generation and identification --- src/accessories/CampaignImporterExporter.ttslua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/accessories/CampaignImporterExporter.ttslua b/src/accessories/CampaignImporterExporter.ttslua index 5f6b2485..d385446c 100644 --- a/src/accessories/CampaignImporterExporter.ttslua +++ b/src/accessories/CampaignImporterExporter.ttslua @@ -25,6 +25,9 @@ local campaignTokenData = { g = 1.0, b = 1.0 }, + Tags = { + "ImporterToken" + }, LayoutGroupSortIndex = 0, Value = 0, Locked = false, @@ -106,7 +109,7 @@ end function findCampaignFromToken(_, _, _) local coin = nil for _, obj in ipairs(tokenZone.getObjects()) do - if obj.getDescription() == "SCED Importer Token" then + if obj.hasTag("ImporterToken") then coin = obj end end @@ -183,10 +186,12 @@ function createCampaignToken(_, _, _) end campaignData = {campaignBoxGUID, campaignLog.getData(), chaosBag.getData()} campaignTokenData.GMNotes = JSON.encode(campaignData) + campaignTokenData.Nickname = getObjectFromGUID(campaignBoxGUID).getName() .. os.date(" Save: %b %d") spawnObjectData({ data = campaignTokenData, position = {-21.25, 1.68, 55.59} }) + broadcastToAll("Campaign successfully exported! Save coin object to import on a fresh save", Color.Green) end