Closed devJimmyboy closed 3 years ago
setLampColor
should return instantly and without any delay, and your code is correct for what you likely want it to do. The issue here is that CC executes code on a special thread, but the colour updates have to actually be processed on the main server thread of the game. There is a method for me to do that. This means that Computronics tells CC to update the lamp colour on the main thread, and it should tell that to all lamps nearly simultaneously, but I have no control over how many of those instructions CC will process each server tick. A solution would be having my own custom code to do this instead of having it be done by CC, so I get to update all lamps at the same time. However, it updating this slowly is curious, and I am not sure why it would be so slow that you can follow the update process with the naked eye. Does the server happen to have an extremely bad tick rate?
As another solution, on Minecraft 1.12, using bundled redstone cables from charset/SimpleLogic should allow setting the colours of multiple lamps at once, if you have those.
Yeah sadly the tps is a steady 20. Thanks for the quick response! It is very odd then if it should be returning instantly, since the visual updates are in sync with the CC program itself (terminating the program stops the lamp states, no delay). For the bundled cables, I have ProjectRed Transmission's bundled cables but not Simplelogics ;(
Turns out it is possible for me to do this, but I am not sure whether or not I will. I would have to figure out some limit for how many lamps can be activated at a time.
I'm going to start this off with a video: (My Lua file is at the beginning)
https://user-images.githubusercontent.com/15599091/103149168-ae19ed80-472c-11eb-84db-d4abbcdafee4.mp4
I'm trying to use the lamps as a sort of revolving color wheel, but the calls to each lamp are being delayed between method calls.
What I've Tried As a Workaround:
I've tried to see if there's some work-around by looking into whether modems can broadcast to peripherals, but it seems that's not a thing. I've also attempted to use bundled cables to control the massive lamp structure, yet they aren't connecting (visually and functionally) to the lamps.
My Question:
I'm solely curious if the delay in render updates (even though it's a for loop with one call to change color) is an issue in my code or if it's a purposeful fix for a server killing mechanism.
TLDR:To sum up my intention is for the lamps to be controlled realtime (or as close as they can) similar to any other programmatic array function.
Notes:
This is in my FTB revelation server, so no access to RedNet or OpenComputer solutions.
**I'm aware of the ordering issue through the lamps! I'm new to CC and quickly realized that I should probably link modems in order of my planned "animation" (per se)**
Lastly, if you think I worded this like an idiot, I probably did. I am not the best at describing my thoughts, so I at least formatted them and included a video to assist. Thank you for the help!