Script v1.7.1.0
- AI
- Animals
- Contracts
- Debug
- Economy
- Effects
- Events
- Farms
- GUI
- Handtools
- I3d
- Materials
- Misc
- Objects
- Placeables
- AnimalHusbandry
- BeehivePlaceable
- BgaPlaceable
- BunkerSiloPlaceable
- BuyingStationPlaceable
- Doghouse
- FarmhousePlaceable
- GreenhousePlaceable
- HeatingPlantPlaceable
- HusbandryModuleWater
- Placeable
- SellingStationPlaceable
- SiloExtensionPlaceable
- SiloPlaceable
- SolarCollectorPlaceable
- WindTurbinePlaceable
- WoodSellStationPlaceable
- Player
- Shop
- Sounds
- Specializations
- Triggers
- Utils
- Vehicles
- Weather
Engine v1.7.1.0
- AI
- Animation
- Camera
- Entity
- Fillplanes
- General
- I3D
- Input
- Lighting
- Math
- Network
- Node
- Overlays
- Particle System
- Physics
- Rendering
- Scenegraph
- Shape
- Sound
- Spline
- String
- Terrain Detail
- Text Rendering
- Tire Track
- XML
- general
Foundation Reference
SellingStationPlaceable
DescriptionClass for placeable siloFunctions
collectPickObjects
DescriptionCollect pick objectsDefinition
collectPickObjects(integer node)Arguments
integer | node | node id |
108 | function SellingStationPlaceable:collectPickObjects(node) |
109 | local foundNode = false |
110 | for _, unloadTrigger in ipairs(self.sellingStation.unloadTriggers) do |
111 | if node == unloadTrigger.exactFillRootNode then |
112 | foundNode = true |
113 | break |
114 | end |
115 | end |
116 | |
117 | if not foundNode then |
118 | SellingStationPlaceable:superClass().collectPickObjects(self, node) |
119 | end |
120 | end |
delete
DescriptionDeleting placeable siloDefinition
delete()Code
34 | function SellingStationPlaceable:delete() |
35 | if self.sellingStation ~= nil then |
36 | g_currentMission.storageSystem:removeUnloadingStation(self.sellingStation) |
37 | self.sellingStation:delete() |
38 | end |
39 | |
40 | unregisterObjectClassName(self) |
41 | SellingStationPlaceable:superClass().delete(self) |
42 | end |
finalizePlacement
DescriptionCalled if placeable is placedDefinition
finalizePlacement()Code
73 | function SellingStationPlaceable:finalizePlacement() |
74 | SellingStationPlaceable:superClass().finalizePlacement(self) |
75 | self.sellingStation:register(true) |
76 | g_currentMission.storageSystem:addUnloadingStation(self.sellingStation) |
77 | end |
load
DescriptionLoad siloDefinition
load(string xmlFilename, float x, float y, float z, float rx, float ry, float rz, boolean initRandom)Arguments
string | xmlFilename | xml file name |
float | x | x world position |
float | y | z world position |
float | z | z world position |
float | rx | rx world rotation |
float | ry | ry world rotation |
float | rz | rz world rotation |
boolean | initRandom | initialize random |
boolean | success | success |
55 | function SellingStationPlaceable:load(xmlFilename, x,y,z, rx,ry,rz, initRandom) |
56 | if not SellingStationPlaceable:superClass().load(self, xmlFilename, x,y,z, rx,ry,rz, initRandom) then |
57 | return false |
58 | end |
59 | |
60 | local xmlFile = loadXMLFile("TempXML", xmlFilename) |
61 | |
62 | self.sellingStation = SellingStation:new(self.isServer, self.isClient) |
63 | self.sellingStation:load(self.nodeId, xmlFile, "placeable.sellingStation", self.customEnvironment) |
64 | self.sellingStation.owningPlaceable = self |
65 | |
66 | delete(xmlFile) |
67 | |
68 | return true |
69 | end |
loadFromXMLFile
DescriptionLoading from attributes and nodesDefinition
loadFromXMLFile(integer xmlFile, string key, boolean resetVehicles)Arguments
integer | xmlFile | id of xml object |
string | key | key |
boolean | resetVehicles | reset vehicles |
boolean | success | success |
128 | function SellingStationPlaceable:loadFromXMLFile(xmlFile, key, resetVehicles) |
129 | if not SellingStationPlaceable:superClass().loadFromXMLFile(self, xmlFile, key, resetVehicles) then |
130 | return false |
131 | end |
132 | |
133 | if not self.sellingStation:loadFromXMLFile(xmlFile, key..".sellingStation") then |
134 | return false |
135 | end |
136 | |
137 | return true |
138 | end |
new
DescriptionCreating placeable siloDefinition
new(boolean isServer, boolean isClient, table customMt)Arguments
boolean | isServer | is server |
boolean | isClient | is client |
table | customMt | custom metatable |
table | instance | Instance of object |
24 | function SellingStationPlaceable:new(isServer, isClient, customMt) |
25 | local self = Placeable:new(isServer, isClient, customMt or SellStationPlaceable_mt) |
26 | |
27 | registerObjectClassName(self, "SellingStationPlaceable") |
28 | |
29 | return self |
30 | end |
readStream
DescriptionCalled on client side on joinDefinition
readStream(integer streamId, table connection)Arguments
integer | streamId | stream ID |
table | connection | connection |
83 | function SellingStationPlaceable:readStream(streamId, connection) |
84 | SellingStationPlaceable:superClass().readStream(self, streamId, connection) |
85 | if connection:getIsServer() then |
86 | local sellingStationId = NetworkUtil.readNodeObjectId(streamId) |
87 | self.sellingStation:readStream(streamId, connection) |
88 | g_client:finishRegisterObject(self.sellingStation, sellingStationId) |
89 | end |
90 | end |
saveToXMLFile
DescriptionGet save attributes and nodesDefinition
saveToXMLFile(string nodeIdent)Arguments
string | nodeIdent | node ident |
string | attributes | attributes |
string | nodes | nodes |
145 | function SellingStationPlaceable:saveToXMLFile(xmlFile, key, usedModNames) |
146 | SellingStationPlaceable:superClass().saveToXMLFile(self, xmlFile, key, usedModNames) |
147 | |
148 | self.sellingStation:saveToXMLFile(xmlFile, key..".sellingStation", usedModNames) |
149 | end |
writeStream
DescriptionCalled on server side on joinDefinition
writeStream(integer streamId, table connection)Arguments
integer | streamId | stream ID |
table | connection | connection |
96 | function SellingStationPlaceable:writeStream(streamId, connection) |
97 | SellingStationPlaceable:superClass().writeStream(self, streamId, connection) |
98 | if not connection:getIsServer() then |
99 | NetworkUtil.writeNodeObjectId(streamId, NetworkUtil.getObjectId(self.sellingStation)) |
100 | self.sellingStation:writeStream(streamId, connection) |
101 | g_server:registerObjectInStream(connection, self.sellingStation) |
102 | end |
103 | end |