Skip to content

Instantly share code, notes, and snippets.

@sootysax
Created February 28, 2015 12:35
Show Gist options
  • Select an option

  • Save sootysax/be8bd800ff8904ca9df3 to your computer and use it in GitHub Desktop.

Select an option

Save sootysax/be8bd800ff8904ca9df3 to your computer and use it in GitHub Desktop.
Standard Placeable Fertilizer Tank LUA
--@Author: Alex2009, Sven777b
--@Web: www.alex2009.de, www.LS-Landtechnik.com
waterTankPlaceable = {};
waterTankPlaceable_mt = Class(waterTankPlaceable, Placeable);
InitObjectClass(waterTankPlaceable, "waterTankPlaceable");
function waterTankPlaceable:new(isServer, isClient, customMt)
local self = Placeable:new(isServer, isClient, waterTankPlaceable_mt);
registerObjectClassName(self, "waterTankPlaceable");
return self;
end;
function waterTankPlaceable:delete()
removeTrigger(self.SprayerFillTriggerId);
unregisterObjectClassName(self);
waterTankPlaceable:superClass().delete(self);
end;
function waterTankPlaceable:deleteFinal()
waterTankPlaceable:superClass().deleteFinal(self);
end;
function waterTankPlaceable:load(xmlFilename, x,y,z, rx,ry,rz, moveMode, initRandom)
if not waterTankPlaceable: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 waterTankPlaceable:update(dt)
end;
registerPlaceableType("waterTankPlaceable", waterTankPlaceable);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment