Script v1_7_1_0
- AI
- Animals
- Collections
- Contracts
- Debug
- Economy
- Elements
- EnvironmentalScore
- Errors
- Events
- 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
- getMaterialCustomShaderFilename
- getMaterialCustomShaderVariation
- getMaterialDiffuseMapFilename
- getMaterialDiffuseMapHasAlpha
- getMaterialEmissiveMapFilename
- getMaterialEmissiveMapHasAlpha
- getMaterialGlossMapFilename
- getMaterialHasRefractionMap
- getMaterialIsAlphaBlended
- getMaterialIsAlphaTested
- getMaterialNormalMapFilename
- getMaterialNormalMapFormat
- getMaterialReflectionMapScaling
- setMaterialCustomMapFromFile
- setMaterialCustomShaderVariation
- setMaterialDiffuseMapFromFile
- setMaterialGlossMapFromFile
- setMaterialNormalMapFromFile
- Scenegraph
- Shape
- Sound
- Spline
- String
- Terrain Detail
- Text Rendering
- Tire Track
- VoiceChat
- XML
Foundation Reference
VehicleBundleAttachEvent
DescriptionEvent for bundle attachingParent
EventFunctions
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 _=1, numBundles do |
36 | local v1 = NetworkUtil.readNodeObjectId(streamId) |
37 | local v2 = NetworkUtil.readNodeObjectId(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 |
run
DescriptionRun action on receiving sideDefinition
run(integer connection)Arguments
integer | connection | connection |
62 | function VehicleBundleAttachEvent:run(connection) |
63 | if self.object ~= nil and self.object:getIsSynchronized() then |
64 | self.object:attachImplement(self.implement, self.inputJointIndex, self.jointIndex, true, nil, self.startLowered) |
65 | end |
66 | if not connection:getIsServer() then |
67 | g_server:broadcastEvent(self, nil, connection, self.object) |
68 | end |
69 | 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 | NetworkUtil.writeNodeObjectId(streamId, NetworkUtil.getObjectId(bundle.v1)) |
53 | NetworkUtil.writeNodeObjectId(streamId, NetworkUtil.getObjectId(bundle.v2)) |
54 | streamWriteUIntN(streamId, bundle.input, 7) |
55 | streamWriteUIntN(streamId, bundle.attacher, 7) |
56 | end |
57 | end |