Dofile
(Difference between revisions)
Dahnielson (Talk | contribs) |
Dahnielson (Talk | contribs) m |
||
| Line 1: | Line 1: | ||
{{lua-function|dofile|file}} | {{lua-function|dofile|file}} | ||
| − | To every scene can be attached only one | + | 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. |
| + | |||
| + | {{lua-function-param|file|lua script file to execute}} | ||
'''Example 1:''' This script will add an external light effect library | '''Example 1:''' This script will add an external light effect library | ||
Revision as of 23:56, 8 February 2014
dofile(file)
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.
-
file: lua script file to execute
Example 1: This script will add an external light effect library
dofile("lights/lightsfx.lua")
light = getObject("Light")
function onSceneUpdate()
flickerLightEffects(light)
end