Advertisement
Guest User

Indicator Lights + Kerbonov Patch

a guest
Jul 7th, 2019
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.99 KB | None | 0 0
  1. // A Series of patches for the Kerbonov parts pack, including the Kn-2, the Kn-7, the passenber cabin, and if all goes well, the antenna.
  2. // Descriptions, headers, format, etc. gratuitously lifted from other examples in the Indicator Lights mod by Snark.
  3.  
  4.  
  5.  
  6.  
  7. //Add an indicator (replace one of the bulbs) on the VHF antenna. The other bulb is left as a static "light" element on the model that does not function. Possibly cover that with an additional indicator for available data to transmit? whether it has power?
  8. @PART[VHFTransceiver]:NEEDS[kerbonov]
  9. {
  10. //-------------------------------------------------------------------------
  11. // INDICATOR MESHES
  12. //-------------------------------------------------------------------------
  13. MODEL
  14. {
  15. model = IndicatorLights/Meshes/z100lamp
  16. scale = 0.4, 0.4, 0.4
  17. position = 0.0297, 0.0518, -0.0779
  18. rotation = 0, 0, 0
  19. }
  20.  
  21. //-------------------------------------------------------------------------
  22. // CONTROLLABLE EMISSIVES
  23. //-------------------------------------------------------------------------
  24.  
  25. MODULE {
  26. name = ModuleControllableEmissive
  27. target = IndicatorLights/Meshes/z100lamp
  28. emissiveName = indicator
  29. }
  30.  
  31. //-------------------------------------------------------------------------
  32. // CONTROLLERS
  33. //-------------------------------------------------------------------------
  34.  
  35. MODULE {
  36. name = ModuleDataTransmitterIndicator
  37. emissiveName = indicator
  38. // Get really fancy with busy color. This module type exposes one static
  39. // field, dataRate. We'll use a random flicker for the animation (like
  40. // an old-time modem), and we'll plug the data rate both into the flicker
  41. // period (so higher-speed antennas flicker faster), and into the bias
  42. // (so higher-speed antennas spend a greater percentage of their time
  43. // in the "on" state rather than "off").
  44. //
  45. // We don't actually have to use the static syntax here (we could just
  46. // take the data rate for this antenna, do the math, and plug in the
  47. // literal numbers here). However, using the actual static expression
  48. // comes with a few benefits. First, it's more maintainable: we
  49. // can just use the same static expression for all the antennas, rather
  50. // than having to come up with a different expression with different math
  51. // for each one. Second, it's more explicit to anyone reading this just
  52. // *why* the number is what it is. Third, it's more robust: if Squad ever
  53. // tinkers with the data rates, or someone uses ModuleManager to tweak
  54. // them, this will automatically follow suit. Fourth, it's friendlier
  55. // to modders: if you have your own antenna and you want to set it up
  56. // for IndicatorLights compatibility, you can just copy the following
  57. // line verbatim and you'll get behavior that's consistent with what
  58. // IndicatorLights does with the stock antennas.
  59. busyColor = random($ToggleLED, $Off, divide(400, static(dataRate)), between(subtract(multiply(sqrt(static(dataRate)), 1.1), 2.3), -0.4, 0.5))
  60. }
  61. }
  62.  
  63.  
  64. // Add a single crew indicator to the KPM-1 Small Inline Passenger Compartment
  65. @PART[InlinePassengerCan]:NEEDS[Kerbonov]
  66. {
  67. //-------------------------------------------------------------------------
  68. // INDICATOR MESHES
  69. //-------------------------------------------------------------------------
  70. MODEL
  71. {
  72. model = IndicatorLights/Meshes/squareLamp
  73. scale = 0.230, 1.0, 0.5
  74. position = -0.5544, 0, 0.27555
  75. rotation = 0, -67.5, 0
  76. }
  77.  
  78. //-------------------------------------------------------------------------
  79. // CONTROLLABLE EMISSIVES
  80. //-------------------------------------------------------------------------
  81.  
  82. MODULE {
  83. name = ModuleControllableEmissive
  84. target = IndicatorLights/Meshes/squareLamp:0
  85. emissiveName = indicator0
  86. }
  87.  
  88. //-------------------------------------------------------------------------
  89. // CONTROLLERS
  90. //-------------------------------------------------------------------------
  91.  
  92. MODULE {
  93. name = ModuleCrewIndicatorToggle
  94. toggleName = indicatorToggle
  95. }
  96.  
  97. MODULE {
  98. name = ModuleCrewIndicator
  99. controllerName = crewController0
  100. toggleName = indicatorToggle
  101. }
  102.  
  103. MODULE
  104. {
  105. name = ModuleScienceAvailabilityIndicator
  106. controllerName = availability0
  107. experimentID = crewReport
  108. lowValueColor = crewController0
  109. mediumValueColor = highValueColor
  110. highValueColor = blink(lowValueColor, 200, $Off, 200)
  111. }
  112.  
  113. MODULE {
  114. name = ModuleScienceDataIndicator
  115. experimentID = crewReport
  116. emissiveName = indicator0
  117. dataColor = crewController0
  118. emptyColor = availability0
  119. }
  120.  
  121.  
  122. //-------------------------------------------------------------------------
  123. // TWEAKS
  124. //-------------------------------------------------------------------------
  125.  
  126. // This pod uses a ModuleColorChanger to handle its ablator, set up
  127. // so that by default it takes control of *all* emissives on the part.
  128. // Need to tell it not to tinker with the meshes that we're adding here;
  129. // otherwise, the crew indicator will end up getting colored with the
  130. // ablator instead of actually working as a crew indicator.
  131. @MODULE[ModuleColorChanger] {
  132. excludedRenderer = IndicatorLights/Meshes/squareLamp(Clone)
  133. }
  134. }
  135.  
  136.  
  137. // Add crew indicators (3) to the Kn-7 Cabin
  138. @PART[KN7Cabin]:NEEDS[Kerbonov]
  139. {
  140. //-------------------------------------------------------------------------
  141. // INDICATOR MESHES
  142. //-------------------------------------------------------------------------
  143. MODEL
  144. {
  145. model = IndicatorLights/Meshes/nubbinLamp
  146. scale = 0.7, 0.7, 0.5
  147. position = -0.6057, -1.1668, 0.4582
  148. rotation = 0, -60, 0
  149. }
  150. MODEL
  151. {
  152. model = IndicatorLights/Meshes/nubbinLamp
  153. scale = 0.7, 0.7, 0.5
  154. position = -0.6057, -1.2668, 0.4582
  155. rotation = 0, -60, 0
  156. }
  157. MODEL
  158. {
  159. model = IndicatorLights/Meshes/nubbinLamp
  160. scale = 0.7, 0.7, 0.5
  161. position = -0.6057, -1.3668, 0.4582
  162. rotation = 0, -60, 0
  163. }
  164.  
  165.  
  166. //-------------------------------------------------------------------------
  167. // CONTROLLABLE EMISSIVES
  168. //-------------------------------------------------------------------------
  169.  
  170. MODULE {
  171. name = ModuleControllableEmissive
  172. target = IndicatorLights/Meshes/nubbinLamp:0
  173. emissiveName = indicator0
  174. }
  175.  
  176. MODULE {
  177. name = ModuleControllableEmissive
  178. target = IndicatorLights/Meshes/nubbinLamp:1
  179. emissiveName = indicator1
  180. }
  181.  
  182. MODULE {
  183. name = ModuleControllableEmissive
  184. target = IndicatorLights/Meshes/nubbinLamp:2
  185. emissiveName = indicator2
  186. }
  187.  
  188. //-------------------------------------------------------------------------
  189. // CONTROLLERS
  190. //-------------------------------------------------------------------------
  191.  
  192. MODULE {
  193. name = ModuleCrewIndicatorToggle
  194. toggleName = indicatorToggle
  195. }
  196.  
  197. MODULE {
  198. name = ModuleCrewIndicator
  199. controllerName = crewController0
  200. toggleName = indicatorToggle
  201. }
  202.  
  203. MODULE {
  204. name = ModuleCrewIndicator
  205. controllerName = crewController1
  206. toggleName = indicatorToggle
  207. }
  208.  
  209. MODULE {
  210. name = ModuleCrewIndicator
  211. controllerName = crewController2
  212. toggleName = indicatorToggle
  213. }
  214.  
  215. MODULE
  216. {
  217. name = ModuleScienceAvailabilityIndicator
  218. controllerName = availability0
  219. experimentID = crewReport
  220. lowValueColor = crewController0
  221. mediumValueColor = highValueColor
  222. highValueColor = blink(lowValueColor, 200, $Off, 200)
  223. }
  224.  
  225. MODULE
  226. {
  227. name = ModuleScienceAvailabilityIndicator
  228. controllerName = availability1
  229. experimentID = crewReport
  230. lowValueColor = crewController1
  231. mediumValueColor = highValueColor
  232. highValueColor = blink(lowValueColor, 200, $Off, 200)
  233. }
  234.  
  235. MODULE
  236. {
  237. name = ModuleScienceAvailabilityIndicator
  238. controllerName = availability2
  239. experimentID = crewReport
  240. lowValueColor = crewController2
  241. mediumValueColor = highValueColor
  242. highValueColor = blink(lowValueColor, 200, $Off, 200)
  243. }
  244.  
  245. MODULE {
  246. name = ModuleScienceDataIndicator
  247. experimentID = crewReport
  248. emissiveName = indicator0
  249. dataColor = crewController0
  250. emptyColor = availability0
  251. }
  252.  
  253. MODULE {
  254. name = ModuleScienceDataIndicator
  255. experimentID = crewReport
  256. emissiveName = indicator1
  257. dataColor = crewController1
  258. emptyColor = availability1
  259. }
  260.  
  261. MODULE {
  262. name = ModuleScienceDataIndicator
  263. experimentID = crewReport
  264. emissiveName = indicator2
  265. dataColor = crewController2
  266. emptyColor = availability2
  267. }
  268.  
  269.  
  270.  
  271. //-------------------------------------------------------------------------
  272. // TWEAKS
  273. //-------------------------------------------------------------------------
  274.  
  275. // This pod uses a ModuleColorChanger to handle its ablator, set up
  276. // so that by default it takes control of *all* emissives on the part.
  277. // Need to tell it not to tinker with the meshes that we're adding here;
  278. // otherwise, the crew indicator will end up getting colored with the
  279. // ablator instead of actually working as a crew indicator.
  280. @MODULE[ModuleColorChanger] {
  281. excludedRenderer = IndicatorLights/Meshes/nubbinLamp(Clone)
  282. }
  283. }
  284.  
  285.  
  286. // Add crew indicators (3) to the Kn-2 Cabin
  287. @PART[KN2Cabin]:NEEDS[Kerbonov]
  288. {
  289. //-------------------------------------------------------------------------
  290. // INDICATOR MESHES
  291. //-------------------------------------------------------------------------
  292. MODEL
  293. {
  294. model = IndicatorLights/Meshes/nubbinLamp
  295. scale = 0.7, 0.7, 0.5
  296. position = -0.5594, -0.3261, -0.2687
  297. rotation = 0, -110, 0
  298. }
  299. MODEL
  300. {
  301. model = IndicatorLights/Meshes/nubbinLamp
  302. scale = 0.7, 0.7, 0.5
  303. position = -0.5594, -0.4261, -0.2687
  304. rotation = 0, -110, 0
  305. }
  306. MODEL
  307. {
  308. model = IndicatorLights/Meshes/nubbinLamp
  309. scale = 0.7, 0.7, 0.5
  310. position = -0.5594, -0.5261, -0.2687
  311. rotation = 0, -110, 0
  312. }
  313.  
  314.  
  315.  
  316. //-------------------------------------------------------------------------
  317. // CONTROLLABLE EMISSIVES
  318. //-------------------------------------------------------------------------
  319.  
  320. MODULE {
  321. name = ModuleControllableEmissive
  322. target = IndicatorLights/Meshes/nubbinLamp:0
  323. emissiveName = indicator0
  324. }
  325.  
  326. MODULE {
  327. name = ModuleControllableEmissive
  328. target = IndicatorLights/Meshes/nubbinLamp:1
  329. emissiveName = indicator1
  330. }
  331.  
  332. MODULE {
  333. name = ModuleControllableEmissive
  334. target = IndicatorLights/Meshes/nubbinLamp:2
  335. emissiveName = indicator2
  336. }
  337.  
  338. //-------------------------------------------------------------------------
  339. // CONTROLLERS
  340. //-------------------------------------------------------------------------
  341.  
  342. MODULE {
  343. name = ModuleCrewIndicatorToggle
  344. toggleName = indicatorToggle
  345. }
  346.  
  347. MODULE {
  348. name = ModuleCrewIndicator
  349. controllerName = crewController0
  350. toggleName = indicatorToggle
  351. }
  352.  
  353. MODULE {
  354. name = ModuleCrewIndicator
  355. controllerName = crewController1
  356. toggleName = indicatorToggle
  357. }
  358.  
  359. MODULE {
  360. name = ModuleCrewIndicator
  361. controllerName = crewController2
  362. toggleName = indicatorToggle
  363. }
  364.  
  365. MODULE
  366. {
  367. name = ModuleScienceAvailabilityIndicator
  368. controllerName = availability0
  369. experimentID = crewReport
  370. lowValueColor = crewController0
  371. mediumValueColor = highValueColor
  372. highValueColor = blink(lowValueColor, 200, $Off, 200)
  373. }
  374.  
  375. MODULE
  376. {
  377. name = ModuleScienceAvailabilityIndicator
  378. controllerName = availability1
  379. experimentID = crewReport
  380. lowValueColor = crewController1
  381. mediumValueColor = highValueColor
  382. highValueColor = blink(lowValueColor, 200, $Off, 200)
  383. }
  384.  
  385. MODULE
  386. {
  387. name = ModuleScienceAvailabilityIndicator
  388. controllerName = availability2
  389. experimentID = crewReport
  390. lowValueColor = crewController2
  391. mediumValueColor = highValueColor
  392. highValueColor = blink(lowValueColor, 200, $Off, 200)
  393. }
  394.  
  395. MODULE {
  396. name = ModuleScienceDataIndicator
  397. experimentID = crewReport
  398. emissiveName = indicator0
  399. dataColor = crewController0
  400. emptyColor = availability0
  401. }
  402.  
  403. MODULE {
  404. name = ModuleScienceDataIndicator
  405. experimentID = crewReport
  406. emissiveName = indicator1
  407. dataColor = crewController1
  408. emptyColor = availability1
  409. }
  410.  
  411. MODULE {
  412. name = ModuleScienceDataIndicator
  413. experimentID = crewReport
  414. emissiveName = indicator2
  415. dataColor = crewController2
  416. emptyColor = availability2
  417. }
  418.  
  419.  
  420. //-------------------------------------------------------------------------
  421. // TWEAKS
  422. //-------------------------------------------------------------------------
  423.  
  424. // This pod uses a ModuleColorChanger to handle its ablator, set up
  425. // so that by default it takes control of *all* emissives on the part.
  426. // Need to tell it not to tinker with the meshes that we're adding here;
  427. // otherwise, the crew indicator will end up getting colored with the
  428. // ablator instead of actually working as a crew indicator.
  429. @MODULE[ModuleColorChanger] {
  430. excludedRenderer = IndicatorLights/Meshes/nubbinLamp(Clone)
  431. }
  432.  
  433. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement