Moving Entity Scripts Entry Points
Back
You can define these functions in your moving entity Lua scripts
and they will be called by the engine.
The first group of functions are called during initialization
in the Initialization Lua state.
The next group of functions are called during normal gameplay
in the Game Lua state.
Moving entity Lua scripts are Lua scripts found in the MovingEnts
directory (and its subdirectories) of your package.
Called During (Type) Initialization
void __type_init(int type_id);
Called During Main Game
void __on_add_to_live_world(
int inst_id);
void __on_update(
int inst_id, float elapsed_time, float elapsed_level_time);
void __on_alarm(
int inst_id, string alarm_name);
void __on_too_fine(
int inst_id, int fine_chunk_id, Vector fine_offset);
bool __on_block_hit(
int inst_id, int level,
BlockPos bp, Vector lp,
int normal_side, Vector normal);
bool __on_block_hit_nonfertile(
int inst_id, int level,
BlockPos bp, Vector lp,
int normal_side, Vector normal);
bool __on_ment_hit(
int hitter_inst_id, int hittie_inst_id,
int level, Vector lp,
Vector normal);
void __on_level_travel(
int inst_id, int level,
Vector lp_start, Vector lp_end);
void __on_closest(
int inst_id,
float dist_to_viewer,
Vector dir_to_viewer);
void __on_telefragged(int inst_id);
bool __get_can_use(int inst_id);
string __get_use_msg(int inst_id);
void __on_use(int inst_id);
void __on_use2(int inst_id);
void __on_render(int inst_id, float radius);