Template:Lua Functions

From The Battle for Wesnoth Wiki
Revision as of 14:48, 19 April 2024 by Laela (talk | contribs)
wesnoth

dofile
require
textdomain
log
as_text
simulate_combat
name_generator
compile_formula
eval_formula
version
current_version
ms_since_init
deprecated_message
deprecate_api
type
named_tuple
get_language
print_attributes
persistent_tags
wml_actions
wml_conditionals
effects
micro_ais
custom_synced_commands
colors
current
game_config
races
scenario
terrain_types
unit_types

wesnoth.units

advance
clone
erase
extract
matches
find_attack
to_map
to_recall
transform
select
scroll_to
ability
chance_to_be_hit
defense_on
resistance_against
jamming_on
movement_on
vision_on
add_modification
remove_modifications
create_animator
create
find_on_map
find_on_recall
find
get
get_hovered

wesnoth.schedule

get_time_of_day
get_illumination
replace

wesnoth.sides

is_enemy
matches
set_id
place_fog
remove_fog
is_fogged
place_shroud
override_shroud
remove_shroud
is_shrouded
switch_ai
append_ai
add_ai_component
change_ai_component
delete_ai_component
get
find
iter
create
debug_ai

wesnoth.sync

evaluate_single
evaluate_multiple
run_unsynced
invoke_command

wesnoth.map

find
get
matches
on_board
on_border
iter
read_location
split_terrain_code
make_bitmap
parse_bitmap
terrain_mask
add_label
remove_label
get_label
place_area
remove_area
get_area
set_owner
get_owner
create
generate
generate_height_map
get_direction
get_relative_dir
rotate_right_around_center
get_adjacent_hexes
get_hexes_in_radius
are_hexes_adjacent
distance_between

wesnoth.audio

play
volume
sources
music_list
current
previous
volume
all
add
remove
clear
next
play

wesnoth.paths

find_path
find_vacant_hex
find_reach
find_vision_range
find_cost_map

wesnoth.game_events

add
add_repeating
add_menu
add_wml
remove
fire
fire_by_id
on_event
on_load
on_save
on_mouse_action
on_mouse_button
on_mouse_move

wesnoth.achievements

set
set_sub_achievement
has
has_sub_achievement
get
progress

gui

show_menu
show_narration
get_user_choice
show_popup
show_prompt
show_story
show_dialog
add_widget_definition
widget
show_help
show_inspector
show_lua_console

wml

attribute_count
child_array
child_count
child_range
find_child
get_child
get_nth_child
remove_child
remove_children
tag
clone
equal
valid
matches_filter
load
parse
merge
diff
patch
interpolate
tostring
tovconfig
literal
parsed
shallow_literal
shallow_parsed
all_variables
variables
variables_proxy
get
get_proxy
set
array_variables
eval_conditional
fire
error

location_set

create
of_raw
of_pairs
of_triples
of_map
of_wml_var
of_shroud_data
to_pairs
to_stable_pairs
to_triples
to_map
to_wml_var
to_shroud_data
clone
get
insert
remove
clear
size
empty
iter
stable_iter
filter
union
union_merge
inter
inter_merge
diff
symm
invert
random

functional

filter
filter_map
find
find_map
choose
choose_map
map
map_array
reduce
take_while
zip

stringx

split
escaped_split
quoted_split
anim_split
parenthetical_split
map_split
join
join_map
vformat
format_conjunct_list
format_disjunct_list
trim
parse_range
iter_range
iter_ranges

mathx

clamp
lerp
random
random_choice
round
shuffle

filesystem

read_file
have_file
canonical_path
image_size
have_asset
resolve_asset

ai

read_only
side
aspects
get_attacks
get_targets
suitable_keep
attack
check_attack
move
move_full
check_move
recall
check_recall
recruit
check_recruit
stopunit_attacks
stopunit_moves
stopunit_all
check_stopunit
fallback_human

wml-utils

check_key
vwriter
get_sides
optional_side_filter
handle_event_commands
set_exiting
scoped_var

unit_test

fail
succeed
finish
log
tostring
fire_wml_menu_item
assert
assert_equal
assert_not_equal
assert_approx_equal
assert_greater
assert_greater_equal
assert_less
assert_less_equal
assert_in_range
assert_contains
assert_nothrow
assert_throws
assert_throws_with

wesnoth.interface

delay
deselect_hex
highlight_hex
select_unit
float_label
get_displayed_unit
get_hovered_hex
get_selected_hex
get_viewing_side
lock
is_locked
scroll_to_hex
scroll
zoom
skip_messages
is_skipping_messages
add_chat_message
clear_chat_messages
add_item_image
add_item_halo
remove_item
get_items
add_hex_overlay
remove_hex_overlay
end_turn
allow_end_turn
color_adjust
add_overlay_text
handle_user_interact