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
PlaceableWorkshop
DescriptionSpecialization for placeablesFunctions
- onDelete
- onLoad
- prerequisitesPresent
- registerEventListeners
- registerOverwrittenFunctions
- registerXMLPaths
- setOwnerFarmId
onDelete
DescriptionDefinitiononDelete()Code
57 | function PlaceableWorkshop:onDelete() |
58 | local spec = self.spec_workshop |
59 | |
60 | if spec.sellingPoint ~= nil then |
61 | spec.sellingPoint:delete() |
62 | end |
63 | end |
onLoad
DescriptionCalled on loadingDefinition
onLoad(table savegame)Arguments
table | savegame | savegame |
46 | function PlaceableWorkshop:onLoad(savegame) |
47 | local spec = self.spec_workshop |
48 | |
49 | spec.sellingPoint = VehicleSellingPoint.new() |
50 | spec.sellingPoint:load(self.components, self.xmlFile, "placeable.workshop.sellingPoint", self.i3dMappings) |
51 | spec.sellingPoint:setOwnerFarmId(self:getOwnerFarmId()) |
52 | spec.sellingPoint.owningPlaceable = self |
53 | 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 PlaceableWorkshop.prerequisitesPresent(specializations) |
19 | return true |
20 | end |
registerEventListeners
DescriptionDefinitionregisterEventListeners()Code
30 | function PlaceableWorkshop.registerEventListeners(placeableType) |
31 | SpecializationUtil.registerEventListener(placeableType, "onLoad", PlaceableWorkshop) |
32 | SpecializationUtil.registerEventListener(placeableType, "onDelete", PlaceableWorkshop) |
33 | end |
registerOverwrittenFunctions
DescriptionDefinitionregisterOverwrittenFunctions()Code
24 | function PlaceableWorkshop.registerOverwrittenFunctions(placeableType) |
25 | SpecializationUtil.registerOverwrittenFunction(placeableType, "setOwnerFarmId", PlaceableWorkshop.setOwnerFarmId) |
26 | end |
registerXMLPaths
DescriptionDefinitionregisterXMLPaths()Code
37 | function PlaceableWorkshop.registerXMLPaths(schema, basePath) |
38 | schema:setXMLSpecializationType("Workshop") |
39 | VehicleSellingPoint.registerXMLPaths(schema, basePath .. ".workshop.sellingPoint") |
40 | schema:setXMLSpecializationType() |
41 | end |
setOwnerFarmId
DescriptionDefinitionsetOwnerFarmId()Code
67 | function PlaceableWorkshop:setOwnerFarmId(superFunc, ownerFarmId, noEventSend) |
68 | local spec = self.spec_workshop |
69 | |
70 | superFunc(self, ownerFarmId, noEventSend) |
71 | |
72 | if spec.sellingPoint ~= nil then |
73 | spec.sellingPoint:setOwnerFarmId(ownerFarmId) |
74 | end |
75 | end |