Update lua help.txt

This commit is contained in:
2026-03-07 17:37:23 +03:00
parent 79898c42d6
commit c388614674

View File

@@ -2,29 +2,53 @@ Globals:
ACTION_FIRE = 0 ACTION_FIRE = 0
ACTION_ALT_FIRE = 1 ACTION_ALT_FIRE = 1
ACTION_RELOAD = 2 ACTION_RELOAD = 2
ACTION_USE = 3
ANIM_PLAYBACK_NONE = 0 ANIM_PLAYBACK_NONE = 0
ANIM_PLAYBACK_REPEAT = 1 ANIM_PLAYBACK_REPEAT = 1
EMovementDir_None = 1
EMovementDir_Forward = 2
EMovementDir_Backward = 4
EMovementDir_Left = 8
EMovementDir_Right = 16
EMovementDir_Jump = 32
engine.error(string message) engine.error(string message)
engine.warning(string message) engine.warning(string message)
engine.create_entity(string classname) -- return an table to the new entity engine.create_entity(string classname) -- return an table to the new entity
engine.add_entity_to_world(entity) -- add entity to the world engine.add_entity_to_world(entity) -- add entity to the world
engine.get_entity_from_id(integer id) -- return an entity table from engine.get_entity_from_id(integer id) -- return an entity table from
engine.find_entity_by_name(string name) -- return an entity table from
engine.play_sound(string filename) -- play 2d sound engine.play_sound(string filename) -- play 2d sound
engine.play_sound_3d(string filename, float x, float y, float z) -- play 3d sound
engine.get_delta() -- return delta time (float)
engine.trace_ray(float rayBeginX, float rayBeginY, float rayBeginZ, float rayEndX, float rayEndY, float rayEndZ, object ignoreTable) -- return a table with [pos_x, pos_y, pos_z, normal_x, normal_y, normal_z, entity_id, hit]
camera.get_position() -- return x, y, z camera.get_position() -- return x, y, z
camera.get_front() -- return x, y, z camera.get_front() -- return x, y, z
camera.get_right() -- return x, y, z camera.get_right() -- return x, y, z
camera.get_up() -- return float camera.get_up() -- return float
camera.get_pitch() -- return float camera.get_pitch() -- return float
camera.set_yaw_pitch(float yaw, float pitch)
console.print(string message) console.print(string message)
input.get_mouse_pos() -- return x, y
input.get_delta_mouse_pos() -- return x, y
input.lock_mouse(bool value) -- lock or unlock mouse capture
input.get_lock_mouse() -- return boolean
ui.draw_text(string text, float x, float y, object color) -- color is a table [r,g,b,a]
ui.draw_rect(float x, float y, float w, float h, object color) -- color is a table [r,g,b,a]
ui.draw_image(string filename, float x, float y, float w, float h, object color) -- color is a table [r,g,b,a]
ui.get_display_size() -- return x, y
ui.get_mouse_pos() -- return x, y
ui.calc_text_width(string text) -- return float
Entity properties: Entity properties:
string m_name string m_name -- read only
integer m_id integer m_id -- read only
Entity callbacks: Entity callbacks:
@@ -55,9 +79,19 @@ set_rotation_from_vectors(float frontx, float fronty, float frontz,
get_classname() -- return the classname of the entity get_classname() -- return the classname of the entity
get_id() -- return the id of the entity get_id() -- return the id of the entity
mark_for_delete() -- mark entity to delete mark_for_delete() -- mark entity to delete
set_name(string name) -- set entity name
get_name() -- return string
find_animation(string name) -- find a animation in the model set_velocity(float x, float y, float z) -- setting the body velocity
play_animation(integer id, integer mode) -- play a animation with specified mode (ANIM_PLAYBACK_NONE, ANIM_PLAYBACK_REPEAT) get_velocity() -- return x, y, z
has_rigid_body() -- return boolean
create_box_body(float sizex, float sizey, float sizez, float mass, float friction, float damping, bool is_trigger, bool use_parameters)
create_sphere_body(float radius, float mass, float friction, float damping, bool is_trigger, bool use_parameters)
find_animation(string name) -- find an animation in the model
play_animation(integer id, integer mode) -- play an animation with specified mode (ANIM_PLAYBACK_NONE, ANIM_PLAYBACK_REPEAT)
stop_animation() -- stop a current animation
get_current_animation() -- return the id to the current playing animation get_current_animation() -- return the id to the current playing animation
get_current_animation_time() -- return the current time of the current playing animation get_current_animation_time() -- return the current time of the current playing animation
get_animation_time(integer id) -- return the time of a animation get_animation_time(integer id) -- return the time of a animation
@@ -68,6 +102,17 @@ ActorBase methods:
activate_camera() activate_camera()
update_camera_look() update_camera_look()
update_camera_movement(float nubmer) update_camera_movement(float nubmer)
create_body() create_player_body()
update_body_movement(float nubmer) update_body_movement(float nubmer)
get_action() -- return an current mode (ACTION_FIRE, ACTION_ALT_FIRE, ACTION_RELOAD) get_action() -- return a current action mode (ACTION_FIRE, ACTION_ALT_FIRE, ACTION_RELOAD, ACTION_USE)
get_movement() -- return a current movement mode (EMovementDir_None, ...)
on_ground() -- return boolean
is_noclip() -- return boolean
Light methods:
set_color(float r, float g, float b)
get_color() -- return r, g, b
set_radius(float radius)
get_radius() -- return radius (float)