Author Topic: Bit of an advanced scripting question - Ramp + Chase  (Read 1467 times)

Offline jwilliams31

  • Sr. Member
  • ****
  • Posts: 145
    • Williams Family Christmas Lights
I'm using a scripted sequence as my background sequence on Vixen 2.1 to run my lights in between shows.

I've got a mega tree that I'd like to have "start up" by having kind of a ramp with a chase.  I could just ramp up each individual channel, but since the script runs sequentially, and quickly, to the eye, it would just look like they all turn on at the same time.

The problem with the Wait command is that it causes all actions to freeze, so if I have something else trying to do something, not megatree related, it will cause that to stop as well.

Maybe I'm just asking for too much here, but I thought I would try.

I'm trying to avoid using an actual sequence because I like how Vixen handles the background sequence, plus I like to use Vixen's built-in background music player for fill in music when no show is running so I don't have dead air.

Anyway, if anyone has any thoughts or experience to share, it would be appreciated.

Thanks.

Jason
Einstein once said: "There are two things that are infinite; the universe and human stupidity. And, I'm not too sure about the universe."

Offline arw01

  • Sr. Member
  • ****
  • Posts: 866
Re: Bit of an advanced scripting question - Ramp + Chase
« Reply #1 on: November 26, 2013, »
So by scripting I assume a programming language, does it have a sleep instead of a wait?  Sleep can often return control to the OS and other processes can perhaps continue.

Another way would be to check full time and use a loop or if statement to compare time when you started to wait to time now and when the difference is enough then you continue.

Alan

Offline jwilliams31

  • Sr. Member
  • ****
  • Posts: 145
    • Williams Family Christmas Lights
Re: Bit of an advanced scripting question - Ramp + Chase
« Reply #2 on: November 26, 2013, »
Well, I'm using the scripting built into Vixen 2.1.

Unfortunately there doesn't seem to be any real good documentation on what functions are available and what works.  It seems that the Wiki is either severely lacking or Vixen is just more limited than I originally thought.
Einstein once said: "There are two things that are infinite; the universe and human stupidity. And, I'm not too sure about the universe."

Offline rrowan

  • Administrator
  • Sr. Member
  • *****
  • Posts: 5899
  • 08096
Re: Bit of an advanced scripting question - Ramp + Chase
« Reply #3 on: November 26, 2013, »
You are not allowed to view links. Register or Login
Well, I'm using the scripting built into Vixen 2.1.

Unfortunately there doesn't seem to be any real good documentation on what functions are available and what works.  It seems that the Wiki is either severely lacking or Vixen is just more limited than I originally thought.

I haven't looked in years but. At one point the DIYC wiki had the info. I didn't see a reason to duplicate it. Very few folks did the background scripts. There was a post about it and attached files. I will see if its still around.

Rick R.
Light Animation Hobby - Having fun and Learning at the same time. (21st member of DLA)
You are not allowed to view links. Register or Login
Warning SOME assembly required

Offline jwilliams31

  • Sr. Member
  • ****
  • Posts: 145
    • Williams Family Christmas Lights
Re: Bit of an advanced scripting question - Ramp + Chase
« Reply #4 on: November 26, 2013, »
I did see the wiki on DIYC, but the scripting section is really lacking.  I wasn't sure if Vixen was really that limited in its scripting ability or if the wiki was just missing stuff.

I'll keep playing around with stuff.  If it doesn't work, it doesn't work...

Thanks.

Jason
Einstein once said: "There are two things that are infinite; the universe and human stupidity. And, I'm not too sure about the universe."

Offline tjbrickner

  • Full Member
  • ***
  • Posts: 79
Re: Bit of an advanced scripting question - Ramp + Chase
« Reply #5 on: November 26, 2013, »
The wiki say projects are written in C#.  If it's true C# you can use the System.Threading.Tasks namespace and use Task.Delay(number of milliseconds)

Never tried any scripting in Vixen though.
Afraid of heights and I'm still always on the roof...

Offline jwilliams31

  • Sr. Member
  • ****
  • Posts: 145
    • Williams Family Christmas Lights
Re: Bit of an advanced scripting question - Ramp + Chase
« Reply #6 on: November 27, 2013, »
I'll have to try that.  I ended up using a kind of convoluted way to make it work.  I ended up using a while loop and the current time.

I took the current time, added x number of seconds to it, and then ran the while loop while the current time was not equal to or greater than the ending time (start time + x seconds).

I wouldn't call it pretty having a bunch of these while loops in the script, but it seems to serve the purpose.
Einstein once said: "There are two things that are infinite; the universe and human stupidity. And, I'm not too sure about the universe."