[A12d] Community Core Library (v0.12.3b)

Started by 1000101, June 29, 2015, 04:18:48 PM

Previous topic - Next topic

1000101



This is the old forum thread, please redirect yourself to the new thread here.
(2*b)||!(2*b) - That is the question.
There are 10 kinds of people in this world - those that understand binary and those that don't.

Powered By

skullywag

you got the coloured light thing working....gimee nomnomnom...
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

1000101

:)

Just add CCLs ThingComp to your lights.  It will mean your mod now depends on CCL, but that is the point of CCL.  :)
(2*b)||!(2*b) - That is the question.
There are 10 kinds of people in this world - those that understand binary and those that don't.

Powered By

Loki88

This changes EVERYTHING! Now to get my brain to figure out how to use it... *notices smoke coming from ears*

skyarkhangel

#4
Low Idle Power (ThingComp) - Allows tables which shouldn't use power when not in use to draw less.

wow.. big thanks especially for it!


1000101, can you make with this.. Placement restrictions (PlaceWorkers) "Only on smoothed floor?

1000101

Quote from: skyarkhangelLow Idle Power (ThingComp) - Allows tables which shouldn't use power when not in use to draw less.

wow.. big thanks especially for it!
Yeah, it bothered me when my colonists would go to bed and leave the stove on.  :\

Quote from: skyarkhangel1000101, can you make with this.. Placement restrictions (PlaceWorkers) "Only on smoothed floor?
It's possible, I'll look into it.  Thanks for the suggestion, always looking to improve on this and add functionality which will help everyone.
(2*b)||!(2*b) - That is the question.
There are 10 kinds of people in this world - those that understand binary and those that don't.

Powered By

skyarkhangel

#6
Quote from: 1000101 on June 29, 2015, 07:01:38 PM
Quote from: skyarkhangelLow Idle Power (ThingComp) - Allows tables which shouldn't use power when not in use to draw less.

wow.. big thanks especially for it!
Yeah, it bothered me when my colonists would go to bed and leave the stove on.  :\

Quote from: skyarkhangel1000101, can you make with this.. Placement restrictions (PlaceWorkers) "Only on smoothed floor?
It's possible, I'll look into it.  Thanks for the suggestion, always looking to improve on this and add functionality which will help everyone.

And that class could works with terraindefs too..? Eg.. Needs to smooth floor before build woodenfloor or other floors.

1000101

#7
While I can probably get a place worker restriction for smooth floors, I'm not sure I would put it in CCL that flooring requires floors to be smoothed first.  That part sounds like it would be good for a separate mod though.  I don't want to "inflict" too much on the user with the core of CCL, that's where other mods come in which make use of CCLs available resources.

In the full source download for CCL is an example of a refrigerated meal shelf.  I didn't put this into the main user download as I'm not aiming on adding directly to RimWorld content with CCL but provide tools for modders not to have to re-invent the wheel all the time.  What is modded in CCL from the vanilla is only the core assets which would make sense to use the new functionality (such as production tables and auto-doors using CompPowerLowIdleDraw and the lamps being resolved into a single entity using CompColoredLight).
(2*b)||!(2*b) - That is the question.
There are 10 kinds of people in this world - those that understand binary and those that don't.

Powered By

Loki88

Is the <CompColoredLight> limited to the standard red green and blue of vanilla or is it possible to define your own custom colours within the mod using this tag? Ie, if I were to make a version of my LED rope lights mod to use this can I implement it to use the gold and violet colours I currently have?

1000101

#9
CompColoredLight has it's own set of colors defined but you can define your own.  If you don't define your own it uses the predefined colors.  CompProperties_ColoredLight.cs is the colored light properties.

Default colors:
white, ( 217, 217, 217,   0 )
red, ( 217,   0,   0,   0 )
green, (   0, 217,   0,   0 )
blue, (   0,   0, 217,   0 )
yellow, ( 217, 217,  43,   0 )
orange, ( 255, 132,   0,   0 )
purple, ( 185,  61, 205,   0 )


How to define a light with only two custom colors:
<li Class="CommunityCoreLibrary.CompProperties_ColoredLight">
<compClass>CommunityCoreLibrary.CompColoredLight</compClass>
<color>
<li>
<name>white</name>
<value>( 255, 255, 255, 0 )</value>
</li>
<li>
<name>pukey pink</name>
<value>( 255, 0, 255, 0 )</value>
</li>
</color>
</li>


You can use <Default> (default 0) in the comp to specify the default color index.  You can also specify the research required to change color using <requiredResearch> (default "ColoredLights").

Don't forget you still need a CompGlower to define the radius and a CompPowerTrader.  If people demand it, the requirement for CompPowerTrader can become optional.
(2*b)||!(2*b) - That is the question.
There are 10 kinds of people in this world - those that understand binary and those that don't.

Powered By

Loki88

Quote from: 1000101 on June 29, 2015, 09:22:02 PM
CompColoredLight has it's own set of colors defined but you can define your own.  If you don't define your own it uses the predefined colors.  CompProperties_ColoredLight.cs is the colored light properties.

Default colors:
white, ( 217, 217, 217,   0 )
red, ( 217,   0,   0,   0 )
green, (   0, 217,   0,   0 )
blue, (   0,   0, 217,   0 )
yellow, ( 217, 217,  43,   0 )
orange, ( 255, 132,   0,   0 )
purple, ( 185,  61, 205,   0 )


How to define a light with only two custom colors:
<li Class="CommunityCoreLibrary.CompProperties_ColoredLight">
<compClass>CommunityCoreLibrary.CompColoredLight</compClass>
<color>
<li>
<name>white</name>
<value>( 255, 255, 255, 0 )</value>
</li>
<li>
<name>pukey pink</name>
<value>( 255, 0, 255, 0 )</value>
</li>
</color>
</li>


You can use <Default> (default 0) in the comp to specify the default color index.  You can also specify the research required to change color using <requiredResearch> (default "ColoredLights").

Don't forget you still need a CompGlower to define the radius and a CompPowerTrader.  If people demand it, the requirement for CompPowerTrader can become optional.

Thank you very much for your explanation! All I could think of with removing power trader is technicolor camp fires and tiki torches  :P

mrofa

That is awsome thanks alot 1000101!
And that wall attachment damn i was just thinkering on it :D
All i do is clutter all around.

sky

That should be included in Core. Would help a lot. ;)

mipen

How on earth did I gloss over this...? This is amazing! :P I'm definitely going to add this as a reference for MD2. Does the CompPowerTrader in this override the core one, or do you need to explicitly use it in the defs? And if so, is this done by CCL?

Also, another idea for a place worker would be to have one the limits the number of buildings of a type that can be built. If its possible, you could have that number defined in a def.

Anyways, some great work here :D

1000101

@mipen:

The core of CCL overrides the vanilla tables, you can take a look at those defs for a basic reference.

The low idle draw comp relies on there being a power trader and if the building also has a glower it will turn it off when going into low power mode.
(2*b)||!(2*b) - That is the question.
There are 10 kinds of people in this world - those that understand binary and those that don't.

Powered By