Script v1.7.1.0
- AI
- Animals
- Contracts
- Debug
- Economy
- Effects
- Events
- AIConveyorBeltSetAngleEve...
- AIVehicleIsBlockedEvent
- AIVehicleSetStartedEvent
- AnimatedVehicleStartEvent
- AnimatedVehicleStopEvent
- BaleLoaderStateEvent
- BalerCreateBaleEvent
- BalerSetBaleTimeEvent
- BalerSetIsUnloadingBaleEv...
- BaleWrapperStateEvent
- BunkerSiloCloseEvent
- BunkerSiloOpenEvent
- ChainsawCutEvent
- ChainsawDelimbEvent
- ChainsawStateEvent
- CombineStrawEnableEvent
- CylinderedEasyControlChan...
- DrivableToggleLowerAllEve...
- FillUnitUnloadEvent
- FoldableSetFoldDirectionE...
- GreenhouseSetIsWaterTankF...
- HonkEvent
- HPWLanceStateEvent
- HPWPlaceableTurnOnEvent
- JumpEvent
- MixerWagonBaleNotAccepted...
- MowerToggleWindrowDropEve...
- PickupSetStateEvent
- PlantLimitToFieldEvent
- PlayerPermissionsEvent
- PlowLimitToFieldEvent
- PlowRotationEvent
- ReceivingHopperSetCreateB...
- ReverseDrivingSetStateEve...
- RidgeMarkerSetStateEvent
- SendLocomotiveToSplinePos...
- SetCoverStateEvent
- SetCrabSteeringEvent
- SetCruiseControlSpeedEven...
- SetCruiseControlStateEven...
- SetDischargeStateEvent
- SetFillUnitIsFillingEvent
- SetMotorTurnedOnEvent
- SetPipeStateEvent
- SetSeedIndexEvent
- SetTurnedOnEvent
- SetWorkModeEvent
- TensionBeltsEvent
- TensionBeltsRefreshEvent
- TrailerToggleTipSideEvent
- TreePlanterLoadPalletEven...
- VehicleAttachEvent
- VehicleBrokenEvent
- VehicleBundleAttachEvent
- VehicleDetachEvent
- VehicleEnterRequestEvent
- VehicleEnterResponseEvent
- VehicleLeaveEvent
- VehicleLowerImplementEven...
- VehicleSetBeaconLightEven...
- VehicleSetLightEvent
- VehicleSetTurnLightEvent
- WaterTrailerSetIsFillingE...
- WearableRepairEvent
- WoodHarvesterCutTreeEvent
- WoodHarvesterOnCutTreeEve...
- WoodHarvesterOnDelimbTree...
- 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
- Node
- Overlays
- Particle System
- Physics
- Rendering
- Scenegraph
- Shape
- Sound
- Spline
- String
- Terrain Detail
- Text Rendering
- Tire Track
- XML
- general
Foundation Reference
WearableRepairEvent
DescriptionEvent for repairingParent
EventFunctions
emptyNew
DescriptionCreate instance of Event classDefinition
emptyNew()Return Values
table | self | instance of class event |
13 | function WearableRepairEvent:emptyNew() |
14 | local self = Event:new(WearableRepairEvent_mt) |
15 | return self |
16 | end |
new
DescriptionCreate new instance of eventDefinition
new(table vehicle)Arguments
table | vehicle | vehicle |
21 | function WearableRepairEvent:new(vehicle, atSellingPoint) |
22 | local self = WearableRepairEvent:emptyNew() |
23 | self.vehicle = vehicle |
24 | self.atSellingPoint = atSellingPoint |
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 WearableRepairEvent:readStream(streamId, connection) |
33 | self.vehicle = NetworkUtil.readNodeObject(streamId) |
34 | self.atSellingPoint = streamReadBool(streamId) |
35 | self:run(connection) |
36 | end |
run
DescriptionRun action on receiving sideDefinition
run(integer connection)Arguments
integer | connection | connection |
50 | function WearableRepairEvent:run(connection) |
51 | if not connection:getIsServer() then |
52 | if self.vehicle.repairVehicle ~= nil then |
53 | self.vehicle:repairVehicle(self.atSellingPoint) |
54 | |
55 | g_server:broadcastEvent(self) -- broadcast for UI updates |
56 | g_messageCenter:publish(MessageType.VEHICLE_REPAIRED, {self.vehicle, self.atSellingPoint}) |
57 | end |
58 | else |
59 | g_messageCenter:publish(MessageType.VEHICLE_REPAIRED, {self.vehicle, self.atSellingPoint}) |
60 | end |
61 | end |
writeStream
DescriptionCalled on server side on joinDefinition
writeStream(integer streamId, integer connection)Arguments
integer | streamId | streamId |
integer | connection | connection |
42 | function WearableRepairEvent:writeStream(streamId, connection) |
43 | NetworkUtil.writeNodeObject(streamId, self.vehicle) |
44 | streamWriteBool(streamId, self.atSellingPoint) |
45 | end |