Difference between revisions of "GameConfigWML"

From The Battle for Wesnoth Wiki
m (The [game_config] tag)
(Color Palettes: delete sentence that seems to be wrong (tested with Ravana's color changer and #4366))
(27 intermediate revisions by 15 users not shown)
Line 1: Line 1:
This page has several unknown informations; they are represented by '???'.
+
{{WML Tags}}
Feel free to replace them with actual data.
 
 
 
 
== The [game_config] tag ==
 
== The [game_config] tag ==
  
 
This tag is a top level WML tag which can only be used once because
 
This tag is a top level WML tag which can only be used once because
 
it defines basic settings that are used everywhere in the game.
 
it defines basic settings that are used everywhere in the game.
In official versions of Wesnoth it is in ''game.cfg''; values used there are labeled 'standard'.
+
In official versions of Wesnoth it is in ''game_config.cfg''; values used there are labeled 'standard'.
  
  
 
The following keys are recognised
 
The following keys are recognised
* ''base_income'' (standard 2) how much your leader earns without any villages
+
* '''base_income''': (standard 2) how much your leader earns without any villages
* ''heal_amount'' (standard 4) how much the 'heal' ability (see [[AbilitiesWML]]) heals per unit
+
* '''village_income''': (standard 1) how much your leader earns for each village you control
* ''healer_heals_per_turn'' (standard 8) how much a healer can heal per turn (total).
+
* '''poison_amount''': (standard 8) the amount of damage poison deals to a unit
Healing is distributed clockwise, starting north of the healer,
+
* '''rest_heal_amount''': (standard 2) how much HP a unit gains each turn it rests
until ''healer_heals_per_turn'' hitpoints have been regenerated.
+
* '''recall_cost''': (standard 20) how much it costs to recall a unit; this cost is independent of level.
* ''cure_amount'' (standard 8) how much the 'cure' ability heals per unit
+
* '''kill_experience''': (standard 8) killing a unit with ''level=X'' will give ''X''*''kill_experience'' experience to the killing unit. However, if a unit has ''level=0'', it will still give half of ''X'' experience.
* ''curer_heals_per_turn'' (standard 18) how much a curer can heal per turn (total)
 
* ''rest_heal_amount'' (standard 2) how much HP a unit gains each turn it rests
 
* ''recall_cost'' (standard 20) how much it costs to recall a unit; this cost is independent of level.
 
* ''kill_experience'' (standard 8)
 
killing a unit with ''level=X'' will give ''X''*''kill_experience'' experience to the killing unit.
 
However, if a unit has ''level=0'', it will still give half of ''X'' experience.
 
  
* ''icon'' (standard 'wesnoth-icon.png') the game icon file
+
* '''icon''': (standard 'wesnoth-icon.png') the game icon file
* ''title'' (standard 'misc/title.png') the title screen image
+
* '''title''': (standard 'misc/title.png') the title screen image
* ''logo'' (standard 'misc/logo.png') the wesnoth logo which will be put over the title image
+
* '''logo''': (standard 'misc/logo.png') the wesnoth logo which will be put over the title image
* ''title_music'' (standard 'main_menu.ogg') the music to play at the title screen
+
* '''default_defeat_music''': (standard 'defeat.ogg,defeat2.ogg') default list of music tracks that are chosen to play on player's defeat; this can be overriden per-scenario
 +
* '''default_victory_music''': (standard 'victory.ogg,victory2.ogg') default list of music tracks that are chosen to play on player's victory; this can be overriden per-scenario
 +
* '''title_music''': (standard 'main_menu.ogg') the music to play at the title screen
 +
* '''logo_x''':      (standard 292) the x position of the logo on the title screen
 +
* '''logo_y''':      (standard  120) the y position of the logo on the title screen
 +
* '''buttons_x''':  (standard 760) the x position of the buttons on the title screen
 +
* '''buttons_y''':  (standard 330) the y position of the buttons on the title screen
 +
* '''buttons_padding''': (standard  20) space between buttons, and border in main menu
 +
* '''tip_x''':      (standard 100) space between the button panel left edge and the tip-of-the-day panel right edge
 +
* '''tip_y''':      (standard 500) not used (the bottom right corner of the tip-of-the-day panel is pegged to align with the bottom of the button panel)
 +
* '''tip_width''':  (standard 495) max width in pixels of the tip-of-the-day panel.  The width will actually adjust to be the smallest size necessary to fit the text.  Once the max width is reached, if text must flow onto multiple lines, then the height will also automatically adjust.
 +
* '''tip_padding''': (standard  20) space between the edge of the tip-of-the-day panel and an imaginary bounding box containing the text inside the panel
  
* ''logo_x''     (standard 525) the x position of the logo on the title screen
+
* '''map_image''':  (standard 'maps/wesnoth.png') the background image for the "About" screen
* ''logo_y''     (standard 70) the y position of the logo on the title screen
+
* '''sidebar_image''': (standard 'misc/rightside.png') border of window when displaying unit statistics
* ''buttons_x''   (standard 760) the x position of the buttons on the title screen
+
* '''sidebar_image_bottom''': (standard 'misc/rightside-bottom.png') border of image when displaying unit statistics
* ''buttons_y''   (standard 330) the y position of the buttons on the title screen
+
* '''energy_image''': (standard 'misc/bar-energy.png') the images used to display hp/xp bars.
* ''buttons_padding'' (standard 20) space between buttons, and border in main menu
+
* '''moved_ball_image''': (standard 'misc/ball-moved.png') the orb image to add on top of the hp bar for player's moved units; see 'Orbs', [[WesnothManual]]
* ''tip_x''           (standard 100) ???
+
* '''unmoved_ball_image''': (standard 'misc/ball-unmoved.png') like '''moved_ball_image''', but for player's unmoved units
* ''tip_y''           (standard 500) ???
+
* '''partmoved_ball_image''': (standard 'misc/ball-partmoved.png') like '''moved_energy_image''', but for player's partially moved units
* ''tip_width''       (standard 495) ???
+
* '''flag_image''': (standard 'image/flag'terrain/flag-1.png:150,terrain/flag-2.png:150,terrain/flag-3.png:150,terrain/flag-4.png:150') the default flag animation to mark captured villages (if no custom flag is defined in the [side] tag). By example, this animation has 4 frames of 150ms each. An automatic side-coloring is applied.
* ''tip_padding''     (standard 20) ???
+
* '''flag_icon_image''': (standard 'flags/flag-icon.png') the default flag icon to indicate the side playing in the statusbar (if no custom flag_icon is defined in the [side] tag). An automatic side-coloring is applied.
 +
* ''' hp_bar_scaling ''': (standard '0.6') The ratio of hitpoints to height used for displaying the hp bar. Can be overwritten in [unit] and [unit_type].
 +
* ''' xp_bar_scaling ''': (standard '0.5') The ratio of xp to height used for displaying the xp bar. Can be overwritten in [unit] and [unit_type].
 +
* '''cross_image''': (standard 'misc/cross.png') the cross image displayed on the map at start of scenarios; see [[IntroWML]]
 +
* '''dot_image''': (standard 'misc/dot.png') the dot image used to draw a path on the map before scenarios
  
* ''map_image''    (standard 'maps/wesnoth.png') the background image for the "About" screen
+
* '''footprint_left_nw''', '''footprint_left_n''', '''footprint_right_nw''', '''footprint_right_n''': images used to display the path that a unit would take to the tile the cursor is on.
* ''sidebar_image'' (standard 'misc/rightside.png') border of window when displaying unit statistics
 
* ''sidebar_image_bottom'' (standard 'misc/rightside-bottom.png') border of image when displaying unit statistics
 
* ''moved_energy_image'' (standard 'misc/bar-energy-moved.png')
 
the diamond image to add on top of the hp bar for player's moved units; see 'Orbs', [[WesnothManual]]
 
* ''unmoved_energy_image'' (standard 'misc/bar-energy-unmoved.png')
 
like ''moved_energy_image'', but for player's unmoved units
 
* ''partmoved_energy_image'' (standard 'misc/bar-energy-partmoved.png')
 
like ''moved_energy_image'', but for player's partially moved units
 
* ''enemy_energy_image'' (standard 'misc/bar-energy-enemy.png')
 
like ''moved_energy_image'', but for enemy units
 
* ''ally_energy_image'' (standard 'misc/bar-energy-ally.png')
 
like ''moved_energy_image'', but for allied units
 
* ''flag_image'' (standard 'terrain/flag-team%d-1.png:150,terrain/flag-team%d-2.png:150')
 
the image for a flag.
 
The symbol '%d' is used as a shortcut for an integer which depends on the color of the flag;
 
for example, a red flag is shown by the alternating images 'terrain/flag-team1-1.png' and 'terrain/flag-team1-2.png'.
 
(What does ':150' do???)
 
 
 
* ''cross_image'' (standard 'misc/cross.png') the cross image displayed on the map at start of scenarios; see [[IntroWML]]
 
* ''dot_image'' (standard 'misc/dot.png') the dot image used to draw a path on the map before scenarios
 
 
 
* ''footprint_left_nw'', ''footprint_left_n'', ''footprint_right_nw'', ''footprint_right_n''
 
images used to display the path that a unit would take to the tile the cursor is on.
 
 
The first image of each key is used for tiles which would take only 1 movement point for the selected unit to move onto;
 
The first image of each key is used for tiles which would take only 1 movement point for the selected unit to move onto;
 
the second for ones which would take more.
 
the second for ones which would take more.
The 'n' and 'nw' designations distinguish between tiles which are moved from orthogonally and diagonally in the same way as described in '''[missile_frame]''', [[AttackWML]].
+
The 'n' and 'nw' designations distinguish between tiles which are moved from orthogonally and diagonally in the same way as described in '''[missile_frame]''', [[AnimationWML]].
 
The 'left' and 'right' designations are used alternately throughout the path;
 
The 'left' and 'right' designations are used alternately throughout the path;
 
however, the standard values are the same for 'left' and 'right'.
 
however, the standard values are the same for 'left' and 'right'.
  
* ''missile_n_image'' (standard 'projectiles/missile-n.png') orthogonal missile image to use if none is specified;
+
* '''terrain_mask_image''': (standard 'terrain/alphamask.png') used to give a hex-shape from a rectangular image.
see ''image'', '''[missile_frame]''', [[AttackWML]]
+
* '''grid_image''': (standard 'terrain/grid.png') the image used by the grid option
* ''missile_ne_image'' (standard 'projectiles/missile-ne.png') diagonal missile image to use if none is specified;
+
* '''unreachable_image''': (standard 'terrain/darken.png') the stripes mask used to show unreachable locations
see ''image_diagonal'', '''[missile_frame]''', [[AttackWML]]
+
 
* ''terrain_mask_image'' (standard 'terrain/alphamask.png') ???
+
* '''missile_n_image''': (standard 'projectiles/missile-n.png') orthogonal missile image to use if none is specified; see ''image'', '''[missile_frame]''', [[AnimationWML]]
* ''observer_image'' (standard 'misc/eye.png') the image to use for observer ???
+
* '''missile_ne_image''': (standard 'projectiles/missile-ne.png') diagonal missile image to use if none is specified; see ''image_diagonal'', '''[missile_frame]''', [[AnimationWML]]
* ''download_campaign_image'' (standard no image) the icon for the "Download more Campaigns" campaign menu option.
+
* '''observer_image''': (standard 'misc/eye.png') the image to use for observer in multi-player games. (The eye in the upper right hand corner.)
 +
* '''download_campaign_image''': (standard no image) the icon for the "Download more Campaigns" campaign menu option.
 +
* '''zoom_levels''': {{DevFeature1.13|8}} A comma-separated list of valid zoom levels, with 1.0 representing 100%.
 +
 
 +
== Color Palettes ==
 +
 
 +
Color palettes are defined by two tags within '''[game_config]'''.
 +
 
 +
* '''[color_palette]''': Contains the definitions of source palettes, such as magenta. Each key defines a palette, and must be set to a comma-separated list of hexadecimal colors.
 +
* '''[color_range]''': Defines a target color palette.
 +
** '''id''': Used to reference the palette, for example from '''[side]''' or ~RC().
 +
** '''name''': A translatable name for the color. <s>This may be ignored for non-core colors?</s>
 +
** '''rgb''': A comma-separated sequence of four hexadecimal colors:
 +
**# the average shade of a unit's team-color portions
 +
**# the maximum highlight shade of a unit's team-color portions
 +
**# the minimum shadow shade of a unit's team-color portions
 +
**# the color of the markers on the mini-map.
  
 
== See Also ==
 
== See Also ==
  
 
* [[ReferenceWML]]
 
* [[ReferenceWML]]
 +
 +
 +
[[Category: WML Reference]]

Revision as of 18:32, 26 September 2019

[edit]WML Tags

A:

abilities, about, achievement, achievement_group, add_ai_behavior, advanced_preference, advancefrom, advancement, advances, affect_adjacent, ai, allied_with, allow_end_turn, allow_extra_recruit, allow_recruit, allow_undo, and, animate, animate_unit, animation, aspect, attack (replay, weapon), attack_anim, attacks (special, stats), avoid;

B:

base_unit, background_layer, berserk, binary_path, break, brush;

C:

campaign, cancel_action, candidate_action, capture_village, case, chance_to_hit, change_theme, chat, checkbox, choice, choose, clear_global_variable, clear_menu_item, clear_variable, color_adjust, color_palette, color_range, command (action, replay), continue, credits_group, criteria;

D:

damage, death, deaths, default, defend, defends, defense, delay, deprecated_message, destination, difficulty, disable, disallow_end_turn, disallow_extra_recruit, disallow_recruit, do, do_command, drains, draw_weapon_anim;

E:

editor_group, editor_music, editor_times, effect, else (action, animation), elseif, endlevel, end_turn (action, replay), enemy_of, engine, entry (credits, options), era, event, experimental_filter_ability, experimental_filter_ability_active, experimental_filter_specials, extra_anim;

F:

facet, facing, fake_unit, false, feedback, female, filter (concept, event), filter_adjacent, filter_adjacent_location, filter_attack, filter_attacker, filter_base_value, filter_condition, filter_defender, filter_enemy, filter_location, filter_opponent, filter_own, filter_owner, filter_radius, filter_recall, filter_second, filter_second_attack, filter_self, filter_side, filter_student, filter_vision, filter_weapon, filter_wml, find_path, fire_event, firststrike, floating_text, found_item, for, foreach, frame;

G:

game_config, get_global_variable, goal, gold, gold_carryover;

H:

harm_unit, has_ally, has_attack, has_unit, has_achievement, have_location, have_unit, heal_on_hit, heal_unit, healed_anim, healing_anim, heals, hide_help, hide_unit, hides;

I:

idle_anim, if (action, animation, intro), illuminates, image (intro, terrain), init_side, insert_tag, inspect, item, item_group;

J:

jamming_costs, join;

K:

kill, killed;

L:

label, language, leader, leader_goal, leadership, leading_anim, levelin_anim, levelout_anim, lift_fog, limit, literal, load_resource, locale, lock_view, lua;

M:

male, menu_item, message, micro_ai, missile_frame, modification, modifications, modify_ai, modify_side, modify_turns, modify_unit, modify_unit_type, move, move_unit, move_unit_fake, move_units_fake, movement_anim, movement costs, movetype, multiplayer, multiplayer_side, music;

N:

not, note;

O:

object, objective, objectives, on_undo, open_help, option, options, or;

P:

part, petrifies, petrify, place_shroud, plague, poison, post_movement_anim, pre_movement_anim, primary_attack, primary_unit, print, progress_achievement, put_to_recall_list;

R:

race, random_placement, recall (action, replay), recalls, recruit, recruit_anim, recruiting_anim, recruits, redraw, regenerate, remove_event, remove_item, remove_object, remove_shroud, remove_sound_source, remove_time_area, remove_trait, remove_unit_overlay, repeat, replace_map, replace_schedule, replay, replay_start, reset_fog, resistance (ability, unit), resistance_defaults, resource, return, role, rule;

S:

save, scenario, screen_fade, scroll, scroll_to, scroll_to_unit, secondary_attack, secondary_unit, section, select_unit, sequence, set_achievement, set_extra_recruit, set_global_variable, set_menu_item, set_recruit, set_specials, set_variable, set_variables, sheath_weapon_anim, show_if (message, objective, set_menu_item), show_objectives, side, skirmisher, slider, slow, snapshot, sound, sound_source, source (replay, teleport), special_note, specials, split, stage, standing_anim, statistics, status, store_gold, store_items, store_locations, store_map_dimensions, store_reachable_locations, store_relative_direction, store_side, store_starting_location, store_time_of_day, store_turns, store_unit, store_unit_defense, store_unit_defense_on, store_unit_type, store_unit_type_ids, store_villages, story, swarm, sub_achievement, switch, sync_variable;

T:

target, team, teleport (ability, action), teleport_anim, terrain, terrain_defaults, terrain_graphics, terrain_mask, terrain_type, test, test_condition, test_do_attack_by_id, text_input, textdomain, theme, then, tile, time, time_area, topic, toplevel, trait, transform_unit, traveler, true, tunnel;

U:

unhide_unit, unit, unit_overlay, unit_type, unit_worth, units, unlock_view, unpetrify, unstore_unit, unsynced;

V:

value, variable, variables, variant, variation, victory_anim, village, vision_costs, volume;

W:

while, wml_message, wml_schema;

Z:

zoom;

The [game_config] tag

This tag is a top level WML tag which can only be used once because it defines basic settings that are used everywhere in the game. In official versions of Wesnoth it is in game_config.cfg; values used there are labeled 'standard'.


The following keys are recognised

  • base_income: (standard 2) how much your leader earns without any villages
  • village_income: (standard 1) how much your leader earns for each village you control
  • poison_amount: (standard 8) the amount of damage poison deals to a unit
  • rest_heal_amount: (standard 2) how much HP a unit gains each turn it rests
  • recall_cost: (standard 20) how much it costs to recall a unit; this cost is independent of level.
  • kill_experience: (standard 8) killing a unit with level=X will give X*kill_experience experience to the killing unit. However, if a unit has level=0, it will still give half of X experience.
  • icon: (standard 'wesnoth-icon.png') the game icon file
  • title: (standard 'misc/title.png') the title screen image
  • logo: (standard 'misc/logo.png') the wesnoth logo which will be put over the title image
  • default_defeat_music: (standard 'defeat.ogg,defeat2.ogg') default list of music tracks that are chosen to play on player's defeat; this can be overriden per-scenario
  • default_victory_music: (standard 'victory.ogg,victory2.ogg') default list of music tracks that are chosen to play on player's victory; this can be overriden per-scenario
  • title_music: (standard 'main_menu.ogg') the music to play at the title screen
  • logo_x: (standard 292) the x position of the logo on the title screen
  • logo_y: (standard 120) the y position of the logo on the title screen
  • buttons_x: (standard 760) the x position of the buttons on the title screen
  • buttons_y: (standard 330) the y position of the buttons on the title screen
  • buttons_padding: (standard 20) space between buttons, and border in main menu
  • tip_x: (standard 100) space between the button panel left edge and the tip-of-the-day panel right edge
  • tip_y: (standard 500) not used (the bottom right corner of the tip-of-the-day panel is pegged to align with the bottom of the button panel)
  • tip_width: (standard 495) max width in pixels of the tip-of-the-day panel. The width will actually adjust to be the smallest size necessary to fit the text. Once the max width is reached, if text must flow onto multiple lines, then the height will also automatically adjust.
  • tip_padding: (standard 20) space between the edge of the tip-of-the-day panel and an imaginary bounding box containing the text inside the panel
  • map_image: (standard 'maps/wesnoth.png') the background image for the "About" screen
  • sidebar_image: (standard 'misc/rightside.png') border of window when displaying unit statistics
  • sidebar_image_bottom: (standard 'misc/rightside-bottom.png') border of image when displaying unit statistics
  • energy_image: (standard 'misc/bar-energy.png') the images used to display hp/xp bars.
  • moved_ball_image: (standard 'misc/ball-moved.png') the orb image to add on top of the hp bar for player's moved units; see 'Orbs', WesnothManual
  • unmoved_ball_image: (standard 'misc/ball-unmoved.png') like moved_ball_image, but for player's unmoved units
  • partmoved_ball_image: (standard 'misc/ball-partmoved.png') like moved_energy_image, but for player's partially moved units
  • flag_image: (standard 'image/flag'terrain/flag-1.png:150,terrain/flag-2.png:150,terrain/flag-3.png:150,terrain/flag-4.png:150') the default flag animation to mark captured villages (if no custom flag is defined in the [side] tag). By example, this animation has 4 frames of 150ms each. An automatic side-coloring is applied.
  • flag_icon_image: (standard 'flags/flag-icon.png') the default flag icon to indicate the side playing in the statusbar (if no custom flag_icon is defined in the [side] tag). An automatic side-coloring is applied.
  • hp_bar_scaling : (standard '0.6') The ratio of hitpoints to height used for displaying the hp bar. Can be overwritten in [unit] and [unit_type].
  • xp_bar_scaling : (standard '0.5') The ratio of xp to height used for displaying the xp bar. Can be overwritten in [unit] and [unit_type].
  • cross_image: (standard 'misc/cross.png') the cross image displayed on the map at start of scenarios; see IntroWML
  • dot_image: (standard 'misc/dot.png') the dot image used to draw a path on the map before scenarios
  • footprint_left_nw, footprint_left_n, footprint_right_nw, footprint_right_n: images used to display the path that a unit would take to the tile the cursor is on.

The first image of each key is used for tiles which would take only 1 movement point for the selected unit to move onto; the second for ones which would take more. The 'n' and 'nw' designations distinguish between tiles which are moved from orthogonally and diagonally in the same way as described in [missile_frame], AnimationWML. The 'left' and 'right' designations are used alternately throughout the path; however, the standard values are the same for 'left' and 'right'.

  • terrain_mask_image: (standard 'terrain/alphamask.png') used to give a hex-shape from a rectangular image.
  • grid_image: (standard 'terrain/grid.png') the image used by the grid option
  • unreachable_image: (standard 'terrain/darken.png') the stripes mask used to show unreachable locations
  • missile_n_image: (standard 'projectiles/missile-n.png') orthogonal missile image to use if none is specified; see image, [missile_frame], AnimationWML
  • missile_ne_image: (standard 'projectiles/missile-ne.png') diagonal missile image to use if none is specified; see image_diagonal, [missile_frame], AnimationWML
  • observer_image: (standard 'misc/eye.png') the image to use for observer in multi-player games. (The eye in the upper right hand corner.)
  • download_campaign_image: (standard no image) the icon for the "Download more Campaigns" campaign menu option.
  • zoom_levels: (Version 1.13.8 and later only) A comma-separated list of valid zoom levels, with 1.0 representing 100%.

Color Palettes

Color palettes are defined by two tags within [game_config].

  • [color_palette]: Contains the definitions of source palettes, such as magenta. Each key defines a palette, and must be set to a comma-separated list of hexadecimal colors.
  • [color_range]: Defines a target color palette.
    • id: Used to reference the palette, for example from [side] or ~RC().
    • name: A translatable name for the color. This may be ignored for non-core colors?
    • rgb: A comma-separated sequence of four hexadecimal colors:
      1. the average shade of a unit's team-color portions
      2. the maximum highlight shade of a unit's team-color portions
      3. the minimum shadow shade of a unit's team-color portions
      4. the color of the markers on the mini-map.

See Also