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
- 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
PlaceableWeatherStation
DescriptionSpecialization for placeablesFunctions
onDelete
DescriptionDefinitiononDelete()Code
54 | function PlaceableWeatherStation:onDelete() |
55 | g_currentMission.placeableSystem:removeWeatherStation(self) |
56 | |
57 | if self.isClient then |
58 | local spec = self.spec_weatherStation |
59 | if spec.sample ~= nil then |
60 | g_soundManager:deleteSample(spec.sample) |
61 | end |
62 | end |
63 | end |
onFinalizePlacement
DescriptionDefinitiononFinalizePlacement()Code
67 | function PlaceableWeatherStation:onFinalizePlacement() |
68 | g_currentMission.placeableSystem:addWeatherStation(self) |
69 | |
70 | if self.isClient then |
71 | local spec = self.spec_weatherStation |
72 | if spec.sample ~= nil then |
73 | g_soundManager:playSample(spec.sample) |
74 | end |
75 | end |
76 | end |
onLoad
DescriptionCalled on loadingDefinition
onLoad(table savegame)Arguments
table | savegame | savegame |
43 | function PlaceableWeatherStation:onLoad(savegame) |
44 | local spec = self.spec_weatherStation |
45 | |
46 | if self.isClient then |
47 | spec.sample = g_soundManager:loadSampleFromXML(self.xmlFile, "placeable.weatherStation.sounds", "idle", self.baseDirectory, self.components, 0, AudioGroup.ENVIRONMENT, self.i3dMappings, nil) |
48 | end |
49 | 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 PlaceableWeatherStation.prerequisitesPresent(specializations) |
19 | return true |
20 | end |
registerEventListeners
DescriptionDefinitionregisterEventListeners()Code
24 | function PlaceableWeatherStation.registerEventListeners(placeableType) |
25 | SpecializationUtil.registerEventListener(placeableType, "onLoad", PlaceableWeatherStation) |
26 | SpecializationUtil.registerEventListener(placeableType, "onDelete", PlaceableWeatherStation) |
27 | SpecializationUtil.registerEventListener(placeableType, "onFinalizePlacement", PlaceableWeatherStation) |
28 | end |
registerXMLPaths
DescriptionDefinitionregisterXMLPaths()Code
32 | function PlaceableWeatherStation.registerXMLPaths(schema, basePath) |
33 | schema:setXMLSpecializationType("WeatherStation") |
34 | |
35 | SoundManager.registerSampleXMLPaths(schema, basePath .. ".weatherStation.sounds", "idle") |
36 | |
37 | schema:setXMLSpecializationType() |
38 | end |