Script v1.7.1.0
- AI
- Animals
- Contracts
- Debug
- Economy
- Effects
- Events
- 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
- streamGetNumOfUnreadBits
- streamGetReadOffset
- streamGetWriteOffset
- streamReadBool
- streamReadFloat32
- streamReadInt16
- streamReadInt32
- streamReadInt8
- streamReadIntN
- streamReadManualTimestamp
- streamReadString
- streamReadUInt16
- streamReadUInt8
- streamReadUIntN
- streamSetReadOffset
- streamSetWriteOffset
- streamWriteBool
- streamWriteFloat32
- streamWriteInt16
- streamWriteInt32
- streamWriteInt8
- streamWriteIntN
- streamWriteManualTimestamp
- streamWriteStream
- streamWriteString
- streamWriteUInt16
- streamWriteUInt8
- streamWriteUIntN
- Node
- Overlays
- Particle System
- Physics
- Rendering
- Scenegraph
- Shape
- Sound
- Spline
- String
- Terrain Detail
- Text Rendering
- Tire Track
- XML
- general
Foundation Reference
TrailerToggleTipSideEvent
DescriptionEvent for toggle trailer tippingParent
EventFunctions
emptyNew
DescriptionCreate instance of Event classDefinition
emptyNew()Return Values
table | self | instance of class event |
13 | function TrailerToggleTipSideEvent:emptyNew() |
14 | local self = Event:new(TrailerToggleTipSideEvent_mt) |
15 | return self |
16 | end |
new
DescriptionCreate new instance of eventDefinition
new(table object, boolean isStart, table tipTrigger, integer tipSideIndex)Arguments
table | object | object |
boolean | isStart | is start |
table | tipTrigger | tip trigger |
integer | tipSideIndex | index of tip side |
24 | function TrailerToggleTipSideEvent:new(object, tipSideIndex) |
25 | local self = TrailerToggleTipSideEvent:emptyNew() |
26 | self.object = object |
27 | self.tipSideIndex = tipSideIndex |
28 | return self |
29 | end |
readStream
DescriptionCalled on client side on joinDefinition
readStream(integer streamId, integer connection)Arguments
integer | streamId | streamId |
integer | connection | connection |
35 | function TrailerToggleTipSideEvent:readStream(streamId, connection) |
36 | self.object = NetworkUtil.readNodeObject(streamId) |
37 | self.tipSideIndex = streamReadUIntN(streamId, Trailer.TIP_SIDE_NUM_BITS) |
38 | |
39 | self:run(connection) |
40 | end |
run
DescriptionRun action on receiving sideDefinition
run(integer connection)Arguments
integer | connection | connection |
54 | function TrailerToggleTipSideEvent:run(connection) |
55 | if not connection:getIsServer() then |
56 | g_server:broadcastEvent(self, false, connection, self.object) |
57 | end |
58 | |
59 | if self.object ~= nil then |
60 | self.object:setPreferedTipSide(self.tipSideIndex, true) |
61 | end |
62 | end |
writeStream
DescriptionCalled on server side on joinDefinition
writeStream(integer streamId, integer connection)Arguments
integer | streamId | streamId |
integer | connection | connection |
46 | function TrailerToggleTipSideEvent:writeStream(streamId, connection) |
47 | NetworkUtil.writeNodeObject(streamId, self.object) |
48 | streamWriteUIntN(streamId, self.tipSideIndex, Trailer.TIP_SIDE_NUM_BITS) |
49 | end |