Script v1.4.4.0
- Handtools
- Events
- Objects
- AnimatedObject
- Bale
- Basketball
- Bga
- BunkerSilo
- FieldDefinition
- FillablePallet
- HelpIcons
- MountableObject
- Nightlight2
- NightlightFlicker
- PhysicsObject
- Rotator
- SaplingPallet
- ShovelTarget
- SimParticleSystem
- StationCrane
- Storage
- TourIcons
- Train
- VehicleSellingPoint
- Placeables
- Triggers
- Utils
- Vehicles
- Specializations
Engine v7.0.0.2
- General
- Entity
- Node
- Scenegraph
- Lighting
- Camera
- Shape
- Particle System
- Physics
- Spline
- Animation
- Overlays
- Sound
- Input
- XML
- Network
- Callbacks
- Text Rendering
- Terrain Detail
- Tire Track
- Editor
- Rendering
- String
- Math
- I3D
- Fillplanes
Foundation Reference
Nightlight2
DescriptionClass for nightlight objects which are blending in on nightFunctions
onCreate
DescriptionCreating nightlight objectDefinition
onCreate(integer id)Arguments
integer | id | ID of the node |
15 | function Nightlight2:onCreate(id) |
16 | g_currentMission:addNonUpdateable(Nightlight2:new(id)); |
17 | end; |
new
DescriptionCreating nightlight objectDefinition
new(integer name)Arguments
integer | name | ID of the node |
table | instance | Instance of object |
23 | function Nightlight2:new(id) |
24 | local self = {}; |
25 | setmetatable(self, Nightlight2_mt); |
26 | |
27 | g_currentMission.environment:addWeatherChangeListener(self); |
28 | |
29 | self.id = id; |
30 | setVisibility(self.id, false); |
31 | |
32 | return self; |
33 | end; |
delete
DescriptionRemove Object from WeatherChangeListenersDefinition
delete()Code
37 | function Nightlight2:delete() |
38 | if g_currentMission.environment ~= nil then |
39 | g_currentMission.environment:removeWeatherChangeListener(self); |
40 | end; |
41 | end; |
weatherChanged
DescriptionChange visibility of night objectDefinition
weatherChanged()Code
45 | function Nightlight2:weatherChanged() |
46 | if g_currentMission ~= nil and g_currentMission.environment ~= nil then |
47 | setVisibility(self.id, not (g_currentMission.environment.isSunOn and g_currentMission.environment.currentRain == nil)); |
48 | end; |
49 | end; |