Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function onload()
- gameBox_GUID = '03ceb9'
- astNebBag_GUID = '59ff75'
- expTokenBag_GUID = '011cd7'
- fourPlayBd_GUID = '9431a0'
- sixPlayBd_GUID = '52f496'
- layoutZone_GUID = '248cd5'
- activeCardZone_GUID = '3b9c80'
- testZone_GUID = 'a12b0c'
- --Setup Button
- self.createButton(
- {click_function='setupBoard', function_owner=self, label='Setup',
- position={0,0.1,0.9}, rotation={0,0,0}, width=300, height=225, font_size=100,
- scale={0.8,0.8,0.8}}
- )
- --Clear Zone
- self.createButton(
- {click_function='clearBoard', function_owner=self, label='Clear',
- position={1.3,0.1,0.9}, rotation={0,0,0}, width=300, height=225, font_size=100,
- scale={0.8,0.8,0.8}}
- )
- end
- function setupBoard()
- print('Setup layout function is called')
- --Locate the scripting zone by its GUID, since this will not change
- --Get the GUID by using the scripting zone tool and right clicking a zone
- local zone = getObjectFromGUID(activeCardZone_GUID)
- --Get a list of any objects which are inside of the zone.
- local activeCard = zone.getObjects()
- --Check if the table we made is empty due to the zone being empty
- if #activeCard == 0 then
- --What prints if the scripting zone was empty
- print("Please Select a Layout Card and place it in the Active Zone")
- else
- --If it isn't empty, we use a for loop to look at each entry in the list
- for _, card in ipairs(activeCard) do
- --Find the name of the object
- activeCard = card.getName()
- --Then check if it had a name or not
- print(activeCard .. " found.")
- end
- end
- --This will pull the data table for the active cardName
- for layout, DataTable in pairs(ref_layoutPositions) do
- if layout == activeCard then
- print('Active card table found!')
- for _, entries in ipairs(DataTable) do
- gameBox = getObjectFromGUID(gameBox_GUID)
- gameBox.takeObject({
- guid = enteries.guid_object,
- position = enteries.pos_object,
- rotation = enteries.rot_object
- })
- end
- else
- print('Active card table ignored!')
- end
- end
- end
- function clearBoard()
- print('Clear layout function is called')
- end
- -- {guid_object="", pos_object=, rot_object=},
- ref_layoutPositions = {
- ["Default Setup"] = {
- --Gameboard
- --{guid_object="0e46ea", pos_object={0.00, 1.03, -0.33}, rot_object={0.00, 180.00, 0.00}},
- --Astroids
- --{guid_object="c5044f", pos_object={-4.52, 2.02, -8.50}, rot_object={0.00, 210.00, 180.00}},
- --{guid_object="5b2eba", pos_object={-7.54, 2.02, -4.04}, rot_object={0.00, 300.00, 180.00}},
- --{guid_object="4a6cb9", pos_object={-6.39, 2.02, 5.40}, rot_object={0.00, 60.00, 180.00}},
- --{guid_object="e11258", pos_object={5.20, 2.02, -6.07}, rot_object={0.00, 240.00, 180.00}},
- --{guid_object="ff141b", pos_object={7.53, 2.02, 2.65}, rot_object={0.00, 120.03, 180.00}},
- --{guid_object="a76763", pos_object={4.52, 2.02, 7.14}, rot_object={0.00, 30.00, 180.00}},
- --Planets
- {guid_object="34e575", pos_object={-8.45, 1.97, -4.88}, rot_object={0.00, 90.00, 0.00}},
- {guid_object="66a675", pos_object={-4.83, 1.97, 8.37}, rot_object={0.00, 90.00, 0.00}},
- {guid_object="756716", pos_object={0.00, 1.97, 0.00}, rot_object={0.00, 90.00, 0.00}},
- {guid_object="35f461", pos_object={3.62, 1.97, -9.06}, rot_object={0.00, 90.00, 0.00}},
- {guid_object="ea9422", pos_object={8.45, 1.97, 4.88}, rot_object={0.00, 90.00, 0.00}},
- --Colony Stations
- --{guid_object="61f4e9", pos_object={-10.87, 1.97, -10.46}, rot_object={0.00, 330.00, 0.00}},
- --{guid_object="d428e7", pos_object={-10.87, 1.97, 10.46}, rot_object={0.00, 0.00, 0.00}},
- --{guid_object="c69557", pos_object={10.87, 1.97, -10.46}, rot_object={0.00, 330.00, 0.00}},
- --{guid_object="ff979d", pos_object={10.87, 1.97, 10.46}, rot_object={0.00, 90.00, 0.00}},
- },
- ["Layout02"] = {
- {guid_object="0e46ea", pos_object={0.00, 1.03, -0.33}, rot_object={0.00, 180.00, 0.00}},
- },
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement