Default Folder

From Unofficial Homecoming Wiki
Revision as of 22:52, 16 August 2022 by BlackSpectre (talk | contribs)
Jump to navigation Jump to search

Default Folder

The Default Folder (otherwise known as the default directory, working folder, or relative path folder) is the place where the default files for several important settings are stored; such as key bind settings, window settings, chat settings, and options settings. The corresponding file names for these settings are keybinds.txt, wdw.txt, chat.txt, and options.txt.

Other than holding important settings files, the Default Folder is important because it allows us to use a relative path while saving any of the settings files above. This can save us a lot of space in binds and macros (which are limited to 255 characters), and also just make it easier by typing less for the relative file path rather than more for the absolute file path.

For example:

  • Absolute Path – C:\Games\Homecoming\settings\live\keybinds.txt
  • Relative Path – keybinds.txt

The file will automatically be saved in the Default Folder if an absolute path is not specified. This allows us to merely type in the file name and the game will automatically save it in the C:\Games\Homecoming\settings\live folder, for example.

The location of the Default Folder can vary depending on the game version, how the game was installed, and the game launcher. So far, there have been 3 locations for the Default Folder: 

  • <COHInstallFolder>
  • <COHInstallFolder>\data
  • <COHInstallFolder>\settings\live

The location for the Default Folder in the current game (Issue 27, page 3 – 27.3.4798) is <COHInstallFolder>\settings\live. However, one of the previous locations for the Default Folder may still be in use on your City of Heroes installation.

Due to limitations of the CoH/V command line parser, the path must be enclosed in quotes if it contains spaces. For example, "C:\coh binds\bindfile.txt" would be a valid file path, while C:\coh binds\bindfile.txt would not.

A forward slash (/) or back slash (\) is used in the path depending on the operating system of your computer. For Windows a back slash (\) is used, whereas on Unix based systems such as MacOS and Linux a forward slash (/) is used.

For example:

  • Windows - <COHInstallFolder>\settings\live
  • MacOS - <COHInstallFolder>/settings/live


TIP: If you are having trouble finding the location of your default directory, login to the game and in the chat box type: /bind_load_file \ Press Enter/Return. The location of your default directory will be shown in the Global chat window as part of an error message. This will also point you in the general direction of your <COHInstallFolder> as well.


More About File Paths

Computer files are stored within a hierarchal structure of directories/folders. The Root folder (sometimes also called the root directory or simply root) is the topmost level of the system drive on a computer. In Windows, the file structure starts with the root folder, typically the C:\ drive, and branches out from there. On a Mac, the root folder is simply “/” and typically labeled Macintosh HD.

A unique location of every file is defined by referring to the root folder and the subsequent, subordinate folders between the root and a file. This is called a file path, but more specifically in this case, an absolute file path. Absolute because everything starts at the root folder, absolutely.

For example,

  • C:\Games\Homecoming\settings\live\keybinds.txt

The path for keybinds.txt in the example above starts at the C:\ root folder, then runs through the Games folder, then through the Homecoming folder, then the settings folder, and finally through the live folder. The file name is also part of the file’s location. You can have multiple files with the same name spread throughout your folder structure, but not multiple files with the same name in the same folder.

A relative path, on the other hand, specifies a unique file location starting from the current folder you are working from, not the root folder. This “working folder” is the folder a command or tool assumes is the starting place for all the paths that you construct with that tool. Another name for this special folder is the Default Folder, at least as it concerns the 4 settings files mentioned at the beginning of this article and their respective slash commands (/bind_save_file, /wdw_save_file, /chat_save_file, and /option_save_file).

Previously, City of Heroes used a Unix shortcut of a single dot (or period) to specify the default folder. So our relative file paths looked something like this: .\keybinds.txt. However now nothing is needed. The game simply assumes you’re starting in the Default Folder when you use one of the settings commands. So our relative file path now looks like this: keybinds.txt.

When you use the Default Folder in your path, the game silently fills in the missing part of the absolute file path automatically so you don’t have to. You are free to create as many new sub-folders (to the right) as you like, as long as your starting point is the Default Folder. For example:

\binds\TankBinds\TheDwarf\ThorinBinds.txt

The absolute path for the above would look like this:

C:\Games\Homecoming\settings\live\binds\TankBinds\TheDwarf\ThorinBinds.txt

In this case the Default Folder is the live folder. Notice we don’t even mention it in the relative file path (not to mention all of the parent folders going up to the root).

The Default Folder mentioned here is actually not the only “default folder” in the game. There is at least one other...

When the slash command /build_save_file is used, its default folder is <COHInstallDirectory>\accounts\<AccountName>\Builds. Relative file paths can also be used with this command to save a character build file, but in this case the default folder is the Builds folder.

Lastly, in older versions of various operating systems the character length of file names and folders was an issue. No more than 8 characters in the file name and no more than 3 characters in the file extension (the characters after the dot) were allowed. For example, "filename.txt". Also spaces and other special characters were not allowed. Long files names required a special formatting for the operating system to comply with 8.3 naming rules. Some used a tilde (~) within each component of the name that was too long in order to create an 8.3 alias or short name. Using the Default Folder cut out a lot of these problems by side-stepping the need to use an absolute path that might contain long folder and file names. Most operating systems these days, however, support long file names so this is not much of an issue.