Script v1.4.4.0
- Handtools
- Events
- AIVehicleRotateLeftEvent
- AIVehicleRotateRightEvent
- AIVehicleSetConveyorBeltA...
- AIVehicleSetStartedEvent
- AnimatedVehicleStartEvent
- AnimatedVehicleStopEvent
- BaleLoaderStateEvent
- BalerCreateBaleEvent
- BalerSetBaleTimeEvent
- BalerSetIsUnloadingBaleEv...
- BaleWrapperStateEvent
- BunkerSiloCloseEvent
- BunkerSiloOpenEvent
- ChainsawCutEvent
- ChainsawDelimbEvent
- ChainsawStateEvent
- CombineStrawEnableEvent
- DrivableToggleLowerAllEve...
- FoldableSetFoldDirectionE...
- GreenhouseSetIsWaterTankF...
- HonkEvent
- HPWPlaceableStateEvent
- HPWPlaceableTurnOnEvent
- MixerWagonBaleNotAccepted...
- MowerToggleWindrowDropEve...
- OverloadingToggleUnloadEv...
- PickupSetStateEvent
- PlantLimitToFieldEvent
- PloughLimitToFieldEvent
- PloughRotationEvent
- ReceivingHopperSetCreateB...
- ReverseDrivingSetStateEve...
- RidgeMarkerSetStateEvent
- SetCoverStateEvent
- SetCrabSteeringEvent
- SetCruiseControlSpeedEven...
- SetCruiseControlStateEven...
- SetDischargeToGroundEvent
- SetIsFillingEvent
- SetMotorTurnedOnEvent
- SetPipeStateEvent
- SetTurnedOnEvent
- SowingMachineSetSeedIndex
- SteerableToggleRefuelEven...
- StrawBlowerDoorOpenEvent
- TensionBeltsEvent
- TensionBeltsRefreshEvent
- TrailerToggleTipEvent
- TreePlanterLoadPalletEven...
- VehicleAttachEvent
- VehicleBundleAttachEvent
- VehicleDetachEvent
- VehicleEnterRequestEvent
- VehicleEnterResponseEvent
- VehicleLeaveEvent
- VehicleLowerImplementEven...
- VehicleSetBeaconLightEven...
- VehicleSetLightEvent
- VehicleSetTurnLightEvent
- WaterTrailerSetIsFillingE...
- WoodHarvesterCutTreeEvent
- WoodHarvesterOnCutTreeEve...
- WoodHarvesterOnDelimbTree...
- Objects
- Placeables
- Triggers
- Utils
- Vehicles
- Specializations
Engine v7.0.0.2
- General
- Entity
- Node
- Scenegraph
- Lighting
- Camera
- Shape
- Particle System
- Physics
- Spline
- Animation
- Overlays
- Sound
- Input
- XML
- Network
- Callbacks
- Text Rendering
- Terrain Detail
- Tire Track
- Editor
- Rendering
- String
- Math
- I3D
- Fillplanes
Foundation Reference
GreenhouseSetIsWaterTankFillingEvent
DescriptionEvent for greenhouse tank filling stateFunctions
emptyNew
DescriptionCreate instance of Event classDefinition
emptyNew()Return Values
table | self | instance of class event |
15 | function GreenhouseSetIsWaterTankFillingEvent:emptyNew() |
16 | local self = Event:new(GreenhouseSetIsWaterTankFillingEvent_mt); |
17 | return self; |
18 | end; |
new
DescriptionCreate new instance of eventDefinition
new(table object, boolean isFilling, table trailer)Arguments
table | object | object |
boolean | isFilling | is filling |
table | trailer | trailer |
table | instance | instance of event |
26 | function GreenhouseSetIsWaterTankFillingEvent:new(object, isFilling, trailer) |
27 | local self = GreenhouseSetIsWaterTankFillingEvent:emptyNew() |
28 | self.object = object; |
29 | self.isFilling = isFilling; |
30 | self.trailer = trailer; |
31 | return self; |
32 | end; |
readStream
DescriptionCalled on client side on joinDefinition
readStream(integer streamId, integer connection)Arguments
integer | streamId | streamId |
integer | connection | connection |
38 | function GreenhouseSetIsWaterTankFillingEvent:readStream(streamId, connection) |
39 | self.object = readNetworkNodeObject(streamId); |
40 | self.isFilling = streamReadBool(streamId); |
41 | if self.isFilling and not connection:getIsServer() then |
42 | self.trailer = readNetworkNodeObject(streamId); |
43 | end; |
44 | self:run(connection); |
45 | end; |
writeStream
DescriptionCalled on server side on joinDefinition
writeStream(integer streamId, integer connection)Arguments
integer | streamId | streamId |
integer | connection | connection |
51 | function GreenhouseSetIsWaterTankFillingEvent:writeStream(streamId, connection) |
52 | writeNetworkNodeObject(streamId, self.object); |
53 | streamWriteBool(streamId, self.isFilling); |
54 | if self.isFilling and connection:getIsServer() then |
55 | writeNetworkNodeObject(streamId, self.trailer); |
56 | end; |
57 | end; |
run
DescriptionRun action on receiving sideDefinition
run(integer connection)Arguments
integer | connection | connection |
62 | function GreenhouseSetIsWaterTankFillingEvent:run(connection) |
63 | if not connection:getIsServer() then |
64 | g_server:broadcastEvent(self, false, connection, self.object); |
65 | end; |
66 | self.object:setIsWaterTankFilling(self.isFilling, self.trailer, true); |
67 | 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 isFilling, table trailer, boolean noEventSend)Arguments
table | object | object |
boolean | isFilling | is filling |
table | trailer | trailer |
boolean | noEventSend | no event send |
75 | function GreenhouseSetIsWaterTankFillingEvent.sendEvent(object, isFilling, trailer, noEventSend) |
76 | if isFilling ~= object.isWaterTankFilling then |
77 | if noEventSend == nil or noEventSend == false then |
78 | if g_server ~= nil then |
79 | g_server:broadcastEvent(GreenhouseSetIsWaterTankFillingEvent:new(object, isFilling, trailer), nil, nil, object); |
80 | else |
81 | assert(not isFilling or (trailer ~= nil)); |
82 | g_client:getServerConnection():sendEvent(GreenhouseSetIsWaterTankFillingEvent:new(object, isFilling, trailer)); |
83 | end; |
84 | end; |
85 | end; |
86 | end; |