Created
February 28, 2015 12:40
-
-
Save sootysax/f74da0abf7eb1cd94b7b to your computer and use it in GitHub Desktop.
Custom Fertilizer PK Tank LUA
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --@Author: Alex2009, Sven777b | |
| --@Web: www.alex2009.de, www.LS-Landtechnik.com | |
| fertTankPlaceablePK = {}; | |
| fertTankPlaceablePK_mt = Class(fertTankPlaceablePK, Placeable); | |
| InitObjectClass(fertTankPlaceablePK, "fertTankPlaceablePK"); | |
| function fertTankPlaceablePK:new(isServer, isClient, customMt) | |
| local self = Placeable:new(isServer, isClient, fertTankPlaceablePK_mt); | |
| registerObjectClassName(self, "fertTankPlaceablePK"); | |
| return self; | |
| end; | |
| function fertTankPlaceablePK:delete() | |
| removeTrigger(self.SprayerFillTriggerId); | |
| unregisterObjectClassName(self); | |
| fertTankPlaceablePK:superClass().delete(self); | |
| end; | |
| function fertTankPlaceablePK:deleteFinal() | |
| fertTankPlaceablePK:superClass().deleteFinal(self); | |
| end; | |
| function fertTankPlaceablePK:load(xmlFilename, x,y,z, rx,ry,rz, moveMode, initRandom) | |
| if not fertTankPlaceablePK:superClass().load(self, xmlFilename, x,y,z, rx,ry,rz, moveMode, initRandom) then | |
| return false; | |
| end; | |
| local xmlFile = loadXMLFile("TempXML", xmlFilename); | |
| self.SprayerFillTriggerId = Utils.indexToObject(self.nodeId, getXMLString(xmlFile, "placeable.FillTrigger#index")); | |
| FillTrigger:onCreate(self.SprayerFillTriggerId); | |
| delete(xmlFile); | |
| return true; | |
| end; | |
| function fertTankPlaceablePK:update(dt) | |
| end; | |
| registerPlaceableType("fertTankPlaceablePK", fertTankPlaceablePK); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment