Template:Lua Functions

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

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

wesnoth.achievements

wesnoth.achievements.get
wesnoth.achievements.has
wesnoth.achievements.has_sub_achievement
wesnoth.achievements.progress
wesnoth.achievements.set
wesnoth.achievements.set_sub_achievement

wesnoth.audio

wesnoth.audio.music_list
wesnoth.audio.music_list.add
wesnoth.audio.music_list.all
wesnoth.audio.music_list.clear
wesnoth.audio.music_list.current
wesnoth.audio.music_list.next
wesnoth.audio.music_list.play
wesnoth.audio.music_list.previous
wesnoth.audio.music_list.remove
wesnoth.audio.music_list.volume
wesnoth.audio.play
wesnoth.audio.sources
wesnoth.audio.volume

wesnoth.game_events

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

wesnoth.interface

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

wesnoth.map

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

wesnoth.paths

wesnoth.paths.find_cost_map
wesnoth.paths.find_path
wesnoth.paths.find_reach
wesnoth.paths.find_vacant_hex
wesnoth.paths.find_vision_range

wesnoth.schedule

wesnoth.schedule.get_illumination
wesnoth.schedule.get_time_of_day
wesnoth.schedule.replace

wesnoth.sides

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

wesnoth.sync

wesnoth.sync.evaluate_multiple
wesnoth.sync.evaluate_single
wesnoth.sync.invoke_command
wesnoth.sync.run_unsynced

wesnoth.units

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

ai

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

filesystem

filesystem.canonical_path
filesystem.have_asset
filesystem.have_file
filesystem.image_size
filesystem.read_file
filesystem.resolve_asset

functional

functional.choose
functional.choose_map
functional.filter
functional.filter_map
functional.find
functional.find_map
functional.map
functional.map_array
functional.reduce
functional.take_while
functional.zip

gui

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

location_set

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

mathx

mathx.clamp
mathx.lerp
mathx.random
mathx.random_choice
mathx.round
mathx.shuffle

stringx

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

unit_test

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

wml

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

wml-utils

utils.check_key
utils.get_sides
utils.handle_event_commands
utils.optional_side_filter
utils.scoped_var
utils.set_exiting
utils.vwriter