Module l2df.core

Last updated 2021-05-28 15:24:22

Core module

Info:

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:

    string
getline()
Return information about line where this function was executed.

Returns:

    string
modulepath(path)
Convert path to module's path. Useful to require .lua scripts by their path.

Parameters:

Returns:

    string
workpath([path])
Convert path relative to current working directory to absolute.

Parameters:

  • path string Source path. (optional)

Returns:

    string
savepath([path])
Convert path relative to current save directory to absolute.

Parameters:

  • path string Source path. (optional)

Returns:

    string
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:

    string