Dofile
(Difference between revisions)
(Created page with "To every scene can be attached only one lua file. Use this command to use multiple files in your scene script. It can be used to include a common file that contains common fun...") |
|||
Line 7: | Line 7: | ||
dofile("lights/lightsfx.lua") | dofile("lights/lightsfx.lua") | ||
− | |||
light = getObject("Light") | light = getObject("Light") | ||
− | |||
function onSceneUpdate() | function onSceneUpdate() | ||
flickerLightEffects(light) | flickerLightEffects(light) | ||
end | end |
Revision as of 13:16, 6 January 2013
To every scene can be attached only one lua file. Use this command to use multiple files in your scene script. It can be used to include a common file that contains common functions or to include external third party libraries.
Example 1 : This script will add an external light effect library
dofile("lights/lightsfx.lua") light = getObject("Light") function onSceneUpdate() flickerLightEffects(light) end