Engine:CLUA require
Jump to navigation
Jump to search
Loads and runs lua text file asset from engine data.
require "file.lua"
Arguments[edit]
- name - name and path of the file to be run
Associations[edit]
- Is by default placed in the default Lua runtime.
Details[edit]
A global Lua runtime function that loads and runs verbatim a Lua code file in the current Lua runtime. No parameters are passed when run.
Will be loaded as a chunk and executed. The chunk will have no references to it such that the chunk should be garbage collected after being run.
Examples[edit]
Default values[edit]
From lua:
require 'frame.lua'
-- or
require('frame.lua')
From script in engine, in the 'global' context:
lua require 'frame.lua'
// or
context lua
require 'frame.lua'
- All of these will effectively run the Lua 'require' function in the current Lua runtime, load the script file from data, and load it and run it in the calling Lua runtime.