/
RandomLights.cfg
94 lines (79 loc) · 2.25 KB
/
RandomLights.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
// Example of using the "random" color syntax. Adds three lights to
// the Mk1 structural fuselage which, when turned on, blink in random
// patterns.
@PART[Mk1FuselageStructural] {
@description ^= :(.)$:$0 With random lights!:
//-------------------------------------------------------------------------
// INDICATOR MESHES
//-------------------------------------------------------------------------
MODEL
{
model = IndicatorLights/Meshes/squareLamp
scale = 1, 0.5, 1
position = 0, 0.3, -0.625
rotation = 0, 180, 0
}
MODEL
{
model = IndicatorLights/Meshes/squareLamp
scale = 1, 0.5, 1
position = 0, 0, -0.625
rotation = 0, 180, 0
}
MODEL
{
model = IndicatorLights/Meshes/squareLamp
scale = 1, 0.5, 1
position = 0, -0.3, -0.625
rotation = 0, 180, 0
}
//-------------------------------------------------------------------------
// CONTROLLABLE EMISSIVES
//-------------------------------------------------------------------------
MODULE {
name = ModuleControllableEmissive
target = IndicatorLights/Meshes/squareLamp:0
emissiveName = indicator1
}
MODULE {
name = ModuleControllableEmissive
target = IndicatorLights/Meshes/squareLamp:1
emissiveName = indicator2
}
MODULE {
name = ModuleControllableEmissive
target = IndicatorLights/Meshes/squareLamp:2
emissiveName = indicator3
}
//-------------------------------------------------------------------------
// CONTROLLERS
//-------------------------------------------------------------------------
// This turns everybody on and off.
MODULE {
name = ModuleToggleLED
}
MODULE {
name = ModuleBooleanIndicator
input = ModuleToggleLED
// Bias of +0.6 means it's on most of the time.
activeColor = random($ToggleLED, $Off, 50, 0.6)
inactiveColor = $Off
emissiveName = indicator1
}
MODULE {
name = ModuleBooleanIndicator
input = ModuleToggleLED
// Fun with compound color sources! :-)
activeColor = random(random($ToggleLED, $Off, 50, 0.6), random(#FF0000, $Off, 50, -0.3), 300)
inactiveColor = $Off
emissiveName = indicator2
}
MODULE {
name = ModuleBooleanIndicator
input = ModuleToggleLED
// Bias of -0.5 means it's off most of the time.
activeColor = random($ToggleLED, $Off, 50, -0.5)
inactiveColor = $Off
emissiveName = indicator3
}
}