Difference between revisions of "EditingWesnoth"

From The Battle for Wesnoth Wiki
(User Data: campaigns -> add-ons)
(Updated a lot of stuff, hopefully cleaner and correct this time)
Line 3: Line 3:
 
== Game and User Directories ==
 
== Game and User Directories ==
  
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 do not need to modify these files, but you can if you want to modify a unit or something.
+
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 user data directory allows you to add custom content without modifying the game's own files.  Each OS puts its user data directory in a different place. In this wiki, "user data", ''userdata''/''subdirectory'', or (occasionally) ~wesnoth/ refer to this 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 dir.
 +
 
 +
The paths to the game data and user data dirs vary according to the operating system and packager.  
  
 
=== Where is my '''game''' data directory? ===
 
=== Where is my '''game''' data directory? ===
  
 
====Windows====
 
====Windows====
Usually <I>C:\Program Files\Wesnoth\data</I> but it will be different if you installed the game in a different location: look for the data folder in the folder where you installed the game.
+
 
 +
* ''X:\Program Files\Wesnoth <version>\data'', where X: corresponds to the drive where Windows is installed (normally C:).
 +
* 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====
 
====Mac OS X====
Downloaded from sourceforge: control-click on the application icon.  Select "Show Package Contents."  Select "Contents" then "Resources.
 
  
If you did not download from sourceforge what do you do?
+
* SourceForge.net bundle: Control+click on the application icon.  Select "Show Package Contents."  Select "Contents", then "Resources".
 +
* Custom builds: ''/usr/local/share/wesnoth''
  
Command line build: /usr/local/share/wesnoth
+
====Linux====
  
====Linux====
+
* Custom builds: ''/usr/local/share/wesnoth''
/usr/local/share/wesnoth <br>
+
* Debian/Ubuntu packages, or emerge (Gentoo): ''/usr/share/games/wesnoth''
From apt-get (Debian and Ubuntu) or emerge (Gentoo): /usr/share/games/wesnoth <br>
+
* Red Hat Linux-based distributions in general (openSUSE, Fedora): ''/usr/share/wesnoth''
SUSE 10.0 (pre-installed): /usr/share/wesnoth<br>
+
* Mandriva: ''/usr/share/games/wesnoth''
Fedora 5 (Installed from yum repository RPM): /usr/share/wesnoth<br>
+
* Slackware Linux: ''/usr/local/share/wesnoth''
Mandriva 2006.0: /usr/share/games/wesnoth<br>
+
* Alternatively, you can try the command <code>find / -name '*wesnoth*'</code> (as yourself, not as superuser) if you are using a different distribution or the locations mentioned above don't exist.
Slackware 12 (Installed from .tgz package at LinuxPackages.net): /usr/local/share/wesnoth<br>
 
If you don't find it, or if you use another distribution, try <code>find / -iname '*wesnoth*'</code>. (as yourself, not as superuser)
 
  
 
=== Where is my '''user''' data directory? ===
 
=== Where is my '''user''' data directory? ===
  
 
====Windows====
 
====Windows====
'''Before version 1.8:'''
 
<br>
 
* <I>Program Files\Wesnoth\userdata</I>
 
  
'''Version 1.8 and newer:'''
+
* Windows 2000/XP (1.8 and later): ''My Documents\My Games\Wesnoth1.8''
<br>
+
* Windows Vista/7 (1.8 and later): ''Documents\My Games\Wesnoth1.8''
* in Windows XP: <I>MyDocuments\My Games\Wesnoth1.8</I>
+
* General (before 1.8): ''X:\Program Files\Wesnoth <version>\userdata'', where X: corresponds to the drive where Windows is installed (normally C:).
* in Vista: <I>Documents\My Games\Wesnoth1.8</I> or <I>UserName\Documents\AppData\Local\VirtualStore</I> (which may be a hidden folder)
 
  
 
''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, then search for the "data" folder.''
 
''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, then search for the "data" folder.''
  
 
====Mac OS X====
 
====Mac OS X====
Downloaded from sourceforge: <br>
+
 
*Wesnoth 1.7.x and 1.8.x: ~/Library/Application Support/Wesnoth_1.x/ <br>
+
* SourceForge.net bundle: ''~/Library/Application Support/Wesnoth_1.x/'' (1.8 and later), or ''~/Library/Preferences/Wesnoth'' (older versions).
*Earlier versions: ~/Library/Preferences/Wesnoth <br>
+
* Custom builds: same as Linux - see below for details.
Command line build: <br>
 
*~/.wesnoth (same as Linux; see below for details)
 
  
 
====Linux====
 
====Linux====
~/.wesnoth <br>
+
 
For newer wesnoth versions it can also be ~/.wesnoth<version>. I.e. ~/.wesnoth1.6 <br>
+
* Wesnoth 1.8 and later: ''~/.wesnoth<version>'' (e.g. ''~/.wesnoth1.8'')
If unsure you can check stdout of wesnoth (run from a terminal) on startup where the used directory is mentioned.
+
* Older versions: ''~/.wesnoth''.
 +
* It's also possible to check the beginning of Wesnoth's stderr output in a terminal emulator to see the path Wesnoth uses to access its configuration.
  
 
== Game data ==
 
== Game data ==
Line 62: Line 59:
 
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.
 
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 ==
+
== User data ==
 +
 
 
The user data directory can do a lot of things.  The game looks here for several things:
 
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''/data/add-ons - campaign configuration files and subdirectories
 
* ''userdata''/editor/maps - multiplayer standalone maps (map data only)
 
* ''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.
+
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:
 
For example, assume you have a campaign called MyCampaign.  This is what the ''userdata''/data/add-ons directory might look like:
Line 78: Line 76:
 
** ''userdata''/data/add-ons/MyCampaign/sounds
 
** ''userdata''/data/add-ons/MyCampaign/sounds
 
** ''userdata''/data/add-ons/MyCampaign/utils
 
** ''userdata''/data/add-ons/MyCampaign/utils
 
{{DevFeature}} Note that before 1.7.0, there was ''campaigns'' instead of ''add-ons'' in these paths.
 
  
 
== See Also ==
 
== See Also ==

Revision as of 05:49, 17 October 2010


Game and User Directories

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 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 dir.

The paths to the game data and user data dirs vary according to the operating system and packager.

Where is my game data directory?

Windows

  • X:\Program Files\Wesnoth <version>\data, where X: corresponds to the drive where Windows is installed (normally C:).
  • 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: 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
  • Alternatively, you can try the command find / -name '*wesnoth*' (as yourself, not as superuser) if you are using a different distribution or the locations mentioned above don't exist.

Where is my user data directory?

Windows

  • Windows 2000/XP (1.8 and later): My Documents\My Games\Wesnoth1.8
  • Windows Vista/7 (1.8 and later): Documents\My Games\Wesnoth1.8
  • General (before 1.8): X:\Program Files\Wesnoth <version>\userdata, where X: corresponds to the drive where Windows is installed (normally C:).

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, then search for the "data" folder.

Mac OS X

  • SourceForge.net bundle: ~/Library/Application Support/Wesnoth_1.x/ (1.8 and later), or ~/Library/Preferences/Wesnoth (older versions).
  • Custom builds: same as Linux - see below for details.

Linux

  • Wesnoth 1.8 and later: ~/.wesnoth<version> (e.g. ~/.wesnoth1.8)
  • Older versions: ~/.wesnoth.
  • It's also possible to check the beginning of Wesnoth's stderr output in a terminal emulator to see the path Wesnoth uses to access its configuration.

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/utils

See Also