WmlTemplates

From Wesnoth


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

Scenarios

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

[scenario]
name= _ ""
id=
next_scenario=

{@campaigns/CAMPAIGN_NAME/maps/MAP_NAME}
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=yes
	recruit=
	[/side]
	[side]## Copy for enemies
	side=2
	team_name=enemy

	description=
	type=

	canrecruit=yes
	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

This page was last modified on 23 October 2014, at 17:21.