Ludeon Forums

Ludeon Forums

  • July 04, 2022, 05:35:48 PM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: [B18] [KV] Adjustable Colored Lights [ModSync]  (Read 5672 times)

Kiame

  • Planetologist
  • ****
  • Posts: 1541
  • Refugee
    • View Profile
[B18] [KV] Adjustable Colored Lights [ModSync]
« on: November 11, 2017, 02:19:52 AM »

Change the color of any light once "Colored Lights" is researched.

Legend:
R - Red
G - Green
B - Blue
H - Hue
S - Saturation
L - Luminosity

For modders:
To have this work with your mod, include "CompProperties_Glower" in <comps> and have the defName contain either "Lamp" or "Light" in the string (case-sensitive)


Steam:
A17
A18

Direct Download:
A17
A18


Github



Like my mods? Consider supporting me!








« Last Edit: December 03, 2017, 07:21:12 PM by Kiame »
Logged

Kiame

  • Planetologist
  • ****
  • Posts: 1541
  • Refugee
    • View Profile
Re: [A18] Adjustable Colored Lights
« Reply #1 on: November 11, 2017, 01:56:16 PM »

Update:
All lights can have their color adjusted after Colored Lights is researched

Steam and direct downloads have been updated
Logged

Crow_T

  • Colonist
  • ***
  • Posts: 270
  • Refugee
    • View Profile
Re: [A18] Adjustable Colored Lights
« Reply #2 on: November 11, 2017, 02:47:33 PM »

Damn you are fast, people were just talking about this :D Awesome!
Logged
(regarding dead man's apparel)
"I think, at the very least, the buff should go away for jackets so long as you're wearing the former owner's skin as a shirt."
-Condaddy20

Nightinggale

  • Colonist
  • ***
  • Posts: 378
  • Refugee
    • View Profile
Re: [A18] Adjustable Colored Lights
« Reply #3 on: November 11, 2017, 03:32:09 PM »

For modders:
To have this work with your mod, include "CompProperties_Glower" in <comps> and have the defName contain either "Lamp" or "Light" in the string (case-sensitive)
For those, who haven't noticed yet, it's possible to add this to your mod only if the user has loaded this mod. Add this if you use ModCheck:
Code: [Select]
<Operation Class="PatchOperationSequence">
<success>Always</success>
<operations>
<li Class="ModCheck.isModLoaded">
<modName>Adjustable Colored Lights - A17</modName>
<yourMod>name of your mod</yourMod>
</li>
<li Class="PatchOperationAdd">
<xpath>*/ThingDef[defName = "whatever"]/comps</xpath>
<value>
<CompProperties_Glower>
        <glowRadius>12</glowRadius>
  <glowColor>(217,217,208,0)</glowColor>
</CompProperties_Glower>
</value>
</li>
</operations>
</Operation>
I haven't tested this specific use (I just wrote it on the forum), but I think that's the code to make your thing glow, but only if Adjustable Colored Lights is loaded. I'm not saying it would always make sense to do this, but I say that you do have the option to do this. It's up to you to figure out if it makes sense for your specific mod.

Guthub
New server name  ::)
« Last Edit: November 11, 2017, 03:34:52 PM by Nightinggale »
Logged
ModCheck - boost your patch loading times and include patchmods in your main mod.

Kiame

  • Planetologist
  • ****
  • Posts: 1541
  • Refugee
    • View Profile
Re: [A18] Adjustable Colored Lights
« Reply #4 on: November 11, 2017, 06:57:35 PM »

For modders:
To have this work with your mod, include "CompProperties_Glower" in <comps> and have the defName contain either "Lamp" or "Light" in the string (case-sensitive)
For those, who haven't noticed yet, it's possible to add this to your mod only if the user has loaded this mod. Add this if you use ModCheck:
Code: [Select]
(code example)I haven't tested this specific use (I just wrote it on the forum), but I think that's the code to make your thing glow, but only if Adjustable Colored Lights is loaded. I'm not saying it would always make sense to do this, but I say that you do have the option to do this. It's up to you to figure out if it makes sense for your specific mod.

Guthub
New server name  ::)

Thanks for the Guthub corrected!

As for the listed operation it's not quite what I was aiming for because unless the base object's def's defName has either "Lamp" or "Light" it will not work. Also if the object in question is either a Lamp or Light it will already include CompProperties_Glower in it.

Here's an example from a LED-Light mod:
Code: [Select]
<Defs>
<ThingDef ParentName="LEDLampBase" >
<defName>LEDLamp</defName>
<label>LED Lamp</label>
<description>Standing lamp that lights an area, uses a LED Bulb.</description>
<designationHotKey>Misc11</designationHotKey>
<comps>
<li Class="CompProperties_Glower">
<glowRadius>12</glowRadius>
<glowColor>(217,217,208,0)</glowColor>
</li>
</comps>
<researchPrerequisites><li>LEDBulbs</li></researchPrerequisites>
</ThingDef>
<Defs>

This will work with this mod since the defName "LEDLamp" has "Lamp" in it and it includes the comp CompProperties_Glower
Logged

Kiame

  • Planetologist
  • ****
  • Posts: 1541
  • Refugee
    • View Profile
Re: [A18] Adjustable Colored Lights
« Reply #5 on: November 18, 2017, 11:50:22 PM »

It looks like in one of the last revisions of B18 there was a change in wihch all the lights of a certain type will share one glow color. This is for space reasons i'm sure but it breaks this mod to an extent.
When adjusting one type of light's color, ALL lights of that same type will change color too. I'm going to look into a way to revert the change to allow individual lights, no matter the type, have a custom color.

Update B18
Updated to fix a bug where modded lights' colors would not be persisted when loading a saved game
« Last Edit: November 18, 2017, 11:52:09 PM by Kiame »
Logged

Kiame

  • Planetologist
  • ****
  • Posts: 1541
  • Refugee
    • View Profile
Re: [B18] Adjustable Colored Lights
« Reply #6 on: December 03, 2017, 07:20:56 PM »

Adding ModSync.ninja support
Logged