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
ChainsawCutEvent
DescriptionEvent for cuttingParent
EventFunctions
emptyNew
DescriptionCreate instance of Event classDefinition
emptyNew()Return Values
table | self | instance of class event |
14 | function ChainsawCutEvent:emptyNew() |
15 | local self = Event:new(ChainsawCutEvent_mt); |
16 | return self; |
17 | end |
new
DescriptionCreate new instance of eventDefinition
new(integer splitShapeId, float x, float y, float z, float nx, float ny, float nz, float yx, float yy, float yz, float cutSizeY, float cutSizeZ)Arguments
integer | splitShapeId | id of split shape |
float | x | x |
float | y | y |
float | z | z |
float | nx | nx |
float | ny | ny |
float | nz | nz |
float | yx | yx |
float | yy | yy |
float | yz | yz |
float | cutSizeY | y cut size |
float | cutSizeZ | z cut size |
table | instance | instance of event |
34 | function ChainsawCutEvent:new(splitShapeId, x,y,z, nx,ny,nz, yx,yy,yz, cutSizeY, cutSizeZ, farmId) |
35 | local self = ChainsawCutEvent:emptyNew() |
36 | self.splitShapeId = splitShapeId; |
37 | self.x,self.y,self.z = x,y,z; |
38 | self.nx,self.ny,self.nz = nx,ny,nz; |
39 | self.yx,self.yy,self.yz = yx,yy,yz; |
40 | self.cutSizeY,self.cutSizeZ = cutSizeY,cutSizeZ; |
41 | self.farmId = farmId |
42 | return self; |
43 | end |
readStream
DescriptionCalled on client side on joinDefinition
readStream(integer streamId, integer connection)Arguments
integer | streamId | streamId |
integer | connection | connection |
49 | function ChainsawCutEvent:readStream(streamId, connection) |
50 | if not connection:getIsServer() then |
51 | local splitShapeId = readSplitShapeIdFromStream(streamId); |
52 | local x = streamReadFloat32(streamId); |
53 | local y = streamReadFloat32(streamId); |
54 | local z = streamReadFloat32(streamId); |
55 | local nx = streamReadFloat32(streamId); |
56 | local ny = streamReadFloat32(streamId); |
57 | local nz = streamReadFloat32(streamId); |
58 | local yx = streamReadFloat32(streamId); |
59 | local yy = streamReadFloat32(streamId); |
60 | local yz = streamReadFloat32(streamId); |
61 | local cutSizeY = streamReadFloat32(streamId); |
62 | local cutSizeZ = streamReadFloat32(streamId); |
63 | local farmId = streamReadUIntN(streamId, FarmManager.FARM_ID_SEND_NUM_BITS) |
64 | |
65 | if splitShapeId ~= 0 then |
66 | ChainsawUtil.cutSplitShape(splitShapeId, x,y,z, nx,ny,nz, yx,yy,yz, cutSizeY, cutSizeZ, farmId); |
67 | end |
68 | end |
69 | end |
run
DescriptionRun action on receiving sideDefinition
run(integer connection)Arguments
integer | connection | connection |
96 | function ChainsawCutEvent:run(connection) |
97 | print("Error: ChainsawCutEvent is not allowed to be executed on a local client"); |
98 | end |
writeStream
DescriptionCalled on server side on joinDefinition
writeStream(integer streamId, integer connection)Arguments
integer | streamId | streamId |
integer | connection | connection |
75 | function ChainsawCutEvent:writeStream(streamId, connection) |
76 | if connection:getIsServer() then |
77 | writeSplitShapeIdToStream(streamId, self.splitShapeId); |
78 | streamWriteFloat32(streamId, self.x); |
79 | streamWriteFloat32(streamId, self.y); |
80 | streamWriteFloat32(streamId, self.z); |
81 | streamWriteFloat32(streamId, self.nx); |
82 | streamWriteFloat32(streamId, self.ny); |
83 | streamWriteFloat32(streamId, self.nz); |
84 | streamWriteFloat32(streamId, self.yx); |
85 | streamWriteFloat32(streamId, self.yy); |
86 | streamWriteFloat32(streamId, self.yz); |
87 | streamWriteFloat32(streamId, self.cutSizeY); |
88 | streamWriteFloat32(streamId, self.cutSizeZ); |
89 | streamWriteFloat32(streamId, self.farmId) |
90 | end |
91 | end |