World Editor
You can work on your map in the World Editor while also coding in TypeScript using an external code editor. The way this works is with a new feature that was introduced in patch 1.31.0 which allows you to save a map as a folder instead of an archive.
#
Opening mapThe easiest way to open your map in the editor is by dragging the map folder (map.w3x
) onto the World Editor window. Once it's open you are free to make any changes. The only difference is you don't use the Test Map button to test your map, instead we type npm run test
in the terminal. Any triggers you write in GUI can be accessed from TypeScript by running the watch script described in the next section.
#
Generate globalsBefore we do any editing with the World Editor we will want to run a watch script that will automatically create definitions for globals that the editor generates, such as regions, cameras, or preplaced units. To do this, it's very simple.
npm run dev
Once you run that command you should see some output like the text below.
[build:defs] [nodemon] clean exit - waiting for changes before restart
This means the watcher is running successfully and will generate the definitions for you.
#
Replace the default mapIf you wish to use your own map you can delete the one that the template comes with by default (maps/map.w3x
). Delete the entire map.w3x
folder.
Now, open the map you want to edit in the latest World Editor. Once open you will want to go to File > Save Map As...
, then change the file type to Warcraft III Scenario Folder - Expansion
.
Finally, save the map as map.w3x
in the maps
folder where the old map used to be. If you wish to use a different path than map.w3x
you must edit config.json
's mapFolder
option.
Note that your map's scripting language must be set to Lua.