Script v1_7_1_0
- AI
- Animals
- Collections
- Contracts
- Debug
- Economy
- Elements
- EnvironmentalScore
- Errors
- Events
- GUI
- Handtools
- Hud
- I3d
- Input
- Jobs
- Maps
- Materials
- Misc
- Objects
- Parameters
- Placeables
- Placement
- Player
- Shop
- Sounds
- Specialization
- Specializations
- AIConveyorBelt
- AIDrivable
- AIFieldWorker
- AIImplement
- AIJobVehicle
- AIVehicle
- AIVehicleObstacle
- AnimatedVehicle
- ArticulatedAxis
- Attachable
- AttacherJointControl
- AttacherJoints
- AutoLoader
- BaleGrab
- BaleLoader
- Baler
- BaleWrapper
- BaseMaterial
- BigBag
- BunkerSiloCompacter
- BunkerSiloInteractor
- CCTDrivable
- Combine
- ConnectionHoses
- ConveyorBelt
- Cover
- CrabSteering
- Crawlers
- CropSensor
- Cultivator
- Cutter
- Cylindered
- CylinderedFoldable
- Dashboard
- Dischargeable
- Drivable
- DynamicallyLoadedParts
- DynamicMountAttacher
- Enterable
- ExtendedAIVehicle
- ExtendedCombine
- ExtendedMotorized
- ExtendedMower
- ExtendedSowingMachine
- ExtendedSprayer
- ExtendedWearable
- FertilizingCultivator
- FertilizingSowingMachine
- FillTriggerVehicle
- FillUnit
- FillVolume
- Foldable
- FoliageBending
- ForageWagon
- FrontloaderAttacher
- FruitPreparer
- GroundAdjustedNodes
- GroundReference
- HeadlandAnimation
- Honk
- HookLiftContainer
- HookLiftTrailer
- IKChains
- InlineWrapper
- JigglingParts
- Leveler
- LicensePlates
- Lights
- LivestockTrailer
- Locomotive
- LogGrab
- ManureBarrel
- ManureSensor
- MixerWagon
- Motorized
- Mountable
- Mower
- Mulcher
- MultipleItemPurchase
- Pallet
- Pickup
- Pipe
- PlaceableAI
- PlaceableAnimatedObjects
- PlaceableBeehive
- PlaceableBeehivePalletSpa...
- PlaceableBunkerSilo
- PlaceableBuyingStation
- PlaceableCartridgePlayer
- PlaceableChargingStation
- PlaceableClearAreas
- PlaceableColorable
- PlaceableDeletedNodes
- PlaceableDoghouse
- PlaceableDynamicallyLoade...
- PlaceableFarmhouse
- PlaceableFence
- PlaceableFoliageAreas
- PlaceableGreenhouse
- PlaceableHighPressureWash...
- PlaceableHotspots
- PlaceableHusbandry
- PlaceableHusbandryAnimals
- PlaceableHusbandryFeeding...
- PlaceableHusbandryFence
- PlaceableHusbandryFood
- PlaceableHusbandryLiquidM...
- PlaceableHusbandryMilk
- PlaceableHusbandryPallets
- PlaceableHusbandryStraw
- PlaceableHusbandryWater
- PlaceableIncomePerHour
- PlaceableIndoorAreas
- PlaceableInfoTrigger
- PlaceableLeveling
- PlaceableLights
- PlaceableManureHeap
- PlaceablePlacement
- PlaceableProductionPoint
- PlaceableSellingStation
- PlaceableSilo
- PlaceableSiloExtension
- PlaceableSolarPanels
- PlaceableTipOcclusionArea...
- PlaceableTrainSystem
- PlaceableTriggerMarkers
- PlaceableVine
- PlaceableWardrobe
- PlaceableWeatherStation
- PlaceableWeighingStation
- PlaceableWindTurbine
- PlaceableWorkshop
- Plow
- PlowPacker
- PowerConsumer
- PowerTakeOffs
- PrecisionFarmingStatistic
- PushHandTool
- RandomlyMovingParts
- ReceivingHopper
- ReverseDriving
- Rideable
- RidgeMarker
- Roller
- Ropes
- RTKStation
- SaltSpreader
- SemiTrailerFront
- Shovel
- SlopeCompensation
- SmartAttach
- SoilSampler
- SowingMachine
- SpeedRotatingParts
- SplineVehicle
- Sprayer
- StonePicker
- StrawBlower
- StumpCutter
- SupportVehicle
- Suspensions
- Tedder
- TensionBeltObject
- TensionBelts
- TestAreas
- TipOccluder
- Trailer
- TreePlanter
- TreeSaplingPallet
- TreeSaw
- TurnOnVehicle
- VariableWorkWidth
- VehicleSettings
- VineCutter
- VineDetector
- VinePrepruner
- Washable
- WaterTrailer
- Wearable
- Weeder
- WeedSpotSpray
- Wheels
- WindBending
- Windrower
- Wipers
- WoodCrusher
- WoodHarvester
- WorkArea
- WorkMode
- WorkParticles
- StateMachine
- Statistics
- Tasks
- Triggers
- Utils
- Vehicles
Engine v1_7_1_0
- AI
- Animation
- Camera
- Entity
- Fillplanes
- general
- General
- I3D
- Input
- Lighting
- Math
- Network
- Node
- NoteNode
- Overlays
- Particle System
- Physics
- Rendering
- Scenegraph
- Shape
- Sound
- Spline
- String
- Terrain Detail
- Text Rendering
- Tire Track
- VoiceChat
- XML
Foundation Reference
PlaceableProductionPoint
DescriptionSpecialization for placeablesFunctions
- canBuy
- collectPickObjects
- initSpecialization
- loadFromXMLFile
- onDelete
- onFinalizePlacement
- onLoad
- onReadStream
- onWriteStream
- outputsChanged
- prerequisitesPresent
- productionStatusChanged
- registerEventListeners
- registerEvents
- registerFunctions
- registerOverwrittenFunctions
- registerSavegameXMLPaths
- registerXMLPaths
- saveToXMLFile
- setOwnerFarmId
- updateInfo
canBuy
DescriptionDefinitioncanBuy()Code
220 | function PlaceableProductionPoint:canBuy(superFunc) |
221 | if not g_currentMission.productionChainManager:getHasFreeSlots() then |
222 | return false, g_i18n:getText("warning_maxNumOfProdPointsReached") |
223 | end |
224 | |
225 | return superFunc(self) |
226 | end |
collectPickObjects
DescriptionDefinitioncollectPickObjects()Code
197 | function PlaceableProductionPoint:collectPickObjects(superFunc, node) |
198 | local spec = self.spec_productionPoint |
199 | if spec.productionPoint.loadingStation ~= nil then |
200 | for i=1, #spec.productionPoint.loadingStation.loadTriggers do |
201 | local loadTrigger = spec.productionPoint.loadingStation.loadTriggers[i] |
202 | if node == loadTrigger.triggerNode then |
203 | return |
204 | end |
205 | end |
206 | end |
207 | |
208 | for i=1, #spec.productionPoint.unloadingStation.unloadTriggers do |
209 | local unloadTrigger = spec.productionPoint.unloadingStation.unloadTriggers[i] |
210 | if node == unloadTrigger.exactFillRootNode then |
211 | return |
212 | end |
213 | end |
214 | |
215 | superFunc(self, node) |
216 | end |
initSpecialization
DescriptionDefinitioninitSpecialization()Code
73 | function PlaceableProductionPoint.initSpecialization() |
74 | g_storeManager:addSpecType("prodPointInputFillTypes", "shopListAttributeIconInput", ProductionPoint.loadSpecValueInputFillTypes, ProductionPoint.getSpecValueInputFillTypes, "placeable") |
75 | g_storeManager:addSpecType("prodPointOutputFillTypes", "shopListAttributeIconOutput", ProductionPoint.loadSpecValueOutputFillTypes, ProductionPoint.getSpecValueOutputFillTypes, "placeable") |
76 | end |
loadFromXMLFile
DescriptionDefinitionloadFromXMLFile()Code
168 | function PlaceableProductionPoint:loadFromXMLFile(xmlFile, key) |
169 | local spec = self.spec_productionPoint |
170 | if spec.productionPoint ~= nil then |
171 | spec.productionPoint:loadFromXMLFile(xmlFile, key) |
172 | end |
173 | end |
onDelete
DescriptionDefinitiononDelete()Code
96 | function PlaceableProductionPoint:onDelete() |
97 | local spec = self.spec_productionPoint |
98 | |
99 | if spec.productionPoint ~= nil then |
100 | spec.productionPoint:delete() |
101 | spec.productionPoint = nil |
102 | end |
103 | end |
onFinalizePlacement
DescriptionDefinitiononFinalizePlacement()Code
107 | function PlaceableProductionPoint:onFinalizePlacement() |
108 | local spec = self.spec_productionPoint |
109 | |
110 | if spec.productionPoint ~= nil then |
111 | spec.productionPoint:register(true) |
112 | |
113 | spec.productionPoint:setOwnerFarmId(self:getOwnerFarmId()) |
114 | |
115 | --if not g_currentMission.productionChainManager:addProductionPoint(self.productionPoint) then |
116 | -- log("PPP: Error: Unable to add production point to manager") |
117 | -- return false |
118 | --end |
119 | |
120 | spec.productionPoint:findStorageExtensions() |
121 | |
122 | spec.productionPoint:updateFxState() |
123 | end |
124 | end |
onLoad
DescriptionCalled on loadingDefinition
onLoad(table savegame)Arguments
table | savegame | savegame |
81 | function PlaceableProductionPoint:onLoad(savegame) |
82 | local spec = self.spec_productionPoint |
83 | |
84 | local productionPoint = ProductionPoint.new(self.isServer, self.isClient, self.baseDirectory) |
85 | productionPoint.owningPlaceable = self |
86 | if productionPoint:load(self.components, self.xmlFile, "placeable.productionPoint", self.customEnvironment, self.i3dMappings) then |
87 | spec.productionPoint = productionPoint |
88 | else |
89 | productionPoint:delete() |
90 | self:setLoadingState(Placeable.LOADING_STATE_ERROR) |
91 | end |
92 | end |
onReadStream
DescriptionDefinitiononReadStream()Code
146 | function PlaceableProductionPoint:onReadStream(streamId, connection) |
147 | local spec = self.spec_productionPoint |
148 | if spec.productionPoint ~= nil then |
149 | local productionPointId = NetworkUtil.readNodeObjectId(streamId) |
150 | spec.productionPoint:readStream(streamId, connection) |
151 | g_client:finishRegisterObject(spec.productionPoint, productionPointId) |
152 | end |
153 | end |
onWriteStream
DescriptionDefinitiononWriteStream()Code
157 | function PlaceableProductionPoint:onWriteStream(streamId, connection) |
158 | local spec = self.spec_productionPoint |
159 | if spec.productionPoint ~= nil then |
160 | NetworkUtil.writeNodeObjectId(streamId, NetworkUtil.getObjectId(spec.productionPoint)) |
161 | spec.productionPoint:writeStream(streamId, connection) |
162 | g_server:registerObjectInStream(connection, spec.productionPoint) |
163 | end |
164 | end |
outputsChanged
DescriptionDefinitionoutputsChanged()Code
134 | function PlaceableProductionPoint:outputsChanged(outputs, state) |
135 | SpecializationUtil.raiseEvent(self, "onOutputFillTypesChanged", outputs, state) |
136 | end |
prerequisitesPresent
DescriptionChecks if all prerequisite specializations are loadedDefinition
prerequisitesPresent(table specializations)Arguments
table | specializations | specializations |
boolean | hasPrerequisite | true if all prerequisite specializations are loaded |
18 | function PlaceableProductionPoint.prerequisitesPresent(specializations) |
19 | return SpecializationUtil.hasSpecialization(PlaceableInfoTrigger, specializations) |
20 | end |
productionStatusChanged
DescriptionDefinitionproductionStatusChanged()Code
140 | function PlaceableProductionPoint:productionStatusChanged(production, status) |
141 | SpecializationUtil.raiseEvent(self, "onProductionStatusChanged", production, status) |
142 | end |
registerEventListeners
DescriptionDefinitionregisterEventListeners()Code
47 | function PlaceableProductionPoint.registerEventListeners(placeableType) |
48 | SpecializationUtil.registerEventListener(placeableType, "onLoad", PlaceableProductionPoint) |
49 | SpecializationUtil.registerEventListener(placeableType, "onDelete", PlaceableProductionPoint) |
50 | SpecializationUtil.registerEventListener(placeableType, "onFinalizePlacement", PlaceableProductionPoint) |
51 | SpecializationUtil.registerEventListener(placeableType, "onWriteStream", PlaceableProductionPoint) |
52 | SpecializationUtil.registerEventListener(placeableType, "onReadStream", PlaceableProductionPoint) |
53 | end |
registerEvents
DescriptionDefinitionregisterEvents()Code
24 | function PlaceableProductionPoint.registerEvents(placeableType) |
25 | SpecializationUtil.registerEvent(placeableType, "onOutputFillTypesChanged") |
26 | SpecializationUtil.registerEvent(placeableType, "onProductionStatusChanged") |
27 | end |
registerFunctions
DescriptionDefinitionregisterFunctions()Code
31 | function PlaceableProductionPoint.registerFunctions(placeableType) |
32 | SpecializationUtil.registerFunction(placeableType, "outputsChanged", PlaceableProductionPoint.outputsChanged) |
33 | SpecializationUtil.registerFunction(placeableType, "productionStatusChanged", PlaceableProductionPoint.productionStatusChanged) |
34 | end |
registerOverwrittenFunctions
DescriptionDefinitionregisterOverwrittenFunctions()Code
38 | function PlaceableProductionPoint.registerOverwrittenFunctions(placeableType) |
39 | SpecializationUtil.registerOverwrittenFunction(placeableType, "setOwnerFarmId", PlaceableProductionPoint.setOwnerFarmId) |
40 | SpecializationUtil.registerOverwrittenFunction(placeableType, "collectPickObjects", PlaceableProductionPoint.collectPickObjects) |
41 | SpecializationUtil.registerOverwrittenFunction(placeableType, "canBuy", PlaceableProductionPoint.canBuy) |
42 | SpecializationUtil.registerOverwrittenFunction(placeableType, "updateInfo", PlaceableProductionPoint.updateInfo) |
43 | end |
registerSavegameXMLPaths
DescriptionDefinitionregisterSavegameXMLPaths()Code
65 | function PlaceableProductionPoint.registerSavegameXMLPaths(schema, basePath) |
66 | schema:setXMLSpecializationType("ProductionPoint") |
67 | ProductionPoint.registerSavegameXMLPaths(schema, basePath) |
68 | schema:setXMLSpecializationType() |
69 | end |
registerXMLPaths
DescriptionDefinitionregisterXMLPaths()Code
57 | function PlaceableProductionPoint.registerXMLPaths(schema, basePath) |
58 | schema:setXMLSpecializationType("ProductionPoint") |
59 | ProductionPoint.registerXMLPaths(schema, basePath .. ".productionPoint") |
60 | schema:setXMLSpecializationType() |
61 | end |
saveToXMLFile
DescriptionDefinitionsaveToXMLFile()Code
177 | function PlaceableProductionPoint:saveToXMLFile(xmlFile, key, usedModNames) |
178 | local spec = self.spec_productionPoint |
179 | if spec.productionPoint ~= nil then |
180 | spec.productionPoint:saveToXMLFile(xmlFile, key, usedModNames) |
181 | end |
182 | end |
setOwnerFarmId
DescriptionDefinitionsetOwnerFarmId()Code
186 | function PlaceableProductionPoint:setOwnerFarmId(superFunc, farmId, noEventSend) |
187 | superFunc(self, farmId, noEventSend) |
188 | |
189 | local spec = self.spec_productionPoint |
190 | if spec.productionPoint ~= nil then |
191 | spec.productionPoint:setOwnerFarmId(farmId) |
192 | end |
193 | end |
updateInfo
DescriptionDefinitionupdateInfo()Code
128 | function PlaceableProductionPoint:updateInfo(superFunc, infoTable) |
129 | self.spec_productionPoint.productionPoint:updateInfo(superFunc, infoTable) |
130 | end |