-18 points.
IF YOU ARE MAKING A SPACE MODE WITH CRITICAL SYSTEMS, THIS IS VERY IMPORTANT!!!!!!!!
Here's how to fix it. (It's really easy)
Code: Select all
LinkedDestroyables =
{
objectSets = nil,
New = function(self, o)
o = o or {}
setmetatable(o, self)
self.__index = self
return o
end,
Init = function(self)
--------------------
-- Local functions
--
local ObjectKilled = function(setIndex)
for _, objectName in pairs(self.objectSets[setIndex]) do
if IsObjectAlive(objectName) then
return
end
end
--if you reach reach here, all the objects in the set are dead, so
--we need to now go and kill all the objects in the other sets
for setIdx, set in pairs(self.objectSets) do
if setIdx ~= setIndex then
for _, objectName in pairs(set) do
if IsObjectAlive(objectName) then
SetProperty(objectName, "Team", 0) --<---INSERT THIS LINE!
KillObject(objectName)
Edit: Clarification: this makes it so when the external system is destroyed the just internal system becomes 0 points and vice versa. So points are only awarded to the player who ultimately triggered the destruction.