异星工场 class LuaBootstrap

class LuaBootstrap

注册事件处理程序的入口点。可通过名为 ==script == 的全局对象进行访问script。

方法 解释
on_init(f) Register a callback to be run on mod init.
on_load(f) Register a function to be run on module load.
on_configuration_changed(f) Register a function to be run when mod configuration changes.
on_event(event, f, filters) Register a handler to run on event or events.
on_nth_tick(tick, f) Register a handler to run every nth tick(s).
generate_event_name() → uint Generate a new, unique event ID.
get_event_handler(event) Find the event handler for an event.
raise_event(event, table) Raise an event.
get_event_order() Gets the mod event order.
set_event_filter(event, filters) Sets the filters for the given event.
get_event_filter(event) → table Gets the filters for the given event.
mod_name :: string [R] The name of the mod from the environment this is used in.
active_mods :: dictionary string → string [R] The active mods versions.
is_game_in_debug_mode [R] Is the game compiled in a debug mode.
object_name :: string [R] This objects name.

你可能感兴趣的:(游戏)