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
PlaceableLightsStateEvent
DescriptionEvent for toggeling placeable light stateParent
EventFunctions
emptyNew
DescriptionCreate instance of Event classDefinition
emptyNew()Return Values
table | self | instance of class event |
14 | function PlaceableLightsStateEvent.emptyNew() |
15 | return Event.new(PlaceableLightsStateEvent_mt) |
16 | end |
new
DescriptionCreate new instance of eventDefinition
new(table object, integer groupIndex, boolean isActive)Arguments
table | object | object |
integer | groupIndex | index of group |
boolean | isActive | is active |
23 | function PlaceableLightsStateEvent.new(placeable, groupIndex, isActive) |
24 | local self = PlaceableLightsStateEvent.emptyNew() |
25 | self.placeable = placeable |
26 | self.groupIndex = groupIndex |
27 | self.isActive = isActive |
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 PlaceableLightsStateEvent:readStream(streamId, connection) |
36 | self.placeable = NetworkUtil.readNodeObject(streamId) |
37 | self.groupIndex = streamReadUIntN(streamId, PlaceableLights.MAX_NUM_BITS) |
38 | self.isActive = streamReadBool(streamId) |
39 | self:run(connection) |
40 | end |
run
DescriptionRun action on receiving sideDefinition
run(integer connection)Arguments
integer | connection | connection |
55 | function PlaceableLightsStateEvent:run(connection) |
56 | if not connection:getIsServer() then |
57 | g_server:broadcastEvent(self, false, connection, self.placeable) |
58 | end |
59 | |
60 | if self.placeable ~= nil and self.placeable:getIsSynchronized() and self.placeable.setGroupIsActive ~= nil then |
61 | self.placeable:setGroupIsActive(self.groupIndex, self.isActive, true) |
62 | end |
63 | end |
sendEvent
DescriptionBroadcast event from server to all clients, if called on client call function on server and broadcast it to all clientsDefinition
sendEvent(table lightSystem, integer groupIndex, boolean isActive)Arguments
table | lightSystem | lightSystem object |
integer | groupIndex | index of group |
boolean | isActive | is active |
70 | function PlaceableLightsStateEvent.sendEvent(placeable, groupIndex, isActive, noEventSend) |
71 | if noEventSend == nil or noEventSend == false then |
72 | if g_server ~= nil then |
73 | g_server:broadcastEvent(PlaceableLightsStateEvent.new(placeable, groupIndex, isActive), nil, nil, placeable) |
74 | else |
75 | g_client:getServerConnection():sendEvent(PlaceableLightsStateEvent.new(placeable, groupIndex, isActive)) |
76 | end |
77 | end |
78 | end |
writeStream
DescriptionCalled on server side on joinDefinition
writeStream(integer streamId, integer connection)Arguments
integer | streamId | streamId |
integer | connection | connection |
46 | function PlaceableLightsStateEvent:writeStream(streamId, connection) |
47 | NetworkUtil.writeNodeObject(streamId, self.placeable) |
48 | streamWriteUIntN(streamId, self.groupIndex, PlaceableLights.MAX_NUM_BITS) |
49 | streamWriteBool(streamId, self.isActive) |
50 | end |