updated description and skip for campaign log / guide if not campaign box

This commit is contained in:
Chr1Z93 2024-10-26 14:41:32 +02:00
parent 937cf72b8c
commit cbc62b9ec9
2 changed files with 24 additions and 22 deletions

View File

@ -31,7 +31,7 @@
"ImageURL": "https://steamusercontent-a.akamaihd.net/ugc/2503508192913854749/B7CFE8596F3ED5BCEBD3CD59DF1CE88991AA923F/", "ImageURL": "https://steamusercontent-a.akamaihd.net/ugc/2503508192913854749/B7CFE8596F3ED5BCEBD3CD59DF1CE88991AA923F/",
"WidthScale": 0 "WidthScale": 0
}, },
"Description": "Saves the state of the table to enable loading the campaign into a new save and keep all current progress.\n\nThis tool will track which campaign you're playing, the entire contents of your campaign log, the contents of your chaos bag, update your health/sanity according to trauma, your ArkhamDB deck IDs, the number of investigators, the page of your campaign guide, cards in the Additional Player Cards bag and any options you have selected in the options panel.\n\nFor saving trauma values to correct seats, ensure investigators in the campaign log are in the following order: White, Orange, Green, Red\n\nFor custom campaigns, ensure: 1) Campaign Box, Campaign Log, and Campaign Guide each have the corresponding tag, 2)The Campaign Box is on the table when you import or export.", "Description": "This tool will allow you to export a lot of mod-internal settings and the state of a campaign.\n\nInstructions:\n1) Make sure the Campaign Box is downloaded and on the table\n2) Press 'Export' to create a coin with the data or place a coin to load its data",
"DragSelectable": true, "DragSelectable": true,
"GMNotes": "", "GMNotes": "",
"GUID": "334ee3", "GUID": "334ee3",

View File

@ -21,7 +21,7 @@ local saveTokenData = {
scaleY = 2, scaleY = 2,
scaleZ = 2 scaleZ = 2
}, },
Description = "SCED Importer Token", Description = "SCED Importer Token\n\nSave me (Right-Click: Save as object)! Then you can import me on any fresh game to apply the saved settings / campaign state.",
Tags = { "ImporterToken" }, Tags = { "ImporterToken" },
CustomMesh = { CustomMesh = {
MeshURL = "https://steamusercontent-a.akamaihd.net/ugc/943949966265929204/A38BB5D72419E6298385556D931877C0A1A55C17/", MeshURL = "https://steamusercontent-a.akamaihd.net/ugc/943949966265929204/A38BB5D72419E6298385556D931877C0A1A55C17/",
@ -248,30 +248,32 @@ function exportToToken()
-- need to reset the contained objects to support multiple exports -- need to reset the contained objects to support multiple exports
saveTokenData.ContainedObjects = {} saveTokenData.ContainedObjects = {}
-- save campaign log if present if campaignBox then
local campaignLog = findUniqueObjectWithTag("CampaignLog") -- save campaign log if present
if campaignLog then local campaignLog = findUniqueObjectWithTag("CampaignLog")
local logData = campaignLog.getData() if campaignLog then
logData.Locked = false local logData = campaignLog.getData()
table.insert(saveTokenData.ContainedObjects, logData) logData.Locked = false
table.insert(saveTokenData.ContainedObjects, logData)
-- maybe also extract the trauma values -- maybe also extract the trauma values
local trauma = campaignLog.getVar("returnTrauma") local trauma = campaignLog.getVar("returnTrauma")
if trauma then if trauma then
printToAll("Trauma values found in campaign log!", "Green") printToAll("Trauma values found in campaign log!", "Green")
dataToSave.trauma = {} dataToSave.trauma = {}
for _, val in ipairs(campaignLog.call("returnTrauma")) do for _, val in ipairs(campaignLog.call("returnTrauma")) do
table.insert(dataToSave.trauma, val) table.insert(dataToSave.trauma, val)
end
else
printToAll("Trauma values could not be found in campaign log!", "Yellow")
end end
else
printToAll("Trauma values could not be found in campaign log!", "Yellow")
end end
end
-- store campaign guide page if present -- store campaign guide page if present
local campaignGuide = findUniqueObjectWithTag("CampaignGuide") local campaignGuide = findUniqueObjectWithTag("CampaignGuide")
if campaignGuide then if campaignGuide then
dataToSave.guide = campaignGuide.Book.getPage() dataToSave.guide = campaignGuide.Book.getPage()
end
end end
-- store the additional index if there are any cards in it -- store the additional index if there are any cards in it