Functions and other scripts run only momentarily when invoked from another script
Posted: Sun Apr 07, 2024 8:14 am
New user here, and loving QLC so far. I'm currently writing scripts for an 8-zone light bar. I could use chaser or sequence but I just wanted to try out script writing because it has the potential to be powerful.
To illustrate my issue, I'll use the example of simple chaser where each segment of the light bar lights up red for 1 sec. I think it makes sense to do something like this with multiple simple scripts:
[script_1] - This script turns on the dimmer, zeroes each segment except zone 1, and sets zone 1 red to 255.
[run_all] - This script calls script_1 and then waits for 100ms, then calls subsequent similar scripts to light up the other zones one by one.
What I end up observing is each segment flashing red quickly, with 1s in between. If I include the wait time inside the script for each zone, I get the behavior I want. But when I call each script and wait 1s in between as described above, I only see a quick flash. Shouldn't the values written to the channels remain the same until overwritten, rather than getting zeroed out immediately upon script exit? This would make scripting so much more intuitive and useful.
Thanks for your help!
To illustrate my issue, I'll use the example of simple chaser where each segment of the light bar lights up red for 1 sec. I think it makes sense to do something like this with multiple simple scripts:
[script_1] - This script turns on the dimmer, zeroes each segment except zone 1, and sets zone 1 red to 255.
Code: Select all
setfixture:2 ch:25 val:40 // 3-Color LED Light Bar #1, Dimmer
setfixture:2 ch:0 val:255 // 3-Color LED Light Bar #1, Zone 1 Red
setfixture:2 ch:1 val:0 // 3-Color LED Light Bar #1, Zone 1 Green
setfixture:2 ch:2 val:0 // 3-Color LED Light Bar #1, Zone 1 Blue
setfixture:2 ch:3 val:0 // 3-Color LED Light Bar #1, Zone 2 Red
setfixture:2 ch:4 val:0 // 3-Color LED Light Bar #1, Zone 2 Green
setfixture:2 ch:5 val:0 // 3-Color LED Light Bar #1, Zone 2 Blue
setfixture:2 ch:6 val:0 // 3-Color LED Light Bar #1, Zone 3 Red
setfixture:2 ch:7 val:0 // 3-Color LED Light Bar #1, Zone 3 Green
setfixture:2 ch:8 val:0 // 3-Color LED Light Bar #1, Zone 3 Blue
setfixture:2 ch:9 val:0 // 3-Color LED Light Bar #1, Zone 4 Red
setfixture:2 ch:10 val:0 // 3-Color LED Light Bar #1, Zone 4 Green
setfixture:2 ch:11 val:0 // 3-Color LED Light Bar #1, Zone 4 Blue
setfixture:2 ch:12 val:0 // 3-Color LED Light Bar #1, Zone 5 Red
setfixture:2 ch:13 val:0 // 3-Color LED Light Bar #1, Zone 5 Green
setfixture:2 ch:14 val:0 // 3-Color LED Light Bar #1, Zone 5 Blue
setfixture:2 ch:15 val:0 // 3-Color LED Light Bar #1, Zone 6 Red
setfixture:2 ch:16 val:0 // 3-Color LED Light Bar #1, Zone 6 Green
setfixture:2 ch:17 val:0 // 3-Color LED Light Bar #1, Zone 6 Blue
setfixture:2 ch:18 val:0 // 3-Color LED Light Bar #1, Zone 7 Red
setfixture:2 ch:19 val:0 // 3-Color LED Light Bar #1, Zone 7 Green
setfixture:2 ch:20 val:0 // 3-Color LED Light Bar #1, Zone 7 Blue
setfixture:2 ch:21 val:0 // 3-Color LED Light Bar #1, Zone 8 Red
setfixture:2 ch:22 val:0 // 3-Color LED Light Bar #1, Zone 8 Green
setfixture:2 ch:23 val:0 // 3-Color LED Light Bar #1, Zone 8 Blue
Code: Select all
startunction:1 // script_1
wait:1000
...
startfunction:68 // script_8
wait:1000
Thanks for your help!