Difference between revisions of "EditingWesnoth"

From The Battle for Wesnoth Wiki
(Game and User Directories)
Line 2: Line 2:
 
<!-- single enters on this page are intentional -->
 
<!-- single enters on this page are intentional -->
  
== Game and User Directories ==
+
In order to create custom content for Wesnoth, you need to know where the game's resources are and where to put your own. This page will explain how to find both the <b>data</b> (core game resources) and <b>userdata</b> (custom content) directories, as well as an explanation as to working with each one.
  
Wherever you install the game, there will be a game data directory that contains, of course, the game's data.  This directory should have the following subdirectories: data, music, sounds, and images.  There are several others, but these are the important ones. In this wiki, the terms "game data", wesnoth/data,  or ./data refers to the wesnoth/data directory. You normally should not modify these files, but you can if you want to modify a unit or something.
+
== The game data directory ==
  
The user data directory holds your preferences file, custom maps, saved games, the WML cache and data files corresponding to user-created content. In this wiki, "user data" and ''userdata''/ refer to this directory.
+
The data directory will be wherever you installed the game, alongside there subdirectories: <i>music, sounds, images</i>. There are several others, but these are the important ones. You don't need to pay attention to them right now.
  
The paths to the game data and user data directories vary according to the operating system and packager.  
+
Inside the <i>data</i> folder you will find a folder called <i>core</i>. This folder contains another set of <i>music, sounds, images</i> (as well as others) folders. These contain all the resources shipped with the game for use in mainline and UMC campaigns. These are the ones you'll usually look for resources in when designing your content.
  
=== Where is my '''game''' data directory? ===
+
In this wiki, the terms <i>"game data"</i>, <i>wesnoth/data</i>,  or <i>./data</i> refer to the wesnoth/data directory. The terms <i>"core folder"</i> or <i>core</i> refer to the wesnoth/data/core director.
 +
 
 +
The major directories you need to know about are wesnoth/data, wesnoth/data/core/units, wesnoth/data/campaigns, wesnoth/data/multiplayer, wesnoth/images and wesnoth/data/core/images
 +
 
 +
Become familiar with what is in wesnoth/data/campaigns and wesnoth/data/multiplayer/scenarios.  These have the officially distributed campaigns and multiplayer maps. If you ever want to examine or edit one of the scenario configuration files, this is where you would go.
 +
 
 +
Two very important directories are ./data/core/units/ and ./images.  You have the ability to drop new units or images in these directories and have the game recognize them.  When specifying an image for something, you do so relative to ./images.
 +
 
 +
=== How to get there ===
  
 
====Windows====
 
====Windows====
Line 39: Line 47:
 
The command <code>wesnoth --path</code> also works.
 
The command <code>wesnoth --path</code> also works.
  
=== Where is my '''user''' data directory? ===
+
== The user data directory ==
 +
 
 +
The user data directory in particular is the most important to a content creator. Inside are your preferences file, custom maps, saved games, the WML cache and data files corresponding to user-created content. In this wiki, <i>"user data"</i> and <i>userdata/</i> refer to this directory.
 +
 
 +
The user data directory can do a lot of things.  The game looks here for several things:
 +
* ''userdata''/data/add-ons - campaign configuration files and subdirectories
 +
* ''userdata''/editor/maps - multiplayer standalone maps (map data only)
 +
 
 +
The ''userdata''/data/add-ons directory is particularly useful.  A single configuration file here can selectively point to an entire subdirectory tree of units, images, sounds, scenarios, and macros.  This allows you to wall off parts. Content included in the userdata units or images directories will be available globally whether you want it or not.
 +
 
 +
For example, assume you have a campaign called MyCampaign.  This is what the ''userdata''/data/add-ons directory might look like:
 +
* ''userdata''/data/add-ons/MyCampaign/ - your campaign's directory
 +
* ''userdata''/data/add-ons/MyCampaign/_main.cfg - a text file containing your instructions for the game about how to load the campaign
 +
* ''userdata''/data/add-ons/MyCampaign/scenarios
 +
* ''userdata''/data/add-ons/MyCampaign/units
 +
