Script v1.4.4.0
- Handtools
- Events
- Objects
- Placeables
- AnimatedObjectPlaceable
- BeehivePlaceable
- GreenhousePlaceable
- HayLoftPlaceable
- HeatingPlantPlaceable
- HighPressureWasherPlaceab...
- Placeable
- SolarCollectorPlaceable
- WindTurbinePlaceable
- Triggers
- Utils
- Vehicles
- Specializations
Engine v7.0.0.2
- General
- Entity
- Node
- Scenegraph
- Lighting
- Camera
- Shape
- Particle System
- Physics
- Spline
- Animation
- Overlays
- Sound
- Input
- XML
- Network
- Callbacks
- Text Rendering
- Terrain Detail
- Tire Track
- Editor
- Rendering
- String
- Math
- I3D
- Fillplanes
Foundation Reference
BeehivePlaceable
DescriptionClass for placeable beehivesParent
PlaceableFunctions
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 |
18 | function BeehivePlaceable:new(isServer, isClient, customMt) |
19 | local mt = customMt; |
20 | if mt == nil then |
21 | mt = BeehivePlaceable_mt; |
22 | end; |
23 | |
24 | local self = Placeable:new(isServer, isClient, mt); |
25 | |
26 | registerObjectClassName(self, "BeehivePlaceable"); |
27 | |
28 | return self; |
29 | end; |
delete
DescriptionDeleting placeable beehiveDefinition
delete()Code
33 | function BeehivePlaceable:delete() |
34 | unregisterObjectClassName(self); |
35 | g_currentMission.environment:removeHourChangeListener(self); |
36 | if self.particleSystem ~= nil then |
37 | ParticleUtil.deleteParticleSystem(self.particleSystem); |
38 | end; |
39 | BeehivePlaceable:superClass().delete(self); |
40 | end; |
deleteFinal
DescriptionDeleting placeable beehive finalDefinition
deleteFinal()Code
44 | function BeehivePlaceable:deleteFinal() |
45 | BeehivePlaceable:superClass().deleteFinal(self); |
46 | 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 |
59 | function BeehivePlaceable:load(xmlFilename, x,y,z, rx,ry,rz, initRandom) |
60 | if not BeehivePlaceable:superClass().load(self, xmlFilename, x,y,z, rx,ry,rz, initRandom) then |
61 | return false; |
62 | end; |
63 | |
64 | local xmlFile = loadXMLFile("TempXML", xmlFilename); |
65 | |
66 | self.particleSystem = {}; |
67 | ParticleUtil.loadParticleSystem(xmlFile, self.particleSystem, "placeable.particleSystem", self.nodeId, true, nil, self.baseDirectory); |
68 | |
69 | delete(xmlFile); |
70 | |
71 | return true; |
72 | end; |
finalizePlacement
DescriptionCalled if placeable is placedDefinition
finalizePlacement()Code
76 | function BeehivePlaceable:finalizePlacement() |
77 | BeehivePlaceable:superClass().finalizePlacement(self); |
78 | end |
hourChanged
DescriptionCalled if hour changedDefinition
hourChanged()Code
82 | function BeehivePlaceable:hourChanged() |
83 | if self.isServer then |
84 | g_currentMission:addSharedMoney(self.incomePerHour, "propertyIncome"); |
85 | g_currentMission:addMoneyChange(self.incomePerHour, EconomyManager.MONEY_TYPE_PROPERTY_INCOME); |
86 | end; |
87 | end; |