Local files

Level 5
Joined
Feb 25, 2013
Messages
54

Local Files


What are Local files?

Local files are a way to override game files without changing the original instances, so it is the only safe way to do it across all versions of Warcraft 3.
The first question one could ask if "Why would I want to override the game files?", so I will also outline some interesting and useful things you can do using this mechanism.​


How to enable local files?

On Windows, you will have to make a registry key at location HKEY_CURRENT_USER\SOFTWARE\Blizzard Entertainment\Warcraft III, with type DWORD and name Allow Local Files, and set its value to 1.
An easier way to do this is to open the .reg file attached in a zip archive below this tutorial and accept all popups that get opened because of it.​


How to use local files?

To tell the game to override an internal file with the one you want, you will have to place it in the correct path inside the game root.

Up to patch 1.32.6, the game root was the folder Warcraft III was installed into, also called install directory, for most people the game root would've been C:/Program Files/Warcraft III

Since 1.32.7, the game root is a subfolder located inside the install directory, with the name of _retail_ for the retail flavour of the game and _ptr_ for the ptr flavour. As you are more likely to be playing on the retail flavour of the game, the example of a game root for 1.32.7+ is C:/Program Files/Warcraft III/_retail_


What can you do with local files?

After having wasted 2 minutes on setting local files up and learning where the game root is, you will want to know how you can use this knowledge.

Local files can be used to override any file in the game: models, textures, images, videos, sounds, UI definitions, fonts, object data, and more.

I will give a couple simple examples which will illustrate the power of this very easy to use system:

1) Overriding a model

Let's say I wanted to overwrite the peasant's model with my cool handmade worker model even in melee maps.
I would go into the game root, create the folder structure units/human/peasant, place my model in there, and rename it to peasant.mdx or peasant.mdl depending on what format I had my model saved in (rule of thumb, don't change the text after the last dot in the filename unless you know what it means).
2) Overriding a texture

Suppose you've just found a very cool skin for a hero you love to play (e.g. Illidan), cool enough that you want them to look like that in any map they appear in.
You would go into the game root, create the folder textures, place the skin file in there, in this specific case you wouldn't have to rename it as, since it is a skin, it would already have the correct name.
You may be noticing a pattern here, but let's do some more
3) Overriding a sound

Imagine having a friend that is complaining about how one sound in the game sounds too quiet (e.g the creep sleeping sound); you might even agree with them, but even if you didn't you could suggest then a simple fix.
They would be told to go into the game root, create the folder structure sound/ambient, find or make a louder version of the sound file in there (creepsleeploop1.flac).
For all of these 3 very different cases, there is a lot in common:
You only need the file path, the file to override with, and the ability to place that file in the correct file path.

4) Overriding a resource indicator icon

This time without any flavour text, you know the drill by now :p
We will be overriding the gold icon this time.

Go into the game root and make the folder hierarchy ui/feedback/resources (this just means you make the folder called "ui", then inside it make the folder "feedback" and inside it make a folder called "resources")

Then I edited the gold resource icon to be a different colour, which can be done in GIMP or any other good image editing tool, you can do anything you want to the image, only saving the final texture in the correct format matters (this is an example DDS configuration in GIMP's export window, note DXT5 and "Generate mipmaps"; you can use DXT1 and DXT3 instead, with DXT1 being preferable if you're not using the alpha channel and DXT3 not being specifically useful)
upload_2021-2-23_16-11-52.png

The file was saved in that last folder I created in the steps above with the name resourcegold.dds.
And that's it! Run the game to test if you've done everything correctly
upload_2021-2-23_16-36-13.png


P.S: Although this is not necessarily in the scope of this tutorial, to utilize local files to their fullest capabilities, you will want to know how to get files from the installation of the game on your disk.
Using an MPQ editor on version up to 1.29.2, or CASC viewer for versions 1.30+, you can get both files and their filepaths from the game files. In CASC, the paths will have one or more prefixes, which are denoted by a colon after the prefixes' names, which do not play part in the path in the game root. To provide an example for this, in 1.32+ the peasant's model's path would look like war3.w3mod:units/human/peasant/peasant.mdx which can be compared to the path given in the first override example.
All the files the game uses can be found in the CASC, so feel free to think big.

If you want a small exercise in how to use this mechanism, try overriding the menu's background video (only applicable to 1.32+) or the games' font files.
 

Attachments

  • AllowLocalFiles.zip
    304 bytes · Views: 12
Last edited:

Chaosy

Tutorial Reviewer
Level 37
Joined
Jun 9, 2011
Messages
13,053
Didn't they make it so you didn't need to do anything to enable local files with one of the newer patches?

edit: could not find anything backing me up while more than one source mention reg edits so not sure where I have read otherwise.

Anyway:


You might want to bump up the headers one size and then add a smaller header for the sub-header (overriding model etc)
Programs used/showcased should be linked for easy access
I think the folder image is redundant, path in text form should be more than enough to get the point across and takes up less space.

big fan of color usage to highlight words.

Example:
_______________
What can you do with local files?
Some text
Models
Model instrctions
Textures
Texture instrctions
 
Last edited:
Level 5
Joined
Feb 25, 2013
Messages
54
There was an era where you didn't have to modify the registry, but that got fixed back to the intended functionality some time around 1.32.0 (always having local files allowed is not exclusively positive) so what you heard was correct for a long time but also a bug.

I will try to adjust the content as suggested and will add a link to GIMP as that's the only program shown in the tutorial and Ladislav's MPQ editor for an example MPQ editing program.
 
Top