Code:
preludeStage = false
function onload()
titleText = getObjectFromGUID('082b95')
ancientBag = getObjectFromGUID('996e2e')
end
function wrapUp()
if preludeStage == false then
buttonList = self.getButtons()
for i=0,#buttonList do
self.removeButton(i)
end
titleText.setValue('Choose a difficulty and set up an Ancient One')
local ancientPos = ancientBag.getPosition()
local currentPos = self.getPosition()
ancientBag.setPosition(currentPos)
self.setPosition(ancientPos)
ancientBag.setRotation({x=0,y=180,z=0})
Global.setVar('ancientExists',false)
ancientBag.shuffle()
ancientBag.createButton({
position = {-3,0.25,4.5},
height = 700,
width = 1700,
font_size = 500,
label = 'Normal',
click_function = 'setupNormal',
function_owner = self
})
ancientBag.createButton({
position = {3,0.25,4.5},
height = 700,
width = 1700,
font_size = 500,
label = 'Hard',
click_function = 'setupHard',
function_owner = self
})
else
local selfButtons = self.getButtons()
for i,v in pairs(selfButtons) do
self.removeButton(v.index)
end
self.createButton({
position = {-7,2,0},
height = 1500,
width = 3000,
font_size = 1700,
label = 'Draw 3',
click_function = 'draw3',
function_owner = self
})
self.createButton({
position = {7,2,0},
height = 1500,
width = 3000,
font_size = 1700,
label = 'Draw 4',
click_function = 'draw4',
function_owner = self
})
self.createButton({
position = {0,0.25,10},
height = 1500,
width = 3000,
font_size = 1700,
label = 'Done',
click_function = 'wrapUp',
function_owner = self
})
titleText.setValue('Draw and set up investigators')
preludeStage = false
local chosenPrelude = Global.getVar('chosenPrelude')
if chosenPrelude == 'Lurker Among Us' then
local drawParams = {
drawFrom = self,
drawCoords = {x=-34.57,y= 1.16, z=-23.32},
drawRotation = {0,180,180},
shuffle = true,
callback = 'dl',
callbackOwner = Global,
drawSearch = 'Mark Harrigan'
}
local lurkerInv = Global.call('drawCard', drawParams)
print(lurkerInv.getName())
local setupParams = lurkerInv.getTable('setupParams')
print(setupParams==nil)
for i, v in pairs(setupParams) do
print(i)
end
Global.call('setupInvestigator', setupParams)
printToAll('lol',{1,1,1})
drawParams = {
drawFrom = Global.getVar('assetBag'),
drawTo = lurkerInv,
shuffle = true,
drawRotation = {x=0,y=180,z=180},
}
Global.call('drawCard', drawParams)
Global.call('getClue', lurkerInv)
Global.setTable('preludeInfo', lurkerInv.getTable('setupParams.location[1].gate'))
end
end
end
EDIT: