Script v1_7_1_0
- AI
- Animals
- Collections
- Contracts
- Debug
- Economy
- Elements
- EnvironmentalScore
- Errors
- Events
- AdditionalFieldBuyInfoEve...
- AIConveyorBeltSetAngleEve...
- AIFieldWorkerStateEvent
- AIJobSkipTaskEvent
- AIJobStartEvent
- AIJobStartRequestEvent
- AIJobStopEvent
- AIJobVehicleStateEvent
- AITaskStartEvent
- AITaskStopEvent
- AIVehicleIsBlockedEvent
- AnimalCleanEvent
- AnimalHusbandryNoMorePall...
- AnimalNameEvent
- AnimalRidingEvent
- AnimatedVehicleStartEvent
- AnimatedVehicleStopEvent
- BaleLoaderStateEvent
- BaleOpenEvent
- BalerAutomaticDropEvent
- BalerBaleTypeEvent
- BalerCreateBaleEvent
- BalerDropFromPlatformEven...
- BalerSetBaleTimeEvent
- BalerSetIsUnloadingBaleEv...
- BaleUnpackEvent
- BaleWrapperAutomaticDropE...
- BaleWrapperStateEvent
- BunkerSiloCloseEvent
- BunkerSiloOpenEvent
- ChainsawCutEvent
- ChainsawDelimbEvent
- ChainsawStateEvent
- CombineStrawEnableEvent
- CropSensorStateEvent
- DogFetchItemEvent
- DogFollowEvent
- DogPetEvent
- DrivableToggleLowerAllEve...
- EnvironmentalScoreEvent
- ExtendedSowingMachineRate...
- ExtendedSprayerAmountEven...
- ExtendedSprayerDefaultFru...
- FarmlandStatisticsEvent
- FarmlandStatisticsResetEv...
- FillUnitUnloadEvent
- FoldableSetFoldDirectionE...
- HonkEvent
- HPWLanceStateEvent
- InlineBaleOpenEvent
- InlineWrapperPushOffEvent
- JumpEvent
- LocomotiveStateEvent
- MixerWagonBaleNotAccepted...
- MotorGearShiftEvent
- MowerToggleWindrowDropEve...
- PickupSetStateEvent
- PlaceableFenceAddGateEven...
- PlaceableFenceAddSegmentE...
- PlaceableFenceRemoveSegme...
- PlaceableHighPressureWash...
- PlaceableLightsStateEvent
- PlaceableTrainSystemRentE...
- PlaceableTrainSystemSellE...
- PlantLimitToFieldEvent
- PlayerPermissionsEvent
- PlayerPickUpObjectEvent
- PlayerRequestStyleEvent
- PlayerSetFarmAnswerEvent
- PlayerSetFarmEvent
- PlayerSetHandToolEvent
- PlayerSetNicknameEvent
- PlayerSetStyleEvent
- PlayerSwitchedFarmEvent
- PlayerTeleportEvent
- PlayerThrowObjectEvent
- PlayerToggleLightEvent
- PlowLimitToFieldEvent
- PlowPackerStateEvent
- PlowRotationEvent
- ProductionPointOutputMode...
- ProductionPointProduction...
- ProductionPointProduction...
- PurchaseSoilMapsEvent
- ReceivingHopperSetCreateB...
- RequestEnvironmentalScore...
- RequestFarmlandStatistics...
- RequestFieldBuyInfoEvent
- ResetYieldMapEvent
- ReverseDrivingSetStateEve...
- RideableStableNotificatio...
- RidgeMarkerSetStateEvent
- SetCoverStateEvent
- SetCrabSteeringEvent
- SetCruiseControlSpeedEven...
- SetCruiseControlStateEven...
- SetDischargeStateEvent
- SetFillUnitCapacityEvent
- SetFillUnitIsFillingEvent
- SetMotorTurnedOnEvent
- SetPipeDischargeToGroundE...
- SetPipeStateEvent
- SetSeedIndexEvent
- SetTurnedOnEvent
- SetWorkModeEvent
- SoilSamplerSendEvent
- SoilSamplerStartEvent
- SprayerDoubledAmountEvent
- TensionBeltsEvent
- TensionBeltsRefreshEvent
- TrailerToggleManualDoorEv...
- TrailerToggleManualTipEve...
- TrailerToggleTipSideEvent
- TreePlanterLoadPalletEven...
- VariableWorkWidthStateEve...
- VehicleAttachEvent
- VehicleAttachRequestEvent
- VehicleBrokenEvent
- VehicleBundleAttachEvent
- VehicleDetachEvent
- VehicleEnterRequestEvent
- VehicleEnterResponseEvent
- VehicleLeaveEvent
- VehicleLowerImplementEven...
- VehiclePlayerStyleChanged...
- VehicleSetBeaconLightEven...
- VehicleSetIsReconfigurati...
- VehicleSetLightEvent
- VehicleSettingsChangeEven...
- VehicleSetTurnLightEvent
- WaterTrailerSetIsFillingE...
- WearableRepaintEvent
- WearableRepairEvent
- WoodHarvesterCutTreeEvent
- WoodHarvesterOnCutTreeEve...
- WoodHarvesterOnDelimbTree...
- GUI
- Handtools
- Hud
- I3d
- Input
- Jobs
- Maps
- Materials
- Misc
- Objects
- Parameters
- Placeables
- Placement
- Player
- Shop
- Sounds
- Specialization
- Specializations
- StateMachine
- Statistics
- Tasks
- Triggers
- Utils
- Vehicles
Engine v1_7_1_0
- AI
- Animation
- Camera
- Entity
- Fillplanes
- general
- General
- I3D
- Input
- Lighting
- Math
- Network
- Node
- NoteNode
- Overlays
- Particle System
- Physics
- Rendering
- Scenegraph
- Shape
- Sound
- Spline
- String
- Terrain Detail
- Text Rendering
- Tire Track
- VoiceChat
- XML
Foundation Reference
VehicleEnterRequestEvent
DescriptionEvent for enter requestParent
EventFunctions
emptyNew
DescriptionCreate instance of Event classDefinition
emptyNew()Return Values
table | self | instance of class event |
14 | function VehicleEnterRequestEvent.emptyNew() |
15 | local self = Event.new(VehicleEnterRequestEvent_mt) |
16 | return self |
17 | end |
new
DescriptionCreate new instance of eventDefinition
new(table object, table playerStyle)Arguments
table | object | object |
table | playerStyle | info |
table | instance | instance of event |
24 | function VehicleEnterRequestEvent.new(object, playerStyle, farmId) |
25 | local self = VehicleEnterRequestEvent.emptyNew() |
26 | self.object = object |
27 | self.objectId = NetworkUtil.getObjectId(self.object) |
28 | self.farmId = farmId |
29 | self.playerStyle = playerStyle |
30 | return self |
31 | end |
readStream
DescriptionCalled on client side on joinDefinition
readStream(integer streamId, integer connection)Arguments
integer | streamId | streamId |
integer | connection | connection |
37 | function VehicleEnterRequestEvent:readStream(streamId, connection) |
38 | self.objectId = NetworkUtil.readNodeObjectId(streamId) |
39 | self.farmId = streamReadUIntN(streamId, FarmManager.FARM_ID_SEND_NUM_BITS) |
40 | |
41 | if self.playerStyle == nil then |
42 | self.playerStyle = PlayerStyle.new() |
43 | end |
44 | self.playerStyle:readStream(streamId, connection) |
45 | |
46 | self.object = NetworkUtil.getObject(self.objectId) |
47 | self:run(connection) |
48 | end |
run
DescriptionRun action on receiving sideDefinition
run(integer connection)Arguments
integer | connection | connection |
63 | function VehicleEnterRequestEvent:run(connection) |
64 | if self.object ~= nil and self.object:getIsSynchronized() then |
65 | local enterableSpec = self.object.spec_enterable |
66 | if enterableSpec ~= nil and enterableSpec.isControlled == false then |
67 | self.object:setOwner(connection) |
68 | self.object.controllerFarmId = self.farmId |
69 | |
70 | local userId = g_currentMission.userManager:getUserIdByConnection(connection) |
71 | self.object.controllerUserId = userId |
72 | g_server:broadcastEvent(VehicleEnterResponseEvent.new(self.objectId, false, self.playerStyle, self.farmId, userId), true, connection, self.object, false, nil, true) |
73 | connection:sendEvent(VehicleEnterResponseEvent.new(self.objectId, true, self.playerStyle, self.farmId, userId)) |
74 | end |
75 | end |
76 | end |
writeStream
DescriptionCalled on server side on joinDefinition
writeStream(integer streamId, integer connection)Arguments
integer | streamId | streamId |
integer | connection | connection |
54 | function VehicleEnterRequestEvent:writeStream(streamId, connection) |
55 | NetworkUtil.writeNodeObjectId(streamId, self.objectId) |
56 | streamWriteUIntN(streamId, self.farmId, FarmManager.FARM_ID_SEND_NUM_BITS) |
57 | self.playerStyle:writeStream(streamId, connection) |
58 | end |