Module l2df.core
Core module
Info:
- Copyright: Atom-TM 2020
- Author: Abelidze, Kasai
Functions
import(name) | Wrapper on standart 'require', imports engine's components. |
root([depth=3]) | Important function to determine engine's location. |
getline() | Return information about line where this function was executed. |
modulepath(path) | Convert path to module's path. |
workpath([path]) | Convert path relative to current working directory to absolute. |
savepath([path]) | Convert path relative to current save directory to absolute. |
fullpath(path[, depth=2[, info]]) | Converts the path relative to the game's entry point. |
Functions
Methods- import(name)
-
Wrapper on standart 'require', imports engine's components.
automatically adding required module's prefix.
Parameters:
- name string Name of the module/class to import from l2df.
Returns:
-
function
- root([depth=3])
-
Important function to determine engine's location.
First call to core.root() always should be in core.init.
Parameters:
- depth number Depth passed to debug.getinfo method. (default 3)
Returns:
- getline()
-
Return information about line where this function was executed.
Returns:
- modulepath(path)
-
Convert path to module's path.
Useful to require .lua scripts by their path.
Parameters:
- path string Source path.
Returns:
- workpath([path])
-
Convert path relative to current working directory to absolute.
Parameters:
- path string Source path. (optional)
Returns:
- savepath([path])
-
Convert path relative to current save directory to absolute.
Parameters:
- path string Source path. (optional)
Returns:
- fullpath(path[, depth=2[, info]])
-
Converts the path relative to the game's entry point.
Parameters:
- path string Source path.
- depth number Depth passed to debug.getinfo method. (default 2)
- info table Stack Information table (may be provided by calling debug.getinfo). (optional)
Returns: