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
VehicleBundleAttachEvent
DescriptionEvent for bundle attachingFunctions
emptyNew
DescriptionCreate instance of Event classDefinition
emptyNew()Return Values
table | self | instance of class event |
14 | function VehicleBundleAttachEvent:emptyNew() |
15 | local self = Event:new(VehicleBundleAttachEvent_mt); |
16 | return self; |
17 | end; |
new
DescriptionCreate new instance of eventDefinition
new(table bundles)Arguments
table | bundles | bundles |
table | instance | instance of event |
23 | function VehicleBundleAttachEvent:new(bundles) |
24 | local self = VehicleBundleAttachEvent:emptyNew() |
25 | self.bundles = bundles; |
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 VehicleBundleAttachEvent:readStream(streamId, connection) |
34 | local numBundles = streamReadUInt8(streamId) |
35 | for i=1, numBundles do |
36 | local v1 = readNetworkNodeObjectId(streamId) |
37 | local v2 = readNetworkNodeObjectId(streamId) |
38 | local inputJointIndex = streamReadUIntN(streamId, 7); |
39 | local jointIndex = streamReadUIntN(streamId, 7); |
40 | table.insert(g_currentMission.vehiclesToAttach, {v1id=v1, v2id=v2, inputJointIndex=inputJointIndex, jointIndex=jointIndex}) |
41 | end |
42 | end; |
writeStream
DescriptionCalled on server side on joinDefinition
writeStream(integer streamId, integer connection)Arguments
integer | streamId | streamId |
integer | connection | connection |
48 | function VehicleBundleAttachEvent:writeStream(streamId, connection) |
49 | streamWriteUInt8(streamId, #self.bundles) |
50 | for i=1, #self.bundles do |
51 | local bundle = self.bundles[i] |
52 | writeNetworkNodeObjectId(streamId, networkGetObjectId(bundle.v1)); |
53 | writeNetworkNodeObjectId(streamId, networkGetObjectId(bundle.v2)); |
54 | streamWriteUIntN(streamId, bundle.input, 7); |
55 | streamWriteUIntN(streamId, bundle.attacher, 7); |
56 | end |
57 | end; |
run
DescriptionRun action on receiving sideDefinition
run(integer connection)Arguments
integer | connection | connection |
62 | function VehicleBundleAttachEvent:run(connection) |
63 | self.vehicle:attachImplement(self.implement, self.inputJointIndex, self.jointIndex, true, nil, self.startLowered); |
64 | if not connection:getIsServer() then |
65 | g_server:broadcastEvent(self, nil, connection, self.object); |
66 | end; |
67 | end; |