BuildingCampaignsDirectoryStructure

From Wesnoth

Wesnoth will only recognize a campaign as such if it is placed in a certain location and has a certain structure.

Contents

A Certain Location

For the game to recognize them, campaigns must be placed in one of two places: the Wesnoth path, or the Wesnoth user path. The exact location of each varies from platform to platform.

Mac OS X

  • To build a campaign in the Wesnoth path you must right click on the Wesnoth application and choose "Show Package Contents". Then you must open /Contents/Resources/Data/Campaigns/ This is not the preferred place to install campaigns in Mac OS X, and they may not appear when attempting to publish them to the campaign server.
  • To build a campaign in the Wesnoth user path you must place it in ~/Library/Preferences/Wesnoth/Data/Campaigns/ This is the preferred place to locate a Wesnoth campaign on OS X

Linux

  • To build a campaign in the Wesnoth path you must place it in /usr/local/share/wesnoth (if this does not work, try running Wesnoth --path to determine the Wesnoth path on your particular machine)
  • To build a campaign in the Wesnoth user path you must place it in ~/.wesnoth/data/campaigns.

Windows

  • To build a campaign in the Wesnoth path you must place it in to Wesnoth/userdata/data/campaigns/ (C:/Program Files/Wesnoth/userdata/data/campaigns if you installed it without changing the location)

A certain structure

The best way to illustrate this is by example. The character "…" represents whatever path you've chosen to place your campaign to. The following is what the directory structure for a campaign names simple_campaign might look like:

    …/simple_campaign/_main.cfg        -- main file of the campaign
    …/simple_campaign/scenarios/       -- directory for campaign scenario files
    …/simple_campaign/maps/            -- directory for of maps
    …/simple_campaign/units/           -- directory for of WML for campaign-specific units
    …/simple_campaign/images/          -- directory for portraits, unit animation sprites, etc
    …/simple_campaign/sounds/          -- directory for sound effects and music, if any
    …/simple_campaign/utils/           -- directory for campaign-specific macros
    …/simple_campaign/_server.pbl      -- PBL file top be used for server uploads

There is an older convention under which the campaign's main file lives at the same level as the campaign directory and is named simple_campaign.cfg. You will see this in older UMC but it is not recommended for newer campaigns; it make life more difficult for wmllint, partially disabling some of its tests. It is also possible to put the campaign's .pbl file at that level, named …/simple_campaign.pbl.

Next:

See Also

This page was last modified 05:04, 2 March 2008.