Script v1.7.1.0
- AI
- Animals
- Contracts
- Debug
- Economy
- Effects
- Events
- Farms
- GUI
- Handtools
- I3d
- Materials
- Misc
- Objects
- Placeables
- Player
- Shop
- Sounds
- Specializations
- Triggers
- Utils
- Vehicles
- Weather
Engine v1.7.1.0
- AI
- Animation
- Camera
- Entity
- Fillplanes
- General
- I3D
- Input
- Lighting
- Math
- Network
- streamGetNumOfUnreadBits
- streamGetReadOffset
- streamGetWriteOffset
- streamReadBool
- streamReadFloat32
- streamReadInt16
- streamReadInt32
- streamReadInt8
- streamReadIntN
- streamReadManualTimestamp
- streamReadString
- streamReadUInt16
- streamReadUInt8
- streamReadUIntN
- streamSetReadOffset
- streamSetWriteOffset
- streamWriteBool
- streamWriteFloat32
- streamWriteInt16
- streamWriteInt32
- streamWriteInt8
- streamWriteIntN
- streamWriteManualTimestamp
- streamWriteStream
- streamWriteString
- streamWriteUInt16
- streamWriteUInt8
- streamWriteUIntN
- Node
- Overlays
- Particle System
- Physics
- Rendering
- Scenegraph
- Shape
- Sound
- Spline
- String
- Terrain Detail
- Text Rendering
- Tire Track
- XML
- general
Foundation Reference
BaleLoaderStateEvent
DescriptionEvent for bale loader stateParent
EventFunctions
emptyNew
DescriptionCreate instance of Event classDefinition
emptyNew()Return Values
table | self | instance of class event |
13 | function BaleLoaderStateEvent:emptyNew() |
14 | local self = Event:new(BaleLoaderStateEvent_mt); |
15 | return self; |
16 | end |
new
DescriptionCreate new instance of eventDefinition
new(table object, integer stateId, integer nearestBaleServerId)Arguments
table | object | object |
integer | stateId | stateId |
integer | nearestBaleServerId | nearestBaleServerId |
23 | function BaleLoaderStateEvent:new(object, stateId, nearestBaleServerId) |
24 | local self = BaleLoaderStateEvent:emptyNew() |
25 | self.object = object; |
26 | self.stateId = stateId; |
27 | assert(nearestBaleServerId ~= nil or self.stateId ~= BaleLoader.CHANGE_GRAB_BALE); |
28 | self.nearestBaleServerId = nearestBaleServerId; |
29 | return self; |
30 | end |
readStream
DescriptionCalled on client side on joinDefinition
readStream(integer streamId, integer connection)Arguments
integer | streamId | streamId |
integer | connection | connection |
36 | function BaleLoaderStateEvent:readStream(streamId, connection) |
37 | self.object = NetworkUtil.readNodeObject(streamId); |
38 | |
39 | self.stateId = streamReadInt8(streamId); |
40 | if self.stateId == BaleLoader.CHANGE_GRAB_BALE then |
41 | self.nearestBaleServerId = NetworkUtil.readNodeObjectId(streamId); |
42 | end; |
43 | self:run(connection); |
44 | end |
run
DescriptionRun action on receiving sideDefinition
run(integer connection)Arguments
integer | connection | connection |
61 | function BaleLoaderStateEvent:run(connection) |
62 | self.object:doStateChange(self.stateId, self.nearestBaleServerId); |
63 | end |
writeStream
DescriptionCalled on server side on joinDefinition
writeStream(integer streamId, integer connection)Arguments
integer | streamId | streamId |
integer | connection | connection |
50 | function BaleLoaderStateEvent:writeStream(streamId, connection) |
51 | NetworkUtil.writeNodeObject(streamId, self.object); |
52 | streamWriteInt8(streamId, self.stateId); |
53 | if self.stateId == BaleLoader.CHANGE_GRAB_BALE then |
54 | NetworkUtil.writeNodeObjectId(streamId, self.nearestBaleServerId); |
55 | end; |
56 | end |