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
PlaceableIndoorAreas
DescriptionSpecialization for placeablesFunctions
- loadIndoorArea
- onDelete
- onFinalizePlacement
- onLoad
- prerequisitesPresent
- registerEventListeners
- registerFunctions
- registerXMLPaths
loadIndoorArea
DescriptionDefinitionloadIndoorArea()Code
80 | function PlaceableIndoorAreas:loadIndoorArea(xmlFile, key, area) |
81 | local start = xmlFile:getValue(key .. "#startNode", nil, self.components, self.i3dMappings) |
82 | if start == nil then |
83 | Logging.xmlWarning(xmlFile, "Indoor area start node not defined for '%s'", key) |
84 | return false |
85 | end |
86 | |
87 | local width = xmlFile:getValue(key .. "#widthNode", nil, self.components, self.i3dMappings) |
88 | if width == nil then |
89 | Logging.xmlWarning(xmlFile, "Indoor area width node not defined for '%s'", key) |
90 | return false |
91 | end |
92 | |
93 | local height = xmlFile:getValue(key .. "#heightNode", nil, self.components, self.i3dMappings) |
94 | if height == nil then |
95 | Logging.xmlWarning(xmlFile, "Indoor area height node not defined for '%s'", key) |
96 | return false |
97 | end |
98 | |
99 | area.start = start |
100 | area.width = width |
101 | area.height = height |
102 | |
103 | return true |
104 | end |
onDelete
DescriptionDefinitiononDelete()Code
68 | function PlaceableIndoorAreas:onDelete() |
69 | local spec = self.spec_indoorAreas |
70 | |
71 | if spec.areas ~= nil and spec.resetIndoorMaskOnDelete and not self.isReloading then |
72 | for _, area in ipairs(spec.areas) do |
73 | g_currentMission.indoorMask:setPlaceableAreaInSnowMask(area, IndoorMask.OUTDOOR) |
74 | end |
75 | end |
76 | end |
onFinalizePlacement
DescriptionDefinitiononFinalizePlacement()Code
108 | function PlaceableIndoorAreas:onFinalizePlacement() |
109 | local spec = self.spec_indoorAreas |
110 | |
111 | for _, area in pairs(spec.areas) do |
112 | g_currentMission.indoorMask:setPlaceableAreaInSnowMask(area, IndoorMask.INDOOR) |
113 | end |
114 | |
115 | spec.resetIndoorMaskOnDelete = true |
116 | end |
onLoad
DescriptionCalled on loadingDefinition
onLoad(table savegame)Arguments
table | savegame | savegame |
49 | function PlaceableIndoorAreas:onLoad(savegame) |
50 | local spec = self.spec_indoorAreas |
51 | |
52 | spec.resetIndoorMaskOnDelete = false |
53 | spec.areas = {} |
54 | self.xmlFile:iterate("placeable.indoorAreas.indoorArea", function(_, key) |
55 | local area = {} |
56 | if self:loadIndoorArea(self.xmlFile, key, area) then |
57 | table.insert(spec.areas, area) |
58 | end |
59 | end) |
60 | |
61 | if not self.xmlFile:hasProperty("placeable.indoorAreas") then |
62 | Logging.xmlWarning(self.xmlFile, "Missing indoor areas") |
63 | end |
64 | 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 PlaceableIndoorAreas.prerequisitesPresent(specializations) |
19 | return true |
20 | end |
registerEventListeners
DescriptionDefinitionregisterEventListeners()Code
30 | function PlaceableIndoorAreas.registerEventListeners(placeableType) |
31 | SpecializationUtil.registerEventListener(placeableType, "onLoad", PlaceableIndoorAreas) |
32 | SpecializationUtil.registerEventListener(placeableType, "onDelete", PlaceableIndoorAreas) |
33 | SpecializationUtil.registerEventListener(placeableType, "onFinalizePlacement", PlaceableIndoorAreas) |
34 | end |
registerFunctions
DescriptionDefinitionregisterFunctions()Code
24 | function PlaceableIndoorAreas.registerFunctions(placeableType) |
25 | SpecializationUtil.registerFunction(placeableType, "loadIndoorArea", PlaceableIndoorAreas.loadIndoorArea) |
26 | end |
registerXMLPaths
DescriptionDefinitionregisterXMLPaths()Code
38 | function PlaceableIndoorAreas.registerXMLPaths(schema, basePath) |
39 | schema:setXMLSpecializationType("IndoorAreas") |
40 | schema:register(XMLValueType.NODE_INDEX, basePath .. ".indoorAreas.indoorArea(?)#startNode", "Start node of indoor mask area") |
41 | schema:register(XMLValueType.NODE_INDEX, basePath .. ".indoorAreas.indoorArea(?)#widthNode", "Width node of indoor mask area") |
42 | schema:register(XMLValueType.NODE_INDEX, basePath .. ".indoorAreas.indoorArea(?)#heightNode", "Height node of indoor mask area") |
43 | schema:setXMLSpecializationType() |
44 | end |