Script v1.7.1.0
- AI
- Animals
- Contracts
- Debug
- Economy
- Effects
- Events
- Farms
- GUI
- Handtools
- I3d
- Materials
- Misc
- Objects
- Placeables
- AnimalHusbandry
- BeehivePlaceable
- BgaPlaceable
- BunkerSiloPlaceable
- BuyingStationPlaceable
- Doghouse
- FarmhousePlaceable
- GreenhousePlaceable
- HeatingPlantPlaceable
- HusbandryModuleWater
- Placeable
- SellingStationPlaceable
- SiloExtensionPlaceable
- SiloPlaceable
- SolarCollectorPlaceable
- WindTurbinePlaceable
- WoodSellStationPlaceable
- Player
- Shop
- Sounds
- Specializations
- Triggers
- Utils
- Vehicles
- Weather
Engine v1.7.1.0
- AI
- Animation
- Camera
- Entity
- Fillplanes
- General
- I3D
- Input
- Lighting
- Math
- Network
- Node
- Overlays
- Particle System
- Physics
- Rendering
- Scenegraph
- Shape
- Sound
- Spline
- String
- Terrain Detail
- Text Rendering
- Tire Track
- XML
- general
Foundation Reference
BeehivePlaceable
DescriptionClass for placeable beehivesParent
PlaceableFunctions
delete
DescriptionDeleting placeable beehiveDefinition
delete()Code
31 | function BeehivePlaceable:delete() |
32 | unregisterObjectClassName(self) |
33 | g_currentMission.environment:removeHourChangeListener(self) |
34 | if self.particleSystem ~= nil then |
35 | ParticleUtil.deleteParticleSystem(self.particleSystem) |
36 | end |
37 | BeehivePlaceable:superClass().delete(self) |
38 | end |
hourChanged
DescriptionCalled if hour changedDefinition
hourChanged()Code
68 | function BeehivePlaceable:hourChanged() |
69 | if self.isServer then |
70 | g_currentMission:addMoney(self.incomePerHour, self:getOwnerFarmId(), MoneyType.PROPERTY_INCOME, true) |
71 | end |
72 | end |
load
DescriptionLoad beehiveDefinition
load(string xmlFilename, float x, float y, float z, float rx, float ry, float rz, boolean initRandom)Arguments
string | xmlFilename | xml file name |
float | x | x world position |
float | y | z world position |
float | z | z world position |
float | rx | rx world rotation |
float | ry | ry world rotation |
float | rz | rz world rotation |
boolean | initRandom | initialize random |
boolean | success | success |
51 | function BeehivePlaceable:load(xmlFilename, x,y,z, rx,ry,rz, initRandom) |
52 | if not BeehivePlaceable:superClass().load(self, xmlFilename, x,y,z, rx,ry,rz, initRandom) then |
53 | return false |
54 | end |
55 | |
56 | local xmlFile = loadXMLFile("TempXML", xmlFilename) |
57 | |
58 | self.particleSystem = {} |
59 | ParticleUtil.loadParticleSystem(xmlFile, self.particleSystem, "placeable.particleSystem", self.nodeId, true, nil, self.baseDirectory) |
60 | |
61 | delete(xmlFile) |
62 | |
63 | return true |
64 | end |
new
DescriptionCreating placeable beehiveDefinition
new(boolean isServer, boolean isClient, table customMt)Arguments
boolean | isServer | is server |
boolean | isClient | is client |
table | customMt | custom metatable |
table | instance | Instance of object |
16 | function BeehivePlaceable:new(isServer, isClient, customMt) |
17 | local mt = customMt |
18 | if mt == nil then |
19 | mt = BeehivePlaceable_mt |
20 | end |
21 | |
22 | local self = Placeable:new(isServer, isClient, mt) |
23 | |
24 | registerObjectClassName(self, "BeehivePlaceable") |
25 | |
26 | return self |
27 | end |