Script v1.4.4.0
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
TreePlanterActivatable
DescriptionThis is the activable class for treeplantersFunctions
new
DescriptionReturns new instance of classDefinition
new(table treePlanter)Arguments
table | treePlanter | object of treePlanter |
table | self | new instance |
19 | function TreePlanterActivatable:new(treePlanter) |
20 | local self = {}; |
21 | setmetatable(self, TreePlanterActivatable_mt); |
22 | |
23 | self.treePlanter = treePlanter; |
24 | self.activateText = string.format(g_i18n:getText("action_refillOBJECT"), self.treePlanter.typeDesc) |
25 | |
26 | return self; |
27 | end; |
getIsActivatable
DescriptionReturns if is activateableDefinition
getIsActivatable()Return Values
boolean | isActivateable | is activateable |
32 | function TreePlanterActivatable:getIsActivatable() |
33 | if self.treePlanter:getRootAttacherVehicle() ~= g_currentMission.controlledVehicle then |
34 | return false; |
35 | end; |
36 | |
37 | if self.treePlanter.mountedSaplingPallet == nil and self.treePlanter.nearestSaplingPallet ~= nil then |
38 | return true; |
39 | end |
40 | return false; |
41 | end; |
onActivateObject
DescriptionCalled on activate objectDefinition
onActivateObject()Code
45 | function TreePlanterActivatable:onActivateObject() |
46 | self.treePlanter:loadPallet(networkGetObjectId(self.treePlanter.nearestSaplingPallet)); |
47 | end; |