1. Welcome to the Starbound support forums. Please check the support FAQs before posting: http://playstarbound.com/support

Resolved Light sensor not working?

Discussion in 'Starbound Support' started by Fruiteyes, Aug 27, 2016.

Thread Status:
Not open for further replies.
  1. Fruiteyes

    Fruiteyes Phantasmal Quasar

    So, I'm trying to use the light sensor to activate a set of lights inside a covered bridge with windows once it gets dark, but it seems that no matter where I place the light sensor, it always sends a signal from the dim light connection; even when I place it on a background tile and remove all background tiles around it while in broad daylight. Is this a bug, and how do I fix it?


    EDIT: After unpacking the assets, I have discovered the problem. It is a coding error on Chucklefish's end. First of all, in the lightsensor.object file, a variable called "detectThresholdLow" is set to 1, which is the lowest possible light level possible. After playing around a bit, I set it to 25 instead, in an experimental mod I just threw together, and that seems to be about the right amount to work. Second of all, in the lightsensor.lua file, this line "if sample >= self.detectThresholdLow then" is causing the low light sensor to ALWAYS send a signal, because it's checking if the light is HIGHER than that value, instead of LOWER. With the impossibly low threshold level of 1, as mentioned in point number one, these two elements together caused the low light sensor to always give a false positive. If you change ">=" to "<=", and set the "detectThresholdLow" variable to a higher value, probably between 20 and 30, that seems to fix the problem. Hopefully Chucklefish will see this post and fix this in a future update.
     
    Last edited: Aug 27, 2016
    Manny_Calavera likes this.
  2. Manny_Calavera

    Manny_Calavera Void-Bound Voyager

    Hello Fruit,

    Yes I have too noticed that the Lightsensor was not working properly, that both bottom and top nodes were giving out a signal. I researched
    and found this post! I have followed the example fix you provided and it worked out for me too. Thanks!

    Lightsensor Fix:

    lightSensorFix.png

    Also look at that, your post was edited/made in August and update 1.1.1 didn't picked up on your fix. Bummer...


    You're the best,
    Manny.
     
    Fruiteyes likes this.
  3. Fruiteyes

    Fruiteyes Phantasmal Quasar

    Glad I could help! Yeah, I was kinda disappointed that the devs didn't pick up on this issue and fix it. Hopefully the fact that your reply bumped my thread back up will cause them to notice this and fix it?
     
  4. Fruiteyes

    Fruiteyes Phantasmal Quasar

    I'm sorry for bumping this, but if the mods or devs have seen this bug report, is there any way you could confirm that this issue has been noticed? I know you guys are really busy with much bigger issues, but seeing that it's a simple coding issue and I've provided the solution right here in this thread, it would be nice to know that it'll be fixed soon. It was not repaired in 1.1.1, and so far it doesn't seem like it has been in 1.2 unstable, which is unfortunate, since it is such a simple fix.

    Again, I know that the devs and mods are very busy people, but any reply to confirm that this bug and simple fix has been forwarded to the dev team would really be appreciated :)
     
  5. Iris Blanche

    Iris Blanche Pudding Paradox Forum Moderator

    I'll ask tomorrow if the issue is already known.

    ~ Iris ~
     
    Fruiteyes likes this.
  6. Fruiteyes

    Fruiteyes Phantasmal Quasar

    Thank you so much! I really appreciate it :)
     
  7. metadept

    metadept Mostly Harmless Codesman

    From what I can tell, you're misunderstanding how the sensor works. The low threshold is active when any light is on the sensor, and the high threshold is active when a lot of light is on the sensor. In total darkness neither is active. If you want to detect darkness use a NOT gate with the low threshold output.
     
    Katzeus likes this.
  8. Fruiteyes

    Fruiteyes Phantasmal Quasar

    Ah okay. I was under the impression that the low threshold was to detect LOW light levels, not the absence of pure darkness. My mistake.
     
Thread Status:
Not open for further replies.

Share This Page