* ''userdata''/data/add-ons/MyCampaign/images
 +
* ''userdata''/data/add-ons/MyCampaign/music
 +
* ''userdata''/data/add-ons/MyCampaign/sounds
 +
* ''userdata''/data/add-ons/MyCampaign/macros
 +
 
 +
=== How to get there ===
  
 
====Windows====
 
====Windows====
Line 69: Line 97:
 
====BSD====
 
====BSD====
 
* Same place as Linux.
 
* Same place as Linux.
 
== Game Data ==
 
 
The major directories you need to know about are wesnoth/data, wesnoth/data/core/units, wesnoth/data/campaigns, wesnoth/data/multiplayer, wesnoth/images and wesnoth/data/core/images
 
 
Become familiar with what is in ./data/campaigns and ./data/multiplayer/scenarios.  These have the officially distributed campaigns and multiplayer maps.  If you ever want to examine or edit one of the scenario configuration files, this is where you would go.  For example, a common question is how a new player can give himself more turns or gold in scenario X.  This is where you would go to do that.
 
 
Two very important directories are ./data/core/units/ and ./images.  You have the ability to drop new units or images in these directories and have the game recognize them.  When specifying an image for something, you do so relative to ./images.
 
 
== User Data ==
 
 
The user data directory can do a lot of things.  The game looks here for several things:
 
* ''userdata''/data/add-ons - campaign configuration files and subdirectories
 
* ''userdata''/editor/maps - multiplayer standalone maps (map data only)
 
 
The ''userdata''/data/add-ons directory is particularly useful.  A single configuration file here can selectively point to an entire subdirectory tree of units, images, sounds, scenarios, and macros.  This allows you to wall off parts. Content included in the userdata units or images directories will be available globally whether you want it or not.
 
 
For example, assume you have a campaign called MyCampaign.  This is what the ''userdata''/data/add-ons directory might look like:
 
* ''userdata''/data/add-ons/MyCampaign/ - your campaign's directory
 
* ''userdata''/data/add-ons/MyCampaign/_main.cfg - a text file containing your instructions for the game about how to load the campaign
 
* ''userdata''/data/add-ons/MyCampaign/scenarios
 
* ''userdata''/data/add-ons/MyCampaign/units
 
* ''userdata''/data/add-ons/MyCampaign/images
 
* ''userdata''/data/add-ons/MyCampaign/music
 
* ''userdata''/data/add-ons/MyCampaign/sounds
 
* ''userdata''/data/add-ons/MyCampaign/macros
 
  
 
== See Also ==
 
== See Also ==

Revision as of 14:07, 26 February 2014

Template:EditingWesnoth/Translations

In order to create custom content for Wesnoth, you need to know where the game's resources are and where to put your own. This page will explain how to find both the data (core game resources) and userdata (custom content) directories, as well as an explanation as to working with each one.

The game data directory

The data directory will be wherever you installed the game, alongside there subdirectories: music, sounds, images. There are several others, but these are the important ones. You don't need to pay attention to them right now.

Inside the data folder you will find a folder called core. This folder contains another set of music, sounds, images (as well as others) folders. These contain all the resources shipped with the game for use in mainline and UMC campaigns. These are the ones you'll usually look for resources in when designing your content.

In this wiki, the terms "game data", wesnoth/data, or ./data refer to the wesnoth/data directory. The terms "core folder" or core refer to the wesnoth/data/core director.

The major directories you need to know about are wesnoth/data, wesnoth/data/core/units, wesnoth/data/campaigns, wesnoth/data/multiplayer, wesnoth/images and wesnoth/data/core/images

Become familiar with what is in wesnoth/data/campaigns and wesnoth/data/multiplayer/scenarios. These have the officially distributed campaigns and multiplayer maps. If you ever want to examine or edit one of the scenario configuration files, this is where you would go.

Two very important directories are ./data/core/units/ and ./images. You have the ability to drop new units or images in these directories and have the game recognize them. When specifying an image for something, you do so relative to ./images.

How to get there

