Chaining Scripts

This example shows how the chain command is used to branch to pages in other scripts. The name file of the target script is required and usually includes a path to a scripts folder as well. Only forward slash symbols (/) can be used in these paths; not backslash symbols (\). An optional second parameter may also be specified which names a target page in the script. If omitted, the new script will begin execution at the first page in the file. No condition options are allowed for this command.

The chain command makes it possible to create very large sign projects which are not limited by the amount of memory available to Lightwing. Since there is no limit to the number of scripts that can be chained using this command, the ultimate size of any project is only limited by the amount of space available for the file system.

Look at the output in the Lightwing log window or file (lightwing\Log.txt) to see the script execution flow. Also refer to the online Scripting Guide for more details about these commands.

// Scripting Tutorial - Chaining Scripts

version: 1.0
shadow: OpenSansBold_100    offset: 5

// Jump to one of seven planet pages based on the day of the week.
page: First
    jump: Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday     index: Day

page: Sunday          time: 1, 3    image: PlanetMercuryBackground.pvr
    text: OpenSansBold_100    time: 1, 2    fade: 1, 1    position: 50, 50    align: CenterCenter        type: DateLong
    chain: scripts/Tutorial_12_Branching.lws, Sunday

page: Monday         time: 1, 3    image: PlanetVenusBackground.pvr
    text: OpenSansBold_100    time: 1, 2    fade: 1, 1    position: 50, 50    align: CenterCenter        type: DateLong
    chain: scripts/Tutorial_12_Branching.lws, Monday

page: Tuesday         time: 1, 3    image: PlanetEarthBackground.pvr
    text: OpenSansBold_100    time: 1, 2    fade: 1, 1    position: 50, 50    align: CenterCenter        type: DateLong
    chain: scripts/Tutorial_12_Branching.lws, Tuesday

page: Wednesday   time: 1, 3    image: PlanetMarsBackground.pvr
    text: OpenSansBold_100    time: 1, 2    fade: 1, 1    position: 50, 50    align: CenterCenter        type: DateLong
    chain: scripts/Tutorial_12_Branching.lws, Wednesday

page: Thursday       time: 1, 3    image: PlanetJupiterBackground.pvr
    text: OpenSansBold_100    time: 1, 2    fade: 1, 1    position: 50, 50    align: CenterCenter        type: DateLong
    chain: scripts/Tutorial_12_Branching.lws, Thursday

page: Friday            time: 1, 3    image: PlanetSaturnBackground.pvr
    text: OpenSansBold_100    time: 1, 2    fade: 1, 1    position: 50, 50    align: CenterCenter        type: DateLong
    chain: scripts/Tutorial_12_Branching.lws, Friday

page: Saturday        time: 1, 3    image: PlanetUranusBackground.pvr
    text: OpenSansBold_100    time: 1, 2    fade: 1, 1    position: 50, 50    align: CenterCenter        type: DateLong
    chain: scripts/Tutorial_12_Branching.lws, Saturday

 

 

<   Subroutines                                             Introduction                                            Linking Scripts   >