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
PlaceableSellingStation
DescriptionSpecialization for placeablesFunctions
- collectPickObjects
- getSellingStation
- initSpecialization
- loadFromXMLFile
- onDelete
- onFinalizePlacement
- onLoad
- onReadStream
- onWriteStream
- prerequisitesPresent
- registerEventListeners
- registerFunctions
- registerOverwrittenFunctions
- registerSavegameXMLPaths
- registerXMLPaths
- saveToXMLFile
collectPickObjects
DescriptionDefinitioncollectPickObjects()Code
126 | function PlaceableSellingStation:collectPickObjects(superFunc, node) |
127 | local spec = self.spec_sellingStation |
128 | |
129 | local foundNode = false |
130 | for _, unloadTrigger in ipairs(spec.sellingStation.unloadTriggers) do |
131 | if node == unloadTrigger.exactFillRootNode then |
132 | foundNode = true |
133 | break |
134 | end |
135 | end |
136 | |
137 | if not foundNode then |
138 | superFunc(self, node) |
139 | end |
140 | end |
getSellingStation
DescriptionDefinitiongetSellingStation()Code
120 | function PlaceableSellingStation:getSellingStation() |
121 | return self.spec_sellingStation.sellingStation |
122 | end |
initSpecialization
DescriptionDefinitioninitSpecialization()Code
62 | function PlaceableSellingStation.initSpecialization() |
63 | g_storeManager:addSpecType("sellingStationFillTypes", "shopListAttributeIconInput", SellingStation.loadSpecValueFillTypes, SellingStation.getSpecValueFillTypes, "placeable") |
64 | end |
loadFromXMLFile
DescriptionDefinitionloadFromXMLFile()Code
144 | function PlaceableSellingStation:loadFromXMLFile(xmlFile, key) |
145 | local spec = self.spec_sellingStation |
146 | spec.sellingStation:loadFromXMLFile(xmlFile, key) |
147 | end |
onDelete
DescriptionDefinitiononDelete()Code
80 | function PlaceableSellingStation:onDelete() |
81 | local spec = self.spec_sellingStation |
82 | if spec.sellingStation ~= nil then |
83 | g_currentMission.storageSystem:removeUnloadingStation(spec.sellingStation, self) |
84 | g_currentMission.economyManager:removeSellingStation(spec.sellingStation) |
85 | spec.sellingStation:delete() |
86 | end |
87 | end |
onFinalizePlacement
DescriptionDefinitiononFinalizePlacement()Code
91 | function PlaceableSellingStation:onFinalizePlacement() |
92 | local spec = self.spec_sellingStation |
93 | spec.sellingStation:register(true) |
94 | g_currentMission.storageSystem:addUnloadingStation(spec.sellingStation, self) |
95 | g_currentMission.economyManager:addSellingStation(spec.sellingStation) |
96 | end |
onLoad
DescriptionCalled on loadingDefinition
onLoad(table savegame)Arguments
table | savegame | savegame |
69 | function PlaceableSellingStation:onLoad(savegame) |
70 | local spec = self.spec_sellingStation |
71 | local xmlFile = self.xmlFile |
72 | |
73 | spec.sellingStation = SellingStation.new(self.isServer, self.isClient) |
74 | spec.sellingStation:load(self.components, xmlFile, "placeable.sellingStation", self.customEnvironment, self.i3dMappings, self.components[1].node) |
75 | spec.sellingStation.owningPlaceable = self |
76 | end |
onReadStream
DescriptionDefinitiononReadStream()Code
100 | function PlaceableSellingStation:onReadStream(streamId, connection) |
101 | local spec = self.spec_sellingStation |
102 | |
103 | local sellingStationId = NetworkUtil.readNodeObjectId(streamId) |
104 | spec.sellingStation:readStream(streamId, connection) |
105 | g_client:finishRegisterObject(spec.sellingStation, sellingStationId) |
106 | end |
onWriteStream
DescriptionDefinitiononWriteStream()Code
110 | function PlaceableSellingStation:onWriteStream(streamId, connection) |
111 | local spec = self.spec_sellingStation |
112 | |
113 | NetworkUtil.writeNodeObjectId(streamId, NetworkUtil.getObjectId(spec.sellingStation)) |
114 | spec.sellingStation:writeStream(streamId, connection) |
115 | g_server:registerObjectInStream(connection, spec.sellingStation) |
116 | 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 PlaceableSellingStation.prerequisitesPresent(specializations) |
19 | return true |
20 | end |
registerEventListeners
DescriptionDefinitionregisterEventListeners()Code
36 | function PlaceableSellingStation.registerEventListeners(placeableType) |
37 | SpecializationUtil.registerEventListener(placeableType, "onLoad", PlaceableSellingStation) |
38 | SpecializationUtil.registerEventListener(placeableType, "onDelete", PlaceableSellingStation) |
39 | SpecializationUtil.registerEventListener(placeableType, "onFinalizePlacement", PlaceableSellingStation) |
40 | SpecializationUtil.registerEventListener(placeableType, "onReadStream", PlaceableSellingStation) |
41 | SpecializationUtil.registerEventListener(placeableType, "onWriteStream", PlaceableSellingStation) |
42 | end |
registerFunctions
DescriptionDefinitionregisterFunctions()Code
24 | function PlaceableSellingStation.registerFunctions(placeableType) |
25 | SpecializationUtil.registerFunction(placeableType, "getSellingStation", PlaceableSellingStation.getSellingStation) |
26 | end |
registerOverwrittenFunctions
DescriptionDefinitionregisterOverwrittenFunctions()Code
30 | function PlaceableSellingStation.registerOverwrittenFunctions(placeableType) |
31 | SpecializationUtil.registerOverwrittenFunction(placeableType, "collectPickObjects", PlaceableSellingStation.collectPickObjects) |
32 | end |
registerSavegameXMLPaths
DescriptionDefinitionregisterSavegameXMLPaths()Code
54 | function PlaceableSellingStation.registerSavegameXMLPaths(schema, basePath) |
55 | schema:setXMLSpecializationType("SellingStation") |
56 | SellingStation.registerSavegameXMLPaths(schema, basePath) |
57 | schema:setXMLSpecializationType() |
58 | end |
registerXMLPaths
DescriptionDefinitionregisterXMLPaths()Code
46 | function PlaceableSellingStation.registerXMLPaths(schema, basePath) |
47 | schema:setXMLSpecializationType("SellingStation") |
48 | SellingStation.registerXMLPaths(schema, basePath .. ".sellingStation") |
49 | schema:setXMLSpecializationType() |
50 | end |
saveToXMLFile
DescriptionDefinitionsaveToXMLFile()Code
151 | function PlaceableSellingStation:saveToXMLFile(xmlFile, key, usedModNames) |
152 | local spec = self.spec_sellingStation |
153 | spec.sellingStation:saveToXMLFile(xmlFile, key, usedModNames) |
154 | end |