transhumandesign / kag-base

King Arthur's Gold base folder.
257 stars 119 forks source link

[changed] Lamp light is based on input power #2016

Open mugg91 opened 5 months ago

mugg91 commented 5 months ago

Status

Description

[changed] Lamp light is based on input power

This PR changes Lamp to make it emit light based on its input power. Less power means it emits less light. Lamp isn't a "load component" anymore, but it doesn't make sense for it to be in the "passive components" directory so I kept it in the "load components" directory.

A power factor (float(power_new + 1) / power_source) is calculated which is set to not exceed 1. Light radius will be directly affected by this power factor whereas SColor luminance, Red, Blue and Green are affected by it as well but with the factor having at least a minimum of 0.3f to make light not drop too low.

screen-24-04-16-00-30-55

NoahTheLegend commented 5 months ago

You're adding more mechanisms and thats cool, but we should add arithmetic gates with a complex custom logic.

In short you may need one parent device for storing a value once it is different from its contents (previously saved value). That is implementation for average memory cell, then using that as a layout add divide/multiply and sum/subtraction gates which interact with nearby memory cells instead of taking signal power as input, (so you do not have go out max signal range) processing value from side A into input on side B. Making those more versatile to work with environment is preferable. Activating coin slot or sensor would add 1 / subtract 1 or multiply by 2 / divide by 2 etc corresponding to functionality of certain device

this is quite raw idea and i was thinking of doing it by myself, although i will appreciate your feedback and more thoughts relative to this

Vam-Jam commented 4 weeks ago

I suspect SetLightRadius is causing it to not work