Lua Scripting for Ecotect

Instructor: Matthew M. Burke
Summer 2008

For those who have never written scripts or programs, there is a short lecture which presents an overview of the Script Manager.

Topics

  1. An Introduction to Lua

    This module introduces Lua through several simple Ecotect scripts. Lua syntax, types and function definitions are explained. The four main Lua-Ecotect commands are introduced (add, get, set, cmd).

    View the exercises for lesson 1.

  2. Lua Control and Decision Structures

    Examining all the zones, objects, etc. in an Ecotect model is used to motivate the looping and branching control structures in Lua.

    View the exercises for lesson 2.

  3. Lua Tables

    This module introduces the main Lua data structure, the table. Examples of using tables to store related data (e.g. all the attributes for a zone), using tables as a more flexible means of parameter passing, and using a table iterator to loop over the values in a table are presented.

    View the exercises for lesson 3.

  4. Functions, Parameters and Return Values

    This module will cover the details of writing both named and anonymous functions, specifying parameters, including parameters with default values, and functions that return multiple values.

    View the exercises for lesson 4.

  5. The Lua Standard Libraries

    Discussion of the standard Lua functions available to scripts.

  6. Overview of the Ecotect API

    An overview of the objects available to Lua scripts.

  7. Ecotect Scripting Objects I

    This module covers the application, model, node, object, and project objects.

  8. Ecotect Scripting Objects II

    This module covers the attribute, miscellaneous, schedule, script, selection, and zone objects.

  9. Ecotect Scripting Objects III

    This module covers the graph, grid, grid3d, masks, movie, opengl, and view objects.

  10. Ecotect Scripting Objects IV

    This module covers the attribute, calculation, material, radiance, ray, rays, shading, sunpath, and weather objects.

  11. Upvalues and Closures

    In addition to local and global variables, Lua functions can reference variables from the environment in which they were created (upvalues). This module explains upvalues and why they are useful.

  12. Standard Lua Idioms

    Common techniques for Lua scripts.


Modified: 22 September 2008