User Tools

Site Tools


custom-building-function

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
custom-building-function [2022/04/29 20:44] minotoriouscustom-building-function [2022/04/30 19:23] (current) minotorious
Line 31: Line 31:
 For example below we set up a function that upon activation logs its properties and upon reload executes a back-call to its activation function. For example below we set up a function that upon activation logs its properties and upon reload executes a back-call to its activation function.
 <code lua> <code lua>
-function BUILDING_FUNCTION_ROOF_TOGGLE:activateBuilding(gameObject)+function MY_BUILDING_FUNCTION:activateBuilding(gameObject)
     mod:log("Property1: " .. tostring(self.Property1))     mod:log("Property1: " .. tostring(self.Property1))
     mod:log("Property2: " .. tostring(self.Property2))     mod:log("Property2: " .. tostring(self.Property2))
     mod:log("Property3: " .. tostring(self.Property3))     mod:log("Property3: " .. tostring(self.Property3))
 +    
 +    return true
 end end
  
-function BUILDING_FUNCTION_ROOF_TOGGLE:reloadBuildingFunction(gameObject)+function MY_BUILDING_FUNCTION:reloadBuildingFunction(gameObject)
     self:activateBuilding(gameObject)     self:activateBuilding(gameObject)
 end end
custom-building-function.1651279453.txt.gz · Last modified: 2022/04/29 20:44 by minotorious

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki