What's new
Warhaven

Don't be a lurker, register an account and join the fun! Post, rate and participate with other members on Warhaven! Registering takes only a few clicks but gives you access to an amazing community and all its benefits. We hope you enjoy your stay and most importantly have fun!

Tutorial: Modifying Terrain Pathability (No extra programs needed)

Woodenplank

Well-Known Member
Messages
1,043
Reaction score
636
A lot of people here on Brigandshaven - a lot of editors, any way - probably use an older Warcraft 3 update because they want the JNPG editor to work. Partly, or perhaps mostly, because it has a built-in tool to modify the pathing of tilsets (useful for covering mountains with unpathable an "-Rocks tile").

You don't need actually need JNPG or any other third party software to do this, however.
You can modify your Warcraft 3 installation a bit, and when you save a map it will have whatever pathing specifications you want!
I'll show you how.

Step 1 - Making sure Local Files are enabled
NOTE You may be able to entirely skip this step, you can either go ahead with step 2 and hope you're good, or you can do this immediately to make sure you're golden!
First of all, to get this started, you will need to edit Warcraft's registry, in order to allow your files to be applied. To do this, simply follow these steps:
  1. Find the "regedit" (registry editor) program on your PC.
    (Type in "regedit" (Without punctuation) in the Windows search function)
  2. When the Registry Editor opens, find the Main Folder called "HKEY_CURRENT_USER", and open it.
  3. Open the "Software" sub-folder.
  4. Search for "Blizzard Entertainment" sub-folder, and open it.
  5. Click only once on "Warcraft III" sub-folder.
  6. Now, you will see a list on the right side of the screen. Find the registry that says "Allow Local Files", and open it (Double click).
  7. In the field of "Value Data", replace the zero (0) with number one (1). Make sure that the "Hexadecimal" flag is checked.
  8. Hit okay. The registry you edited should now display this in Data category: 0.00000001 (1).
Good, now we're ready to edit our Warcraft 3 Installation.

Part 2 - Modifying the Terrain.slk
The War3.mpq has a basic file called "Terrain.slk" - this file essentially tells your Warcraft 3 map the settings for every tile in the game.
You can extract one from your own MPQ with appropiate software - or you can download the one I attached at the end of this file - you're welcome :)

Open the Terrain.txt (once you downloaded it from me, or extracted it yourself) with a text editor, such as notepad.
You'll see very, very many lines of text. The first 17 lines are essentially a "tutorial" on how to edit the file.
Code:
ID;PWXL;N;E
B;X14;Y178;D0
C;X1;Y1;K"tileID"
C;X2;K"cliffSet"
C;X3;K"dir"
C;X4;K"file"
C;X5;K"comment"
C;X6;K"name"
C;X7;K"buildable"   <---------------- This is important
C;X8;K"footprints"
C;X9;K"walkable"   <---------------- This is important
C;X10;K"flyable"    <---------------- This is important
C;X11;K"blightPri"
C;X12;K"convertTo"
C;X13;K"InBeta"
C;X14;K"version"
C;X1;Y2;K"Ldrt"
These lines mostly refer to World editor Strings to help allocate the tile. For example the value of "C;X3;K" - tile directory - is used to find the appropiate skin/texture file.
This value is useful if you want to import custom tilesets. Find a skin of your choice, and change it's import path to the C;X3;K code of the tile, and it'll be replaced in your map!

What we're looking for are C;X7;K, C;X9;K, and C;X10;K. The values of these settings (either 0 or 1) determine whether a tile is buildable, walkable, and/or flyable.
(Ignore C;X8;K - this value just modifies whether models leave footprints when crossing the tile)

If you scroll down through the Terrain textfile you should come to this segment:
(Protip just search the file for "Rock")
Code:
C;X2;K-1
C;X3;K"TerrainArt\LordaeronSummer"
C;X4;K"Lords_Rock"
C;X5;K"Rock"
C;X6;K"WESTRING_TILE_ROCK"
C;X7;K0
C;X8;K0
C;X9;K1
C;X10;K1
C;X11;K6
C;X12;K"Frok,Wrok,Bflr,Arck,Crck,Nrck,Ybtl,Vrck,Qrck,Xbtl,Ddkr,Gdkr,Zbkl,Irbk,Ofst"
C;X13;K1
C;X14;K0
This is the section for the "Lordaeron Summer Rocks" tile.
As you can see by the lines:
Code:
C;X7;K0     C;X9;K1      and     C;X10;K1
its standard configuration is: unbuildable, walkable, flyable.
To edit the pathability, simply change 1's to 0's for the appropiate values. For example we change:
Code:
C;X9;K1    ---> C;X9;K0
And there! Lordaeron Rocks are now programmed to be unwalkable.

Step 3 - Adding the file to Warcraft 3 Directory
Once you've made the tileset changes you want, save the file as "Terrain.slk" - the extension of ".slk" is very important, as War3 won't recognize it otherwise.

In your Warcraft 3 folder (typically C:\\Program Files\Warcraft III) make a new folder called "TerrainArt".
Simply put your new, modified "Terrain.slk" file into this folder.
------------------------------------
Update: "TerrainArt" must be put into the folder "war3.mpq" in order to work with the most recent Warcraft III patch!

------------------------------------------

You're done! Next time you start your world editor and save your map, it will take directions from your Warcratings!r, and change tile pathing to your new settings!

BONUS: Download the MiscData.txt attached to this post an put it in C:\\Program Files\Warcraft III\UI (or wherever your WC3 is installed) - just create a new UI folder, if you don't have one already. This will allow you to use the Raise/Lower terraining tool infinitely, allowing you to make very steep mountains or very deep holes in the ground.
 

Attachments

Last edited by a moderator:

Yousef

Paladin of the Alliance
Map Maker
Messages
2,089
Reaction score
312
Very very helpful, but now I got a question, if you can modify terrain pathability without any 3rd party programs, does that mean we can make 480x480 maps without a custom map editor?
 

Woodenplank

Well-Known Member
Messages
1,043
Reaction score
636
if you can modify terrain pathability without any 3rd party programs, does that mean we can make 480x480 maps without a custom map editor?
Technically yes. But I don't exactly know which files and directories govern the min/max settings of the World Editor.

The thing to remember about programs such as JNPG or Sharpcraft is that they're mostly not programs in their own right - they're hacks that insert themsleves into the script of Warcraft 3's World Editor program.
This behaviour is also what causes several anti-virus programs to react to Sharpcraft or JNPG - one .exe inserting script into another program is a typical virus operation.

So what happens is that the 3rd party software changes your MPQ directory for you - all these changes can, however, be made with your own installation (although only the .slks and .txt are easily edited). I recently had a spot of trouble because I had to insert extra trigger functions into my Warcraft 3 installation to be capable of opening LTF.
Sadly I can't tell you where the map size and other editor limits are programmed. I don't know just yet.
You could also create your own profanity filter by messing with the MPQ files :p

EDIT: Recently found this bit of code in my mpq archieve. I guess you could modify the max camera bounds. I'm not going to tangle with it right now though... I only just got my Warcraft 3 working with LTF editing, and I don't want to mess with it.
Code:
[MapSizes]
NumSizes=6
Size00=7500,WESTRING_MAPSIZE_TINY
Size01=13500,WESTRING_MAPSIZE_SMALL
Size02=22000,WESTRING_MAPSIZE_MEDIUM
Size03=99999,WESTRING_MAPSIZE_LARGE

// If larger map sizes are enabled in the future
// Size03=32500, WESTRING_MAPSIZE_LARGE
// Size04=45000, WESTRING_MAPSIZE_HUGE
// Size05=99999, WESTRING_MAPSIZE_EPIC

EXTRA: Download the MiscData.txt attached to original post and put it in C:\\Program Files\Warcraft III\UI (or wherever your WC3 is installed) - just create a new UI folder, if you don't have one already. This will allow you to use the Raise/lower terrain tool infinitely, allowing you to make very steep mountains or holes in the ground.
 
Last edited by a moderator:

Yousef

Paladin of the Alliance
Map Maker
Messages
2,089
Reaction score
312
Technically yes. But I don't exactly know which files and directories govern the min/max settings of the World Editor.

The thing to remember about programs such as JNPG or Sharpcraft is that they're mostly not programs in their own right - they're hacks that insert themsleves into the script of Warcraft 3's World Editor program.
This behaviour is also what causes several anti-virus programs to react to Sharpcraft or JNPG - one .exe inserting script into another program is a typical virus operation.

So what happens is that the 3rd party software changes your MPQ directory for you - all these changes can, however, be made with your own installation (although only the .slks and .txt are easily edited). I recently had a spot of trouble because I had to insert extra trigger functions into my Warcraft 3 installation to be capable of opening LTF.
Sadly I can't tell you where the map size and other editor limits are programmed. I don't know just yet.
You could also create your own profanity filter by messing with the MPQ files :p

EDIT: Recently found this bit of code in my mpq archieve. I guess you could modify the max camera bounds. I'm not going to tangle with it right now though... I only just got my Warcraft 3 working with LTF editing, and I don't want to mess with it.
Code:
[MapSizes]
NumSizes=6
Size00=7500,WESTRING_MAPSIZE_TINY
Size01=13500,WESTRING_MAPSIZE_SMALL
Size02=22000,WESTRING_MAPSIZE_MEDIUM
Size03=99999,WESTRING_MAPSIZE_LARGE

// If larger map sizes are enabled in the future
// Size03=32500, WESTRING_MAPSIZE_LARGE
// Size04=45000, WESTRING_MAPSIZE_HUGE
// Size05=99999, WESTRING_MAPSIZE_EPIC

EXTRA: Download the MiscData.txt attached to original post and put it in C:\\Program Files\Warcraft III\UI (or wherever your WC3 is installed) - just create a new UI folder, if you don't have one already. This will allow you to use the Riase/lower terrain tool infinitely, allowing you to make very steep mountains or holes in the ground.
Interesting, I already have the MiscData file, and I already have a slightly edited MPQ! It's very fun to have some of the cool skins from Hive in AW or just battle.net melee.
 

Elbadruhel

Well-Known Member
Map Maker
Messages
1,357
Reaction score
661
U cant make tiles unwalkable with Sharpcraft right? U need to do this.

Btw, the vanilla "red" tile can be removed from a set doing something? I use imported textures to tileset replacing cost 1 tiles, but if i have 2 red tiles there i can have 2 less custom tiles, cause they cant be replaced for 2 cost 1.
 

Smyl

The Last Crusade shall visit even you!
Map Maker
Messages
1,176
Reaction score
239
A lot of people here on Brigandshaven - a lot of editors, any way - probably use an older Warcraft 3 update because they want the JNPG editor to work. Partly, or perhaps mostly, because it has a built-in tool to modify the pathing of tilsets (useful for covering mountains with unpathable an "-Rocks tile").

You don't need actually need JNPG or any other third party software to do this, however.
You can modify your Warcraft 3 installation a bit, and when you save a map it will have whatever pathing specifications you want!
I'll show you how.

Step 1 - Making sure Local Files are enabled
First of all, to get this started, you will need to edit Warcraft's registry, in order to allow your files to be applied. To do this, simply follow these steps:
  1. Find the "regedit" (registry editor) program on your PC.
    (Type in "regedit" (Without punctuation) in the Windows search function)
  2. When the Registry Editor opens, find the Main Folder called "HKEY_CURRENT_USER", and open it.
  3. Open the "Software" sub-folder.
  4. Search for "Blizzard Entertainment" sub-folder, and open it.
  5. Click only once on "Warcraft III" sub-folder.
  6. Now, you will see a list on the right side of the screen. Find the registry that says "Allow Local Files", and open it (Double click).
  7. In the field of "Value Data", replace the zero (0) with number one (1). Make sure that the "Hexadecimal" flag is checked.
  8. Hit okay. The registry you edited should now display this in Data category: 0.00000001 (1).
Good, now we're ready to edit our Warcraft 3 Installation.

Part 2 - Modifying the Terrain.slk
The War3.mpq has a basic file called "Terrain.slk" - this file essentially tells your Warcraft 3 map the settings for every tile in the game.
You can extract one from your own MPQ with appropiate software - or you can download the one I attached at the end of this file - you're welcome :)

Open the Terrain.txt (once you downloaded it from me, or extracted it yourself) with a text editor, such as notepad.
You'll see very, very many lines of text. The first 17 lines are essentially a "tutorial" on how to edit the file.
Code:
ID;PWXL;N;E
B;X14;Y178;D0
C;X1;Y1;K"tileID"
C;X2;K"cliffSet"
C;X3;K"dir"
C;X4;K"file"
C;X5;K"comment"
C;X6;K"name"
C;X7;K"buildable"   <---------------- This is important
C;X8;K"footprints"
C;X9;K"walkable"   <---------------- This is important
C;X10;K"flyable"    <---------------- This is important
C;X11;K"blightPri"
C;X12;K"convertTo"
C;X13;K"InBeta"
C;X14;K"version"
C;X1;Y2;K"Ldrt"
These lines mostly refer to World editor Strings to help allocate the tile. For example the value of "C;X3;K" - tile directory - is used to find the appropiate skin/texture file.
This value is useful if you want to import custom tilesets. Find a skin of your choice, and change it's import path to the C;X3;K code of the tile, and it'll be replaced in your map!

What we're looking for are C;X7;K, C;X9;K, and C;X10;K. The values of these settings (either 0 or 1) determine whether a tile is buildable, walkable, and/or flyable.
(Ignore C;X8;K - this value just modifies whether models leave footprints when crossing the tile)

If you scroll down through the Terrain textfile you should come to this segment:
(Protip just search the file for "Rock")
Code:
C;X2;K-1
C;X3;K"TerrainArt\LordaeronSummer"
C;X4;K"Lords_Rock"
C;X5;K"Rock"
C;X6;K"WESTRING_TILE_ROCK"
C;X7;K0
C;X8;K0
C;X9;K1
C;X10;K1
C;X11;K6
C;X12;K"Frok,Wrok,Bflr,Arck,Crck,Nrck,Ybtl,Vrck,Qrck,Xbtl,Ddkr,Gdkr,Zbkl,Irbk,Ofst"
C;X13;K1
C;X14;K0
This is the section for the "Lordaeron Summer Rocks" tile.
As you can see by the lines:
Code:
C;X7;K0     C;X9;K1      and     C;X10;K1
its standard configuration is: unbuildable, walkable, flyable.
To edit the pathability, simply change 1's to 0's for the appropiate values. For example we change:
Code:
C;X9;K1    ---> C;X9;K0
And there! Lordaeron Rocks are now programmed to be unwalkable.

Step 3 - Adding the file to Warcraft 3 Directory
Once you've made the tileset changes you want, save the file as "Terrain.slk" - the extension of ".slk" is very important, as War3 won't recognize it otherwise.

In your Warcraft 3 folder (typically C:\\Program Files\Warcraft III) make a new folder called "TerrainArt".
Simply put your new, modified "Terrain.slk" file into this folder.

You're done! Next time you start your world editor and save your map, it will take directions from your Warcratings!r, and change tile pathing to your new settings!

BONUS: Download the MiscData.txt attached to this post an put it in C:\\Program Files\Warcraft III\UI (or wherever your WC3 is installed) - just create a new UI folder, if you don't have one already. This will allow you to use the Raise/Lower terraining tool infinitely, allowing you to make very steep mountains or very deep holes in the ground.
I have a problem that when I click once on the Warcraft III subfolder it does not show the Allow thingy. Anyone help? :/
 

B-Roy7

Nostalgic
Messages
73
Reaction score
41
upload_2018-4-20_19-13-18.png

having some trouble enabling local files. Does this look correct?
 

B-Roy7

Nostalgic
Messages
73
Reaction score
41
Does anyone know how this works?
Im trying to make my cities so you can build in them and the mountains unwalkable. I got the numbers switched on the right tiles, but I don't think the warcraft program is picking up the new terrain.slk folder.
yes I made sure local files were enabled.
Anyone have any ideas?
 

EmperorFawful

Burn it!
Messages
4,038
Reaction score
1,211
By the way does anyone know if the folder structure has been changed on world editor?
Updated recently to newest version, opened up my map project, but it doesn't utilize the data from TerrainArt folder.
Anyone knows the answer?
 

Hannibal

Well-Known Member
Messages
478
Reaction score
650
By the way does anyone know if the folder structure has been changed on world editor?
Updated recently to newest version, opened up my map project, but it doesn't utilize the data from TerrainArt folder.
Anyone knows the answer?
Yes my dear Fawful. You must create a folder called 'war3.mpq' and move the TerrainArt folder inside of it.
https://imgur.com/a/HTUQYFu
I've been thinking of cleaning up and updating Wooden's post and posting it over the hive (giving due credit of course). That way if there's any changes in the future that affect it again they can help make any corrections needed and we can keep that post current.
 

EmperorFawful

Burn it!
Messages
4,038
Reaction score
1,211
Yeah that actually worked out for me, so leaving it to @Woodenplank to update the first post, while considering what Hannibal wrote.
Never would have guessed that a folder needs to be named after the mpq.
 

TheKaldorei

Queen of Warhaven
Map Maker
Member
Messages
2,590
Reaction score
830
Yeah that actually worked out for me, so leaving it to @Woodenplank to update the first post, while considering what Hannibal wrote.
Never would have guessed that a folder needs to be named after the mpq.
Woodenplank left forever remember.

Just edit it yourself xd
 

B-Roy7

Nostalgic
Messages
73
Reaction score
41
You got it to work EmperorFawful? I followed all the steps and cant get it. My regedit does not have an "allow local files" option. But all the variable are marker with (1) as they should be. C:\Program Files (x86)\Warcraft III\war3.mpq\TerrainArt here is the location of the Terrain.slk. Am i doing something wrong?
 

Marshmalo

Well-Known Member
Map Maker
Messages
1,618
Reaction score
2,242
Does anyone know if there are any third party programs that do this yet? Because this looks really complicated and alot of hassle just to get pathing working o_O
 

Elbadruhel

Well-Known Member
Map Maker
Messages
1,357
Reaction score
661
What part do you dont understand? Its quite simple, i did it for my map in 3 mins: 1 to check wich is the terrain, 1 to change the value and 1 to charge the map to see if it worked xD

If you need any help or have some doubt mp me, i will be glad to be the one helping for one time :p
 

Krotos

The Lore Judge.
Map Maker
Messages
1,405
Reaction score
572
Does anyone know if there are any third party programs that do this yet? Because this looks really complicated and alot of hassle just to get pathing working o_O
There's HiveWE on Hiveworkshop that can do this for you but any changes applied have to be done once you finish editing anything else as opening the map back up in the editor will overwrite HiveWE's pathability settings.
 

Marshmalo

Well-Known Member
Map Maker
Messages
1,618
Reaction score
2,242
There's HiveWE on Hiveworkshop that can do this for you but any changes applied have to be done once you finish editing anything else as opening the map back up in the editor will overwrite HiveWE's pathability settings.
That is what I was hoping for thankyou :)
 

Elbadruhel

Well-Known Member
Map Maker
Messages
1,357
Reaction score
661
There's HiveWE on Hiveworkshop that can do this for you but any changes applied have to be done once you finish editing anything else as opening the map back up in the editor will overwrite HiveWE's pathability settings.
Doing it with Wooden tutorial makes pathing work and you can open it in editor freely without changing it back again. Idk why would you like to use external tools that even give a worse outcome :/
 

Krotos

The Lore Judge.
Map Maker
Messages
1,405
Reaction score
572
Doing it with Wooden tutorial makes pathing work and you can open it in editor freely without changing it back again. Idk why would you like to use external tools that even give a worse outcome :/
Because doing it through HiveWE takes less than 20 seconds.
 
Top