WML Templates

From The Battle for Wesnoth Wiki
Revision as of 18:24, 30 July 2006 by Prometheus (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

These templates are bases for campaigns, scenarios, and units; fill in the blanks to create one. Knowledge of WML is recommended to use these templates; see ReferenceWML.

Campaigns

Start by find/replacing CAMPAIGN_NAME with the name of your campaign folder.

[campaign]
name= _ ""
id=CAMPAIGN_NAME
define=CAMPAIGN_NAME
first_scenario=
difficulties=EASY,NORMAL,HARD
difficulty_descriptions={MENU_IMG_TXT2 ## 'easy' icon
_"## 'easy' description
" _"(easiest)"} + ";*" + {MENU_IMG_TXT ;*&## 'normal' icon
_"## 'normal' description
"} + ";" + {MENU_IMG_TXT2 ## 'hard' icon
_"## 'hard' description
" _"(hardest)"}
icon=
description= _ ""
image=
[/campaign]
#ifdef CAMPAIGN_NAME
[+units]
	{@campaigns/CAMPAIGN_NAME/units}
[/units]
[binary_path]
path=data/campaigns/CAMPAIGN_NAME
[/binary_path]
{@campaigns/CAMPAIGN_NAME/utils.cfg}
{@campaigns/CAMPAIGN_NAME/scenarios}
#endif

In utils.cfg: (Needs fixing. These changes to utils.cfg are not distributed with the campaign.)

#define MAP MAP_NAME
map_data="{@campaigns/CAMPAIGN_NAME/maps/{MAP_NAME}}"
#enddef
#define DEATHS
[event]## Copy for heroes
name=die
	[filter]
	description=
	[/filter]
	[message]
	description=
	message= _ ""
	[/message]
	[endlevel]
	result=defeat
	[/endlevel]
[/event]
#enddef

Scenarios

Note: this template refers to macros in the template utils.cfg shown above.

[scenario]
name= _ ""
id=
next_scenario=
{MAP }
turns=
	{MORNING}
	{AFTERNOON}
	{DUSK}
	{FIRST_WATCH}
	{SECOND_WATCH}
	{DAWN}
victory_when_enemies_defeated=yes
disallow_recall=no
	[story]
		[part]
		background=
			{DOT }
			{CROSS }
		[/part]
	[/story]
	[side]## Copy for allies
	side=1
	controller=human
	fog=no
	shroud=no
	team_name=good
	
	description=
	type=
	
	canrecruit=1
	recruit=
	[/side]
	[side]## Copy for enemies
	side=2
	team_name=enemy
	description=
	type=
	canrecruit=1
	recruit=
	{GOLD }
	[/side]
	{DEATHS}
	[event]
	name=start
		[recall]
		description=
		[/recall]
		[message]
		description=
		message= _ ""
		[/message]
		[objectives]
		side=1
			[objective]
			description= _ ""
			condition=win
			[/objective]
			[objective]
			description= _ "Death of "
			condition=lose
			[/objective]
			[objective]
			description= _ "Death of "
			condition=lose
			[/objective]
			[objective]
			description= _ "Turns run out"
			condition=lose
			[/objective]
		[/objectives]
	[/event]
	[event]## Copy for events
	name=
		[filter]
		[/filter]
		[message]## Copy for messages
		description=
		message= _ ""
		[/message]
	[/event]
[/scenario]

Units

[unit]
id=
name= _ ""
image=
race=
hitpoints=
movement_type=
movement=
alignment=
ability=null
experience=500
advanceto=null
level=
cost=
usage=## AI usage: values are 'scout', 'fighter', 'archer', 'healer' and 'mixed fighter'
unit_description= _ ""
get_hit_sound=groan.wav
	[attack]
	name= _ ""
	type=
	damage=
	number=
	special=null
		[frame]
		begin=-100
		end=100
		image=
		[/frame]
		[sound]
		time=-200
		sound=
		[/sound]
	[/attack]
	[attack]
	name= _ ""
	type=
	range=long
	damage=
	number=
	special=null
		[sound]
		time=-200
		sound=
		[/sound]
		[missile_frame]
		begin=-100
		end=0
		image=
		image_diagonal=
		[/missile_frame]
	[/attack]
[/unit]

See Also