I’ve posted on here about 3 times today so I do apologize but I guess today was my “bug” day with issues I encountered. I’m not great with flow lab so bear with me if this is a simple fix.
Working on a light effect and used the simple lighting effect by grazer to have a starting position on the code rather than starting from scratch. My level is designed so that when you enter a certain area, the lighting effect “turns on” and your vision is reduced. So, there’s indicators at each exit/entrance to toggle this effect on and off.
Those “torches” in the top left are the indicator block (in the final they will be invis). Sorry the pic is dark I have a fade from black mechanic, the lighting effect, and black blocks to block off vision to certain areas so everything is basically covered!
//explaining my thought process behind the code
And here is the dreadful code in question. On collision with the player (puzzle cat2) it goes through the on switch which then turns off for a brief time so the collision doesn’t enable multiple times when going through. Then gets the value stored in the var state. That value is then sent through another switch (explain in a sec) that goes through two filters (i know they are redundant and I could have just used one but id rather look at it in this format) If that state var is 0 (meaning off) it then sends a msg to the light effect to turn on, waits a small amount of time then gets the number 1 and sets the state var to 1, indicating on. And this process would be repeated if state was originally in 1.
The problem is that it does work like 90% of the time, but with that 10% I can’t explain why it’s not working as the code isn’t suddenly changing on me and it’s random when it does happen.
The timers are all there as I initially thought the problem was due to timing so I spaced out the changes but still nothing. I also know there’s a toggle behavior but all my research and testing has only made me more confused on what it actually does so if there’s an easier solution with the toggle I’m all ears.
Heres a link to a vid of the issue:https://kapwi.ng/c/m1JEKbu2
Or if you want to try yourself:https://flowlab.io/game/play/1653402
Instructions if doing yourself: Go to Prison level 8 (NOT the intro) in edit, start, go right, suffer through dialogue, go left and hit top left cracked blocks twice and just interact with those torches. If you just walk right you’ll find the torches I’m having a problem with even though they are the same object. Just be careful when going down if the white cat “sees” you level restarts.
Let me know if anyone sees any issues. Its currently 1 am and I’m a bit deprived of sleep so the second this is posted assume I am already sleeping and will respond in the morning