Minor improvements with token generation and identification
This commit is contained in:
parent
ab42241199
commit
200b85829e
@ -25,6 +25,9 @@ local campaignTokenData = {
|
|||||||
g = 1.0,
|
g = 1.0,
|
||||||
b = 1.0
|
b = 1.0
|
||||||
},
|
},
|
||||||
|
Tags = {
|
||||||
|
"ImporterToken"
|
||||||
|
},
|
||||||
LayoutGroupSortIndex = 0,
|
LayoutGroupSortIndex = 0,
|
||||||
Value = 0,
|
Value = 0,
|
||||||
Locked = false,
|
Locked = false,
|
||||||
@ -106,7 +109,7 @@ end
|
|||||||
function findCampaignFromToken(_, _, _)
|
function findCampaignFromToken(_, _, _)
|
||||||
local coin = nil
|
local coin = nil
|
||||||
for _, obj in ipairs(tokenZone.getObjects()) do
|
for _, obj in ipairs(tokenZone.getObjects()) do
|
||||||
if obj.getDescription() == "SCED Importer Token" then
|
if obj.hasTag("ImporterToken") then
|
||||||
coin = obj
|
coin = obj
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -183,10 +186,12 @@ function createCampaignToken(_, _, _)
|
|||||||
end
|
end
|
||||||
campaignData = {campaignBoxGUID, campaignLog.getData(), chaosBag.getData()}
|
campaignData = {campaignBoxGUID, campaignLog.getData(), chaosBag.getData()}
|
||||||
campaignTokenData.GMNotes = JSON.encode(campaignData)
|
campaignTokenData.GMNotes = JSON.encode(campaignData)
|
||||||
|
campaignTokenData.Nickname = getObjectFromGUID(campaignBoxGUID).getName() .. os.date(" Save: %b %d")
|
||||||
spawnObjectData({
|
spawnObjectData({
|
||||||
data = campaignTokenData,
|
data = campaignTokenData,
|
||||||
position = {-21.25, 1.68, 55.59}
|
position = {-21.25, 1.68, 55.59}
|
||||||
})
|
})
|
||||||
|
broadcastToAll("Campaign successfully exported! Save coin object to import on a fresh save", Color.Green)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user