Difference between revisions of "WML for Complete Beginners: Chapter 6"

From The Battle for Wesnoth Wiki
(Including the Custom Unit In Your Campaign)
(Chapter 6: Building and Including a Custom Unit)
Line 3: Line 3:
 
Sometimes campaign authors only use mainline units in their campaigns. Other times, however, they may want to include a custom unit that isn't found in default Wesnoth. Thankfully, including a custom unit is quite easy.
 
Sometimes campaign authors only use mainline units in their campaigns. Other times, however, they may want to include a custom unit that isn't found in default Wesnoth. Thankfully, including a custom unit is quite easy.
  
===Creating Your Custom Unit's .cfg File===
+
===Creating your Custom Unit's .cfg File===
  
===Including the Custom Unit In Your Campaign===
+
Add the custom units .cfg file to my_first_campaign/units
 +
 
 +
Example of a .cfg file:
 +
 
 +
 
 +
 
 +
===Creating your Custom Unit's Images===
 +
 
 +
Add the images to my_first_campaign/units
 +
 
 +
===Including the Custom Unit in your Campaign===
 +
 
 +
[+units]
 +
    {~add-ons/my_first_campaign/units}
 +
[/units]
 +
 
 +
===Useful Links for adding your own Custom Units===
 +
 
 +
 
 +
Editing your Custom Units .cfg file:
 +
http://wiki.wesnoth.org/UnitTypeWML
  
 
Next Chapter:
 
Next Chapter:

Revision as of 19:47, 10 November 2015

Chapter 6: Building and Including a Custom Unit

Sometimes campaign authors only use mainline units in their campaigns. Other times, however, they may want to include a custom unit that isn't found in default Wesnoth. Thankfully, including a custom unit is quite easy.

Creating your Custom Unit's .cfg File

Add the custom units .cfg file to my_first_campaign/units

Example of a .cfg file:


Creating your Custom Unit's Images

Add the images to my_first_campaign/units

Including the Custom Unit in your Campaign

[+units]

   {~add-ons/my_first_campaign/units}

[/units]

Useful Links for adding your own Custom Units

Editing your Custom Units .cfg file: http://wiki.wesnoth.org/UnitTypeWML

Next Chapter: WML for Complete Beginners: Chapter 7

Previous Chapter: WML for Complete Beginners: Chapter 5

Return to Main Index: WML for Complete Beginners