Convert Upgrade Sheet container to SpawnBag
Includes a minor change to record the new Minicard tag in the core file
This commit is contained in:
parent
fb93be674c
commit
901c0c5908
@ -103,6 +103,10 @@
|
||||
{
|
||||
"displayed": "to_be_deleted",
|
||||
"normalized": "to_be_deleted"
|
||||
},
|
||||
{
|
||||
"displayed": "Minicard",
|
||||
"normalized": "minicard"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -5,38 +5,11 @@
|
||||
"z": 0
|
||||
},
|
||||
"Autoraise": true,
|
||||
"Bag": {
|
||||
"Order": 0
|
||||
},
|
||||
"ColorDiffuse": {
|
||||
"b": 1,
|
||||
"g": 1,
|
||||
"r": 1
|
||||
},
|
||||
"ContainedObjects_order": [
|
||||
"Willpower.07c7ef",
|
||||
"GrizzledUpgradeSheet.0ce670",
|
||||
"DamningTestimonyUpgradeSheet.0ffb4e",
|
||||
"PocketMultiToolUpgradeSheet.179c60",
|
||||
"TheRavenQuillUpgradeSheet.1895ea",
|
||||
"HuntersArmorUpgradeSheet.1c17e1",
|
||||
"LivingLinkUpgradeSheet.2de3ee",
|
||||
"FriendsinLowPlacesUpgradeSheet.390bb4",
|
||||
"PowerWordUpgradeSheet.486fe7",
|
||||
"HonedInstinctUpgradeSheet.57b624",
|
||||
"MakeshiftTrapUpgradeSheet.5b59ca",
|
||||
"SummonedServitorUpgradeSheet.6a28d3",
|
||||
"HyperphysicalShotcasterUpgradeSheet.6beb24",
|
||||
"Intellect.73baa7",
|
||||
"AlchemicalDistillationUpgradeSheet.9d4ae0",
|
||||
"Agility.a20bba",
|
||||
"RunicAxeUpgradeSheet.b0bd49",
|
||||
"Combat.b84fe1",
|
||||
"CustomModificationsUpgradeSheet.c8aa3e",
|
||||
"SummonedServitor.d187dd",
|
||||
"EmpiricalHypothesisUpgradeSheet.d4a11a"
|
||||
],
|
||||
"ContainedObjects_path": "UpgradeSheets.c3c1a7",
|
||||
"CustomMesh": {
|
||||
"CastShadows": true,
|
||||
"ColliderURL": "",
|
||||
@ -55,7 +28,7 @@
|
||||
"MaterialIndex": 3,
|
||||
"MeshURL": "https://pastebin.com/raw/ALrYhQGb",
|
||||
"NormalURL": "",
|
||||
"TypeIndex": 6
|
||||
"TypeIndex": 0
|
||||
},
|
||||
"Description": "",
|
||||
"DragSelectable": true,
|
||||
@ -68,12 +41,10 @@
|
||||
"IgnoreFoW": false,
|
||||
"LayoutGroupSortIndex": 0,
|
||||
"Locked": true,
|
||||
"LuaScriptState_path": "UpgradeSheets.c3c1a7.luascriptstate",
|
||||
"LuaScript_path": "UpgradeSheets.c3c1a7.ttslua",
|
||||
"MaterialIndex": -1,
|
||||
"LuaScript": "require(\"playercards/spawnbag/UpgradeSheetBag\")",
|
||||
"LuaScriptState": "{\"spawnBagState\":{\"placed\":[],\"placedObjects\":[]}}",
|
||||
"MeasureMovement": false,
|
||||
"MeshIndex": -1,
|
||||
"Name": "Custom_Model_Bag",
|
||||
"Name": "Custom_Model",
|
||||
"Nickname": "Upgrade Sheets",
|
||||
"Snap": true,
|
||||
"Sticky": true,
|
||||
|
88
src/playercards/spawnbag/UpgradeSheetBag.ttslua
Normal file
88
src/playercards/spawnbag/UpgradeSheetBag.ttslua
Normal file
@ -0,0 +1,88 @@
|
||||
require("playercards/spawnbag/SpawnBag")
|
||||
|
||||
local UPGRADES_SPEC = {
|
||||
name = "UpgradeSheets",
|
||||
cards = {
|
||||
"09040-c", -- Alchemical Distillation
|
||||
"09023-c", -- Custom Modifications
|
||||
"09059-c", -- Damning Testimony
|
||||
"09041-c", -- Emperical Hypothesis
|
||||
"09060-c", -- Friends in Low Places
|
||||
"09101-c", -- Grizzled
|
||||
"09061-c", -- Honed Instinct
|
||||
"09021-c", -- Hunter's Armor
|
||||
"09119-c", -- Hyperphysical Shotcaster
|
||||
"09079-c", -- Living Ink
|
||||
"09100-c", -- Makeshift Trap
|
||||
"09099-c", -- Pocket Multi Tool
|
||||
"09081-c", -- Power Word
|
||||
"09022-c", -- Runic Axe
|
||||
"09080-c", -- Summoned Servitor
|
||||
"09042-c", -- Raven's Quill
|
||||
},
|
||||
globalPos = { x = -42.71, y = 1.5, z = 85.61 },
|
||||
rotation = { x = 0, y = 270, z = 0 },
|
||||
spread = true,
|
||||
}
|
||||
local SERVITOR_SPEC = {
|
||||
name = "SummonedServitorMini",
|
||||
cards = {
|
||||
"09080-m",
|
||||
},
|
||||
globalPos = { x = -45.84, y = 1.5, z = 53.41 },
|
||||
rotation = { x = 0, y = 270, z = 0 },
|
||||
}
|
||||
|
||||
function onLoad(savedData)
|
||||
if (savedData ~= nil) then
|
||||
local saveState = JSON.decode(savedData)
|
||||
if (saveState.spawnBagState ~= nil) then
|
||||
SpawnBag.loadFromSave(saveState.spawnBagState)
|
||||
end
|
||||
end
|
||||
createActionButtons()
|
||||
end
|
||||
|
||||
function onSave()
|
||||
local saveState = {
|
||||
spawnBagState = SpawnBag.getStateForSave(),
|
||||
}
|
||||
return JSON.encode(saveState)
|
||||
end
|
||||
|
||||
function createActionButtons()
|
||||
self.createButton({
|
||||
label="Place",
|
||||
click_function="buttonClick_place",
|
||||
function_owner=self,
|
||||
position={1,0.1,2.1},
|
||||
rotation={0,0,0},
|
||||
height=350,
|
||||
width=800,
|
||||
font_size=250,
|
||||
color={0,0,0},
|
||||
font_color={1,1,1}
|
||||
})
|
||||
self.createButton({
|
||||
label="Recall",
|
||||
click_function="buttonClick_recall",
|
||||
function_owner=self,
|
||||
position={-1,0.1,2.1},
|
||||
rotation={0,0,0},
|
||||
height=350,
|
||||
width=800,
|
||||
font_size=250,
|
||||
color={0,0,0},
|
||||
font_color={1,1,1}
|
||||
})
|
||||
end
|
||||
|
||||
function buttonClick_place()
|
||||
SpawnBag.spawn(UPGRADES_SPEC)
|
||||
SpawnBag.spawn(SERVITOR_SPEC)
|
||||
end
|
||||
|
||||
-- Recalls objects to bag from table
|
||||
function buttonClick_recall()
|
||||
SpawnBag.recall()
|
||||
end
|
Loading…
x
Reference in New Issue
Block a user