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
VehicleEnterResponseEvent
DescriptionEvent for enter responseParent
EventFunctions
emptyNew
DescriptionCreate instance of Event classDefinition
emptyNew()Return Values
table | self | instance of class event |
14 | function VehicleEnterResponseEvent.emptyNew() |
15 | local self = Event.new(VehicleEnterResponseEvent_mt) |
16 | return self |
17 | end |
new
DescriptionCreate new instance of eventDefinition
new(table id, boolean isOwner, table playerStyle)Arguments
table | id | id |
boolean | isOwner | is owner |
table | playerStyle |
table | instance | instance of event |
25 | function VehicleEnterResponseEvent.new(id, isOwner, playerStyle, farmId, userId) |
26 | local self = VehicleEnterResponseEvent.emptyNew() |
27 | |
28 | self.id = id |
29 | self.isOwner = isOwner |
30 | self.playerStyle = playerStyle |
31 | self.farmId = farmId |
32 | self.userId = userId |
33 | |
34 | return self |
35 | end |
readStream
DescriptionCalled on client side on joinDefinition
readStream(integer streamId, integer connection)Arguments
integer | streamId | streamId |
integer | connection | connection |
41 | function VehicleEnterResponseEvent:readStream(streamId, connection) |
42 | self.id = NetworkUtil.readNodeObjectId(streamId) |
43 | self.isOwner = streamReadBool(streamId) |
44 | |
45 | if self.playerStyle == nil then |
46 | self.playerStyle = PlayerStyle.new() |
47 | end |
48 | self.playerStyle:readStream(streamId, connection) |
49 | |
50 | self.farmId = streamReadUIntN(streamId, FarmManager.FARM_ID_SEND_NUM_BITS) |
51 | self.userId = streamReadInt32(streamId) |
52 | self:run(connection) |
53 | end |
run
DescriptionRun action on receiving sideDefinition
run(integer connection)Arguments
integer | connection | connection |
72 | function VehicleEnterResponseEvent:run(connection) |
73 | local object = NetworkUtil.getObject(self.id) |
74 | |
75 | if object ~= nil and object:getIsSynchronized() then |
76 | if self.isOwner then |
77 | g_currentMission:onEnterVehicle(object, self.playerStyle, self.farmId, self.userId) |
78 | else |
79 | local enterableSpec = object.spec_enterable |
80 | if enterableSpec ~= nil then |
81 | if not enterableSpec.isEntered then |
82 | object:enterVehicle(false, self.playerStyle, self.farmId, self.userId) |
83 | end |
84 | end |
85 | end |
86 | end |
87 | end |
writeStream
DescriptionCalled on server side on joinDefinition
writeStream(integer streamId, integer connection)Arguments
integer | streamId | streamId |
integer | connection | connection |
59 | function VehicleEnterResponseEvent:writeStream(streamId, connection) |
60 | NetworkUtil.writeNodeObjectId(streamId, self.id) |
61 | streamWriteBool(streamId, self.isOwner) |
62 | |
63 | self.playerStyle:writeStream(streamId, connection) |
64 | |
65 | streamWriteUIntN(streamId, self.farmId, FarmManager.FARM_ID_SEND_NUM_BITS) |
66 | streamWriteInt32(streamId, self.userId) |
67 | end |