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
BalerAutomaticDropEvent
DescriptionEvent for balers to sync automatic drop stateParent
EventFunctions
emptyNew
DescriptionCreate instance of Event classDefinition
emptyNew()Return Values
table | self | instance of class event |
13 | function BalerAutomaticDropEvent.emptyNew() |
14 | return Event.new(BalerAutomaticDropEvent_mt) |
15 | end |
new
DescriptionCreate new instance of eventDefinition
new(table object, boolean automaticDrop)Arguments
table | object | object |
boolean | automaticDrop | automaticDrop |
21 | function BalerAutomaticDropEvent.new(object, automaticDrop) |
22 | local self = BalerAutomaticDropEvent.emptyNew() |
23 | self.object = object |
24 | self.automaticDrop = automaticDrop |
25 | return self |
26 | end |
readStream
DescriptionCalled on client side on joinDefinition
readStream(integer streamId, integer connection)Arguments
integer | streamId | streamId |
integer | connection | connection |
32 | function BalerAutomaticDropEvent:readStream(streamId, connection) |
33 | self.object = NetworkUtil.readNodeObject(streamId) |
34 | self.automaticDrop = streamReadBool(streamId) |
35 | self:run(connection) |
36 | end |
run
DescriptionRun action on receiving sideDefinition
run(integer connection)Arguments
integer | connection | connection |
50 | function BalerAutomaticDropEvent:run(connection) |
51 | if not connection:getIsServer() then |
52 | g_server:broadcastEvent(self, false, connection, self.object) |
53 | end |
54 | |
55 | if self.object ~= nil and self.object:getIsSynchronized() then |
56 | self.object:setBalerAutomaticDrop(self.automaticDrop, true) |
57 | end |
58 | 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 automaticDrop, boolean noEventSend)Arguments
table | object | object |
boolean | automaticDrop | automaticDrop |
boolean | noEventSend | no event send |
65 | function BalerAutomaticDropEvent.sendEvent(object, automaticDrop, noEventSend) |
66 | if noEventSend == nil or noEventSend == false then |
67 | if g_server ~= nil then |
68 | g_server:broadcastEvent(BalerAutomaticDropEvent.new(object, automaticDrop), nil, nil, object) |
69 | else |
70 | g_client:getServerConnection():sendEvent(BalerAutomaticDropEvent.new(object, automaticDrop)) |
71 | end |
72 | end |
73 | end |
writeStream
DescriptionCalled on server side on joinDefinition
writeStream(integer streamId, integer connection)Arguments
integer | streamId | streamId |
integer | connection | connection |
42 | function BalerAutomaticDropEvent:writeStream(streamId, connection) |
43 | NetworkUtil.writeNodeObject(streamId, self.object) |
44 | streamWriteBool(streamId, self.automaticDrop) |
45 | end |