Windows

  • X:\Program Files\Battle for Wesnoth <version>\data, where X: corresponds to the drive where Windows is installed (normally C:).
  • On 64-bit computers, it will be in X:\Program Files (x86)\Battle for Wesnoth <version>\data.
  • The path may be different if you originally chose to install the game in a different location. In such case, look for the data folder in the folder where you installed the game.

Mac OS X

  • SourceForge.net bundle or XCode builds: Control+click on the application icon. Select "Show Package Contents." Select "Contents", then "Resources".
  • Custom builds: /usr/local/share/wesnoth

Linux

  • Custom builds: /usr/local/share/wesnoth
  • Debian/Ubuntu packages, or emerge (Gentoo): /usr/share/games/wesnoth
  • Red Hat Linux-based distributions in general (openSUSE, Fedora): /usr/share/wesnoth
  • Mandriva: /usr/share/games/wesnoth
  • Slackware Linux: /usr/local/share/wesnoth

In a terminal, the command wesnoth --path shows the game data directory.

BSD

  • OpenBSD package: /usr/local/share/wesnoth

The command wesnoth --path also works.

The user data directory

The user data directory in particular is the most important to a content creator. Inside are your preferences file, custom maps, saved games, the WML cache and data files corresponding to user-created content. In this wiki, "user data" and userdata/ refer to this directory.

The user data directory can do a lot of things. The game looks here for several things:

  • userdata/data/add-ons - campaign configuration files and subdirectories
  • userdata/editor/maps - multiplayer standalone maps (map data only)

The userdata/data/add-ons directory is particularly useful. A single configuration file here can selectively point to an entire subdirectory tree of units, images, sounds, scenarios, and macros. This allows you to wall off parts. Content included in the userdata units or images directories will be available globally whether you want it or not.

For example, assume you have a campaign called MyCampaign. This is what the userdata/data/add-ons directory might look like:

  • userdata/data/add-ons/MyCampaign/ - your campaign's directory
  • userdata/data/add-ons/MyCampaign/_main.cfg - a text file containing your instructions for the game about how to load the campaign
  • userdata/data/add-ons/MyCampaign/scenarios
  • userdata/data/add-ons/MyCampaign/units
  • userdata/data/add-ons/MyCampaign/images
  • userdata/data/add-ons/MyCampaign/music
  • userdata/data/add-ons/MyCampaign/sounds
  • userdata/data/add-ons/MyCampaign/macros

How to get there

Windows

  • BfW 1.8 and later, if you did not choose "Store userdata in the install location" when installing the game and you launch the game using the start menu shortcut:
    • Windows 2000/XP: My Documents\My Games\Wesnoth1.8
    • Windows Vista/7/8: Documents\My Games\Wesnoth1.8
  • If any of the above does not apply:
    • The userdata subdirectory of the install location (usually C:\Program Files\Battle for Wesnoth <version>\userdata).
    • Note (Windows Vista/7): Writes to this directory may be silently redirected to the "Virtual Store", typically C:\Users\<yourname>\AppData\Local\VirtualStore\Program Files\Battle for Wesnoth <version>

Note: If you don't remember where you installed the game, right click on the game's shortcut, open properties, and click on the "Find target" button.

Note: To find the Virtual Store using Windows Explorer, you need to make hidden files visible. This can be done from Explorer's "Folder Options" menu option -> "View" tab -> "Show hidden files, folders, and drives". Alternatively, the hidden directory can be accessed by typing "shell:local appdata" in Explorer's address bar.

Mac OS X

  • SourceForge.net bundle: ~/Library/Application Support/Wesnoth_1.x/ (1.8 and later), or ~/Library/Preferences/Wesnoth (older versions). As of OS X 10.7, this location is hidden by default. Push "alt" (⌥) and use "Go" to access the Library then find ~/Library/Application Support/Wesnoth_1.x/
  • Custom builds: same as Linux - see below for details.

Linux

  • Wesnoth 1.10: ~/.local/share/wesnoth/1.10
  • Wesnoth 1.9: ~/.local/share/wesnoth/1.9
  • Wesnoth 1.8: ~/.wesnoth1.8
  • Older versions: ~/.wesnoth

In a terminal, the command wesnoth --config-path shows the user data directory.

BSD

  • Same place as Linux.

See Also