Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function onSave()
- local data_to_save = {
- ["SarweenToolsState"]=SarweenTools,
- ["MuaatWarSunState"]=MuaatWarSun,
- ["RegulatedConscriptionState"]=RegulatedConscription
- }
- saved_data = JSON.encode(data_to_save)
- --print(tostring(saved_data).." is saved data.")
- return saved_data
- end
- function onload(saved_data)
- setupParams = {}
- setupParams["Saar"] = {Infantry=4,Fighter=2,Cruiser=1,Carrier=2,["Space Dock"]=1}
- setupParams["Jol-nar"] = {Infantry=2,Fighter=1,Carrier=2,Dreadnought=1,["Space Dock"]=1,PDS=2}
- setupParams["Sardakk"] = {Infantry=5,Cruiser=1,Carrier=2,["Space Dock"]=1,PDS=1}
- setupParams["Hacan"] = {Infantry=4,Fighter=2,Cruiser=1,Carrier=2,["Space Dock"]=1}
- setupParams["Muaat"] = {Infantry=4,Fighter=2,["War Sun"]=1,["Space Dock"]=1}
- setupParams["Arborec"] = {Infantry=4,Fighter=2,Cruiser=1,Carrier=1,["Space Dock"]=1,PDS=1}
- setupParams["Creuss"] = {Infantry=4,Fighter=2,Destroyer=2,Carrier=1,["Space Dock"]=1}
- setupParams["Nekro"] = {Infantry=2,Fighter=2,Cruiser=1,Carrier=1,Dreadnought=1,["Space Dock"]=1}
- setupParams["Barony"] = {Infantry=3,Fighter=1,Destroyer=1,Carrier=1,Dreadnought=1,["Space Dock"]=1}
- setupParams["Sol"] = {Infantry=5,Fighter=3,Destroyer=1,Carrier=2,["Space Dock"]=1}
- setupParams["Naalu"] = {Infantry=4,Fighter=3,Destroyer=1,Cruiser=1,Carrier=1,["Space Dock"]=1,PDS=1}
- setupParams["Mentak"] = {Infantry=4,Fighter=3,Cruiser=2,Carrier=1,["Space Dock"]=1,PDS=1}
- setupParams["Yin"] = {Infantry=4,Fighter=4,Destroyer=1,Carrier=2,["Space Dock"]=1}
- setupParams["Xxcha"] = {Infantry=4,Fighter=3,Cruiser=2,Carrier=1,["Space Dock"]=1,PDS=1}
- setupParams["L1z1x"] = {Infantry=5,Fighter=3,Carrier=1,Dreadnought=1,["Space Dock"]=1,PDS=1}
- setupParams["Yssaril"] = {Infantry=5,Fighter=2,Cruiser=1,Carrier=2,["Space Dock"]=1,PDS=1}
- setupParams["Winnu"] = {Infantry=2,Fighter=2,Cruiser=1,Carrier=1,["Space Dock"]=1,PDS=1}
- ButtonsBeforeShipButtons = 9
- ConstructionIterator = 0
- ShipTable = {}
- OrderedShips = {}
- SpawnButtons()
- CreateShipObjects()
- SarweenTools = false
- RegulatedConscription = false
- MuaatWarSun = false
- if saved_data ~= nil and saved_data ~= "" then
- loaded_data = JSON.decode(saved_data)
- --print(tostring(loaded_data.MuaatWarSunState).." is MuaatWarSunState.")
- if loaded_data.MuaatWarSunState then
- ToggleMuaatWarSun()
- end
- if loaded_data.RegulatedConscriptionState then
- ToggleRegulatedConscription()
- end
- if loaded_data.SarweenToolsState then
- ToggleSarween()
- end
- end
- RecountAll()
- RecolorButtons()
- WipeButtonTooltips()
- --print(destroyer.Cost.." is the cost of a destroyer.")
- end
- function NewShip(N, C, L)
- local Ship = {}
- Ship.Name = N
- Ship.Cost = C
- Ship.Limit = L
- table.insert(ShipTable, Ship)
- return Ship
- end
- function CreateShipObjects()
- -- eventually expand this to include model file references etc
- destroyer = NewShip("Destroyer", 1, 8)
- cruiser = NewShip("Cruiser", 2, 8)
- carrier = NewShip("Carrier", 3, 4)
- dreadnought = NewShip("Dreadnought", 4, 5)
- infantry = NewShip("Infantry", 0.5, 12)
- fighter = NewShip("Fighter", 0.5, 10)
- warsun = NewShip("War Sun", 12, 2)
- flagship = NewShip("Flagship", 8, 1)
- spacedock = NewShip("Space Dock", 999, 3)
- pds = NewShip("PDS", 999, 6)
- end
- function ShipCost(ShipName)
- for v = 1, 8, 1 do
- if string.find(ShipName, ShipTable[v].Name) then
- return ShipTable[v].Cost
- end
- end
- end
- function ShipNumber(ShipName)
- for v = 1, 10, 1 do
- if string.find(ShipName, ShipTable[v].Name) then
- return v
- end
- end
- end
- function ShipLimit(ShipName)
- for v = 1, 10, 1 do
- if string.find(ShipName, ShipTable[v].Name) then
- return ShipTable[v].Limit
- end
- end
- end
- function GetShipFromBag(ShipName)
- for i, j in pairs(self.getObjects()) do
- --print(j.name)
- if j.name == ShipName then
- return j
- else
- end
- end
- return nil
- end
- function NewShipPosition(bConstruction)
- local length = #OrderedShips
- local SpawnOffset = {-5, 1, -4}
- if bConstruction then
- ConstructionIterator = ConstructionIterator + 1
- length = ConstructionIterator%14
- end
- if bConstruction then
- SpawnOffset = {-5, 1, -7}
- end
- local x = self.getPosition()[1] + SpawnOffset[1] + 2*((length-2)%2)
- local y = self.getPosition()[2] + SpawnOffset[2]
- local z = self.getPosition()[3] + SpawnOffset[3] + 1.3*math.floor(length/2)
- return {x, y, z}
- end
- function AddShipToOrder(ShipName, bConstruction)
- if GetShipFromBag(ShipName) ~= nil then
- local addingship = GetShipFromBag(ShipName)
- params = {}
- params.guid = addingship.guid
- params.position = NewShipPosition(bConstruction)
- if bConstruction ~= true then
- table.insert(OrderedShips, self.takeObject(params))
- else
- self.takeObject(params).setColorTint(self.getColorTint())
- end
- --print(ShipCost(ShipName).." is the cost of the "..ShipName.." added to the order.")
- UpdateOrderCost()
- FreezeShips()
- else
- print("You are out of "..ShipName.."!")
- end
- end
- function FreezeShips()
- for i, j in pairs(OrderedShips) do
- j.setColorTint(self.getColorTint())
- j.interactable = false
- j.highlightOn({0.9,0.7,0.7})
- end
- end
- function ClearShips()
- for i, j in pairs(OrderedShips) do
- Wait.time(function() RemoveShipFromOrder(j.getName()) end, i*0.1)
- end
- end
- function RemoveShipFromOrder(ShipName)
- for i, j in pairs(OrderedShips) do
- if j.getName() == ShipName then
- table.remove(OrderedShips, i)
- j.setPositionSmooth({self.getPosition()[1], self.getPosition()[2]+2, self.getPosition()[3]})
- j.interactable = true
- UpdateOrderCost()
- return true
- end
- end
- end
- function UpdateOrderCost()
- local TotalOrderCost = 0
- if SarweenTools == true then
- TotalOrderCost = -1
- end
- for i, j in pairs (OrderedShips) do
- TotalOrderCost = TotalOrderCost + ShipCost(j.getName())
- end
- --function to update display
- self.editButton({
- index = 0,
- label = TotalOrderCost
- })
- self.editButton({
- index = 1,
- label = #OrderedShips
- })
- return TotalOrderCost
- end
- function PurchaseShips(o, color, a)
- Purchaser = Player[color].steam_name
- PurchaserColorRGB = stringColorToRGB(color)
- PurchaserColorHex = HexColor(color)
- for i, j in pairs(OrderedShips) do
- j.interactable = true
- j.highlightOff()
- end
- PurchasedShips = ""
- for v = 1, 10, 1 do
- local countship = 0
- for i, j in pairs(OrderedShips) do
- if ShipTable[v].Name == j.getName() then
- countship = countship + 1
- end
- end
- if countship > 0 then
- PurchasedShips = PurchasedShips..countship.."x "..ShipTable[v].Name.."; "
- end
- end
- broadcastToAll ("["..PurchaserColorHex.."]"..Purchaser.."[ffffff] is buying: "..PurchasedShips.."costing "..UpdateOrderCost().." Resources and requiring Production "..#OrderedShips..".")
- OrderedShips = {}
- UpdateOrderCost()
- end
- function SpawnButtons()
- --========================================
- -- MAIN BUTTONS
- --========================================
- local bcolor = {0,0,0}
- local bfontcolour = self.getColorTint()
- local by = 0
- local bz = 2
- local bx = 1
- --========================================
- --This one is the Cost number:
- self.createButton({
- label="0",
- click_function="Nada",
- function_owner = self,
- position={bx-0.5,by,bz},
- height=500,
- width=500,
- font_size=200,
- color = bcolor,
- font_color = bfontcolour
- })
- --This one is the Production number:
- self.createButton({
- label="0",
- click_function="Nada",
- function_owner = self,
- position={bx-0.5,by,bz+1},
- height=500,
- width=500,
- font_size=200,
- color = bcolor,
- font_color = bfontcolour
- })
- self.createButton({
- label="Purchase Order",
- click_function="PurchaseShips",
- function_owner = self,
- position={bx-2,by,bz+2},
- height=500,
- width=1000,
- font_size=120,
- color = bcolor,
- font_color = bfontcolour
- })
- self.createButton({
- label="Clear Order",
- click_function="ClearShips",
- function_owner = self,
- position={bx-2,by,bz+3},
- height=500,
- width=1000,
- font_size=150,
- color = bcolor,
- font_color = bfontcolour
- })
- self.createButton({
- label="Production: ",
- click_function="Nada",
- function_owner = self,
- position={bx-2,by,bz+1},
- height=500,
- width=1000,
- font_size=150,
- color = bcolor,
- font_color = bfontcolour
- })
- self.createButton({
- label="Resources: ",
- click_function="Nada",
- function_owner = self,
- position={bx-2,by,bz},
- height=500,
- width=1000,
- font_size=150,
- color = bcolor,
- font_color = bfontcolour
- })
- self.createButton({
- label="Sarween Tools Off",
- click_function="ToggleSarween",
- function_owner = self,
- position={bx-0.5,by,bz+1.75},
- height=250,
- width=500,
- font_size=30,
- color = bcolor,
- font_color = bfontcolour
- })
- self.createButton({
- label="Reg. Conscription Off",
- click_function="ToggleRegulatedConscription",
- function_owner = self,
- position={bx-0.5,by,bz+2.75},
- height=250,
- width=500,
- font_size=30,
- color = bcolor,
- font_color = bfontcolour
- })
- self.createButton({
- label="Muaat Upgraded War Sun Off",
- click_function="ToggleMuaatWarSun",
- function_owner = self,
- position={bx-0.5,by,bz+3.25},
- height=250,
- width=500,
- font_size=30,
- color = bcolor,
- font_color = bfontcolour
- })
- SarweenButtonIndex = 6
- RegulatedConscriptionButtonIndex = 7
- MuaatButtonIndex = 8
- --========================================
- -- SHIP BUTTONS
- --========================================
- local bwidth = 800
- local bheight = 250
- local boffset = {-2.8,0,1.75}
- local bgap = 0.5
- local bi = 0
- local fontsize = 100
- --========================================
- self.createButton({
- label="Destroyer",
- click_function='Destroyer',
- function_owner = self,
- position={boffset[1],boffset[2],boffset[3]+bgap*bi},
- height=bheight,
- width=bwidth,
- font_size=fontsize,
- color = bcolor,
- font_color = self.getColorTint()
- })
- bi = bi + 1
- --O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O
- self.createButton({
- label="Cruiser",
- click_function='Cruiser',
- function_owner = self,
- position={boffset[1],boffset[2],boffset[3]+bgap*bi},
- height=bheight,
- width=bwidth,
- font_size=fontsize,
- color = bcolor,
- font_color = bfontcolour
- })
- bi = bi + 1
- --O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O
- self.createButton({
- label="Carrier",
- click_function='Carrier',
- function_owner = self,
- position={boffset[1],boffset[2],boffset[3]+bgap*bi},
- height=bheight,
- width=bwidth,
- font_size=fontsize,
- color = bcolor,
- font_color = bfontcolour
- })
- bi = bi + 1
- --O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O
- self.createButton({
- label="Dreadnought",
- click_function='Dreadnought',
- function_owner = self,
- position={boffset[1],boffset[2],boffset[3]+bgap*bi},
- height=bheight,
- width=bwidth,
- font_size=fontsize-30,
- color = bcolor,
- font_color = bfontcolour
- })
- bi = bi + 1
- --O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O
- self.createButton({
- label="Infantry",
- click_function='Infantry',
- function_owner = self,
- position={boffset[1],boffset[2],boffset[3]+bgap*bi},
- height=bheight,
- width=bwidth,
- font_size=fontsize,
- color = bcolor,
- font_color = bfontcolour
- })
- bi = bi + 1
- --O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O
- self.createButton({
- label="Fighter",
- click_function='Fighter',
- function_owner = self,
- position={boffset[1],boffset[2],boffset[3]+bgap*bi},
- height=bheight,
- width=bwidth,
- font_size=fontsize,
- color = bcolor,
- font_color = bfontcolour
- })
- bi = bi + 1
- --O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O
- self.createButton({
- label="War Sun",
- click_function='WarSun',
- function_owner = self,
- position={boffset[1],boffset[2],boffset[3]+bgap*bi},
- height=bheight,
- width=bwidth,
- font_size=fontsize,
- color = bcolor,
- font_color = bfontcolour
- })
- bi = bi + 1
- --O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O
- self.createButton({
- label="Flagship",
- click_function='Flagship',
- function_owner = self,
- position={boffset[1],boffset[2],boffset[3]+bgap*bi},
- height=bheight,
- width=bwidth,
- font_size=fontsize,
- color = bcolor,
- font_color = bfontcolour
- })
- bi = bi + 1
- --O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O
- self.createButton({
- label="Space Dock",
- click_function='SpaceDock',
- function_owner = self,
- position={bx+2,by,bz},
- height=500,
- width=1000,
- font_size=150,
- color = bcolor,
- font_color = bfontcolour
- })
- self.createButton({
- label="PDS",
- click_function='PDS',
- function_owner = self,
- position={bx+2,by,bz+1},
- height=500,
- width=1000,
- font_size=150,
- color = bcolor,
- font_color = bfontcolour
- })
- end
- --O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O--O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O--O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O--O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O
- --O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O--O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O--O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O
- --O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O--O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O
- function SpaceDock(o, c, a)
- local name = "Space Dock"
- if a then
- RemoveShipFromOrder(name, true)
- else
- AddShipToOrder(name, true)
- end
- Recount(name)
- Wait.time(function() Recount(name) end, 2)
- end
- --O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O--O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O
- --O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O--O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O--O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O
- --O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O--O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O
- function PDS(o, c, a)
- local name = "PDS"
- if a then
- RemoveShipFromOrder(name, true)
- else
- AddShipToOrder(name, true)
- end
- Recount(name)
- Wait.time(function() Recount(name) end, 2)
- end
- --O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O--O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O
- --O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O--O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O--O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O
- --O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O--O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O--O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O--O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O
- function Destroyer(o, c, a)
- local name = "Destroyer"
- if a then
- RemoveShipFromOrder(name, false)
- else
- AddShipToOrder(name, false)
- end
- Recount(name)
- Wait.time(function() Recount(name) end, 2)
- end
- --O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O
- function Cruiser(o, c, a)
- local name = "Cruiser"
- if a then
- RemoveShipFromOrder(name, false)
- else
- AddShipToOrder(name, false)
- end
- Recount(name)
- Wait.time(function() Recount(name) end, 2)
- end
- --O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O
- function Carrier(o, c, a)
- local name = "Carrier"
- if a then
- RemoveShipFromOrder(name, false)
- else
- AddShipToOrder(name, false)
- end
- Recount(name)
- Wait.time(function() Recount(name) end, 2)
- end
- --O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O
- function Dreadnought(o, c, a)
- local name = "Dreadnought"
- if a then
- RemoveShipFromOrder(name, false)
- else
- AddShipToOrder(name, false)
- end
- Recount(name)
- Wait.time(function() Recount(name) end, 2)
- end
- --O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O
- function Infantry(o, c, a)
- local name = "Infantry"
- if a then
- RemoveShipFromOrder(name, false)
- else
- AddShipToOrder(name, false)
- end
- Recount(name)
- Wait.time(function() Recount(name) end, 2)
- end
- --O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O
- function Fighter(o, c, a)
- local name = "Fighter"
- if a then
- RemoveShipFromOrder(name, false)
- else
- AddShipToOrder(name, false)
- end
- Recount(name)
- Wait.time(function() Recount(name) end, 2)
- end
- --O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O
- function WarSun(o, c, a)
- local name = "War Sun"
- if a then
- RemoveShipFromOrder(name, false)
- else
- AddShipToOrder(name, false)
- end
- Recount(name)
- Wait.time(function() Recount(name) end, 2)
- end
- --O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O
- function Flagship(o, c, a)
- local name = "Flagship"
- if a then
- RemoveShipFromOrder(name, false)
- else
- AddShipToOrder(name, false)
- end
- Recount(name)
- Wait.time(function() Recount(name) end, 2)
- end
- --O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O=O
- function Recount(name)
- local count = 0
- for i, j in pairs(self.getObjects()) do
- if j.name == name then
- count = count + 1
- end
- end
- if count == ShipLimit(name) then
- self.editButton({
- index = ButtonsBeforeShipButtons + ShipNumber(name) -1,
- label = name
- })
- else
- self.editButton({
- index = ButtonsBeforeShipButtons + ShipNumber(name) -1,
- label = name.." ("..count.."/"..ShipLimit(name)..")"
- })
- end
- end
- function onObjectEnterContainer(bag, obj)
- if bag == self then
- RecountAll()
- RecolorButtons()
- if string.find(obj.getName(), "Command Token") then
- FactionName = string.sub(obj.getName(), 0, string.len(obj.getName())-14)
- --print(FactionName)
- FactionSpawn(ReturnFactionShips(FactionName))
- EjectCommandTokens()
- end
- end
- end
- function onObjectLeaveContainer(bag, obj)
- if bag == self then
- RecountAll()
- RecolorButtons()
- --obj.setScale({1,1,1})
- end
- end
- function Nada()
- end
- function RecountAll()
- for i, j in pairs(ShipTable) do
- Recount(j.Name)
- end
- UpdateOrderCost()
- end
- function HexColor(colorString)
- local colorTable = stringColorToRGB(colorString)
- colorTable = {colorTable[1]*255,colorTable[2]*255,colorTable[3]*255}
- local colorHex = string.format('%02x%02x%02x', unpack(colorTable))
- return colorHex
- end
- function ToggleRegulatedConscription()
- RegulatedConscription = not RegulatedConscription
- if RegulatedConscription == true then
- self.editButton({index = RegulatedConscriptionButtonIndex, label = "Regulated Conscription On", color = {0.2,0.8,0.2}})
- fighter.Cost = 1
- infantry.Cost = 1
- else
- self.editButton({index = RegulatedConscriptionButtonIndex, label = "Regulated Conscription Off", color = {0,0,0}})
- fighter.Cost = 0.5
- infantry.Cost = 0.5
- end
- RecountAll()
- end
- function ToggleMuaatWarSun()
- MuaatWarSun = not MuaatWarSun
- if MuaatWarSun == true then
- self.editButton({index = MuaatButtonIndex, label = "Muaat Upgraded War Sun On", color = {0.2,0.8,0.2}})
- warsun.Cost = 10
- else
- self.editButton({index = MuaatButtonIndex, label = "Muaat Upgraded War Sun Off", color = {0,0,0}})
- warsun.Cost = 12
- end
- RecountAll()
- end
- function ToggleSarween()
- SarweenTools = not SarweenTools
- if SarweenTools == true then
- self.editButton({index = SarweenButtonIndex, label = "Sarween Tools On", color = {0.2,0.8,0.2}})
- else
- self.editButton({index = SarweenButtonIndex, label = "Sarween Tools Off", color = {0, 0, 0}})
- end
- UpdateOrderCost()
- RecountAll()
- end
- function RecolorButtons()
- for i, j in pairs(self.getButtons()) do
- self.editButton({
- index = j.index,
- font_color = self.getColorTint()
- })
- end
- end
- function WipeButtonTooltips()
- for i, j in pairs(self.getButtons()) do
- self.editButton({
- index = j.index,
- tooltip = ""
- })
- end
- end
- function FactionSpawn(FactionShips)
- for i, j in pairs(FactionShips) do
- AddShipToOrder(j, true)
- end
- end
- function ReturnFactionShips(Faction)
- local FactionShips = {}
- for i, j in pairs(ShipTable) do
- if setupParams[Faction][j.Name] ~= nil then
- for v = 1, setupParams[Faction][j.Name], 1 do
- table.insert(FactionShips, j.Name)
- end
- end
- end
- return FactionShips
- end
- function EjectCommandTokens()
- for i, j in pairs(self.getObjects()) do
- if string.find(j.name, "Command Token") then
- params = {}
- params.guid = j.guid
- params.position = {self.getPosition()[1], self.getPosition()[2], self.getPosition()[3]+3}
- self.takeObject(params).setColorTint(self.getColorTint())
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement