Lua 101

Open Source software contributions and discussions that supplement or extend the Palette / Light Palette software
Post Reply
User avatar
Posts: 288
Joined: Tue Mar 31, 2009 3:10 am
Primary Venue / Use: Professional Theatre
Where I Am: Melbourne, Australia
Location: Melbourne, Australia

Lua 101

Post by MickCrozier » Wed Jun 17, 2009 11:04 pm

I found this very helpful for getting me started with the basic syntax of Lua - ... ler_9.html

Formerly Durisian (who died peacefully of digital old age)

User avatar
Posts: 2537
Joined: Fri Oct 12, 2007 10:51 am
Location: Livingston, NJ

Re: Lua 101

Post by BobbyHarrell » Wed Aug 26, 2009 4:36 pm

thanks for this.
Bobby Harrell - Product Specialist
Philips Entertainment - Strand Lighting

Posts: 224
Joined: Thu Jun 26, 2008 5:30 am
Location: The Netherlands

Re: Lua 101

Post by tom » Fri Dec 18, 2009 9:24 am

Thanks for the link, it was helpful.

A couple of uneducated questions -
What is the lifespan of a lua variable? They seem to live longer than just the script they are used in. They can also be used by other scripts right?

Do you have to pay attention to killing them off?
They dont survive between session? Will restarting the software clean them all out?

Is there any type of timer or count function? Like wait(some amount of miliseconds)
Light palette : classic
Nederlands Dans Theater.

"Come forth and thy shalt win eternal happiness", but he came fifth, so he won an electric toaster.

User avatar
Posts: 700
Joined: Fri Oct 12, 2007 1:11 pm
Location: Orlando, Florida

Re: Lua 101

Post by BrianEvans » Fri Dec 18, 2009 11:15 am

Lua variables that are not local, live your entire palette session.

Variables do not get wiped until you close Palette,
and re-open.

Timer is something I wanted a while ago as well,
it was attempted in the engine,
but found to be dangerous and costly in the current architecture.
Major re-work was found to be required.
(Was pausing the entire UI).
(Behaved Like Loop / Do GetTickCount in VB.)
Brian Evans - System Specialist - Horizon Control Inc.

User avatar
Posts: 2421
Joined: Fri Oct 12, 2007 1:11 pm
Primary Venue / Use: Other
Where I Am: Horizon Control Inc
Location: On the dark side just north of Toronto

Re: Lua 101

Post by RobertBell » Fri Dec 18, 2009 10:43 pm

HC.VariableSetDelayed('page','name' | order,'value' | value,seconds)
Often works good enough - but means you have to split the code in 2 (pre and post branch)
Robert Bell - Product Manager - Horizon Control Inc.

Post Reply