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
- getMaterialCustomShaderFilename
- getMaterialCustomShaderVariation
- getMaterialDiffuseMapFilename
- getMaterialDiffuseMapHasAlpha
- getMaterialEmissiveMapFilename
- getMaterialEmissiveMapHasAlpha
- getMaterialGlossMapFilename
- getMaterialHasRefractionMap
- getMaterialIsAlphaBlended
- getMaterialIsAlphaTested
- getMaterialNormalMapFilename
- getMaterialNormalMapFormat
- getMaterialReflectionMapScaling
- setMaterialCustomMapFromFile
- setMaterialCustomShaderVariation
- setMaterialDiffuseMapFromFile
- setMaterialGlossMapFromFile
- setMaterialNormalMapFromFile
- Scenegraph
- Shape
- Sound
- Spline
- String
- Terrain Detail
- Text Rendering
- Tire Track
- VoiceChat
- XML
Foundation Reference
BalerSetIsUnloadingBaleEvent
DescriptionEvent for baler is unloading stateParent
EventFunctions
emptyNew
DescriptionCreate instance of Event classDefinition
emptyNew()Return Values
table | self | instance of class event |
13 | function BalerSetIsUnloadingBaleEvent.emptyNew() |
14 | local self = Event.new(BalerSetIsUnloadingBaleEvent_mt) |
15 | return self |
16 | end |
new
DescriptionCreate new instance of eventDefinition
new(table object, boolean isUnloadingBale)Arguments
table | object | object |
boolean | isUnloadingBale | is unloading bale |
22 | function BalerSetIsUnloadingBaleEvent.new(object, isUnloadingBale) |
23 | local self = BalerSetIsUnloadingBaleEvent.emptyNew() |
24 | self.object = object |
25 | self.isUnloadingBale = isUnloadingBale |
26 | return self |
27 | end |
readStream
DescriptionCalled on client side on joinDefinition
readStream(integer streamId, integer connection)Arguments
integer | streamId | streamId |
integer | connection | connection |
33 | function BalerSetIsUnloadingBaleEvent:readStream(streamId, connection) |
34 | self.object = NetworkUtil.readNodeObject(streamId) |
35 | self.isUnloadingBale = streamReadBool(streamId) |
36 | self:run(connection) |
37 | end |
run
DescriptionRun action on receiving sideDefinition
run(integer connection)Arguments
integer | connection | connection |
51 | function BalerSetIsUnloadingBaleEvent:run(connection) |
52 | if not connection:getIsServer() then |
53 | g_server:broadcastEvent(self, false, connection, self.object) |
54 | end |
55 | |
56 | if self.object ~= nil and self.object:getIsSynchronized() then |
57 | self.object:setIsUnloadingBale(self.isUnloadingBale, true) |
58 | end |
59 | end |
sendEvent
DescriptionBroadcast event from server to all clients, if called on client call function on server and broadcast it to all clientsDefinition
sendEvent(table object, boolean isUnloadingBale, boolean noEventSend)Arguments
table | object | object |
boolean | isUnloadingBale | isUnloadingBale |
boolean | noEventSend | no event send |
66 | function BalerSetIsUnloadingBaleEvent.sendEvent(object, isUnloadingBale, noEventSend) |
67 | if noEventSend == nil or noEventSend == false then |
68 | if g_server ~= nil then |
69 | g_server:broadcastEvent(BalerSetIsUnloadingBaleEvent.new(object, isUnloadingBale), nil, nil, object) |
70 | else |
71 | g_client:getServerConnection():sendEvent(BalerSetIsUnloadingBaleEvent.new(object, isUnloadingBale)) |
72 | end |
73 | end |
74 | end |
writeStream
DescriptionCalled on server side on joinDefinition
writeStream(integer streamId, integer connection)Arguments
integer | streamId | streamId |
integer | connection | connection |
43 | function BalerSetIsUnloadingBaleEvent:writeStream(streamId, connection) |
44 | NetworkUtil.writeNodeObject(streamId, self.object) |
45 | streamWriteBool(streamId, self.isUnloadingBale) |
46 | end |