Jump to content

Modding help: Error: Attempt to call a boolean value


Recommended Posts

heres in essence what i wrote in the prefab file for supposed modded structure, excluding all irrelevant parts:

 

local function fn()

   if inst.components.moddedStructureComponent:isComplete() then

   end

   if inst.components.moddedStructureComponent:isIncomplete() then  --line 123

   end

end

 

meanwhile heres in essence what I wrote in the component that was mentioned above:

 

local moddedStructureComponent = Class(function(self, inst)

    self.progressOnConstruction = 0

   self.isIncomplete = (self.progressOnConstruction==0)
end)

 

function moddedStructureComponent:isComplete()

   local isComplete = (self.progressOnConstruction == 1)

   return isComplete

end

 

function moddedStructureComponent:isIncomplete()

   return self.isIncomplete

end

 

heres what in essence is on the error screen:

 

/moddedStructure.lua Line 123 Attempt to call "isIncomplete" (a boolean value)

 

Heres my question, how come the if-condition calling for isComplete() has no problem meanwhile the if-condition calling for isIncomplete has a problem?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...