Engine:CLUA require
Jump to navigation
Jump to search
Loads and runs lua text file asset from engine data.
require "file.lua"
Arguments
- name - name and path of the file to be run
Associations
- Is by default placed in the default Lua runtime.
Details
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
Default values
From script in engine, in the 'global' contest:
lua require 'frame.lua'
// or
context lua
require 'frame.lua'
From lua:
require 'frame.lua'
-- or
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.