• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Executable Project Tutorial

204280-albums7459-picture87144.png


Tools: Windows OS, Command Prompt, .BAT to .EXE Converter, Notepad
Difficulty: Advanced

This is a tutorial about creation of custom executable to automatically open your map inside Warcraft 3 without actually starting Warcraft 3 manually. Extremely useful for Single Player maps. This allows you to embed files into a single .EXE.

This method works exactly the same as the Test Map button located in the World Editor.
204280-albums7459-picture87146.png

Definitions:

Command Prompt (CMD.exe) - A command-line interface (CLI), also known as command-line user interface, console user interface, and character user interface (CUI), is a means of interacting with a computer program where the user (or client) issues commands to the program in the form of successive lines of text (command lines). More information.

.BAT (Batch File) - In DOS, OS/2, and also Microsoft Windows, batch file is the name given to a type of script file, a text file containing a series of commands to be executed by the command interpreter (Command Prompt). More information.

Notepad - Notepad is a simple text editor for Microsoft Windows. It has been included in all versions of Microsoft Windows since Windows 1.0 in 1985. More information.

To start, open up a Notepad and create a new text file. Now copy and paste this code into the Notepad:
204280-albums7459-picture87145.png

Now save it as a .BAT file.
This will start War3.exe in the same directory that your .BAT is located.
Alternatively you can write down the actual path to the War3.exe or even have the command prompt auto find your War3.exe. Click Here for more information.

-loadfile YourMap.w3x - is a code to start Warcraft 3 and automatically load the given map without the need of selecting any buttons. A good example would be the Test Map button in the World Editor.
Note: You can also write down a path, -loadfile C:\Users\Admin\Desktop\YourMap.w3x

YourMap.w3x - is the file name of your project map.
Ex: YourMap.w3x

In addition, you can experiment with many script codes and commands from command prompt. Such as: @Echo Off..
@Echo Off - Hides the command prompt text in your custom script (program). Command Prompt list of commands..

Now you will have to convert .BAT to .EXE. Why? Because it protects your script code, can contain embedded resources inside-it and is a popular general file that can have many custom changes such as custom .ICO (Icon).

You will find many great freeware software that can easily convert BAT To EXE. Click Here.

You can also customize your .EXE and even embed the map file inside it. This will protect your map by making it an .EXE thus disabling all outside access to it.
More information.

Now run your .EXE program and test it out if you did everything in -order, it should Launch War3.exe and start your map automatically.
Note: In this tutorial your .EXE must be in the same folder as-is the War3.exe.

You can also customize your .EXE by adding a splash image, custom icon (.ICO) or any other customization of the style and or appearance. Resource Hacker, this program will help you. :)

Furthermore, if you have any questions or anything you'd like to ask, feel free to comment.
 
Last edited:
you can merge this information with this: http://www.hiveworkshop.com/forums/miscellaneous-tutorials-456/integrating-tools-into-jngp-234157/#B

It will be very effective. And you might want to mention that in the tutorial too.

Gj anyways!

This tutorial is meant to be a stand-alone. Integrating tools into JPNG is an off-topic tutorial, I don't understand what were you trying to say? I am a little confused.
This is a tutorial about creating an .exe that launches your .w3x map automatically, without the need of opening Warcraft III. It also can be customized in various ways, you can also embed the .w3x map files inside your .exe or create a custom icon, splash screen.
 

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,183
Basically my idea was the following.

1. follow the steps in this tutorial
2. convert it to exe
3. follow the steps in the tutorial I linked

By doing that you can access your project from the editor while having another project open. This can be very useful for debugging purposes.

This is an example that happen to myself from time to time. I create a system in an empty map and once I get it working I want to apply it to my project, but when I do, it doesn't work. Which tends to make me jump between the maps a few times just to check what isn't working in the project.

This might be a rare example though, but can still see it being useful sometimes.
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
A friend of mine had the same idea lately in order to ship his map with SharpCraft, so the user does not have to set it up and start the map with it himself.

The problem I see is, for you are creating executables en mass (for each individual map/version), you also have a good possibility to face malicious code.

If it's just for starting normal maps fast, tough, you can also have a single bat/exe that passes %1 to war3.exe, and push that starter as a default program for w3m/w3x files. That's what I use at least, only need to double-click a map to launch it. Also -window mode.

edit: Just took a look, I think you can only start maps from within the wc3 directory, so I additionally copied the presented map into it.
 
A friend of mine had the same idea lately in order to ship his map with SharpCraft, so the user does not have to set it up and start the map with it himself.

The problem I see is, for you are creating executables en mass (for each individual map/version), you also have a good possibility to face malicious code.

If it's just for starting normal maps fast, tough, you can also have a single bat/exe that passes %1 to war3.exe, and push that starter as a default program for w3m/w3x files. That's what I use at least, only need to double-click a map to launch it. Also -window mode.

edit: Just took a look, I think you can only start maps from within the wc3 directory, so I additionally copied the presented map into it.

You can also make a .bat [batch] script that auto searches for war3 directory without the need of placing the .exe / .bat in the directory. As I mentioned, it can be fully customized to open your map [project] in various ways. The basic idea is that you can run maps from outside of Warcraft 3. Well, yes.. it is not exactly virus-safe method. But people with anti-virus don't even have to worry about it. The thing is that people can put malware and viruses inside the .exe along with map files, to counter this I suggest you to get anti-virus.

Note: You can also embed entire War3 files along with your map in a single .exe, this will allow you to play your map without the need of having War3 installed. Very useful for those who don't want to download War3 just to play a map, tough the downside is that the .exe file-size will be up to 1 GB and above.
 
Level 13
Joined
Mar 6, 2008
Messages
852
Bump, should I notice a moderator to review approval / rejection of this tutorial in the staff forums? I don't get it why this wasn't reviewed yet..

Disable the signature in the main post and attach the pictures you use to it.
Also it is just a wall of Text. You should structure it a little bit more with the use of little titles for each step for example.
Yes, this kind of tutorial is made for people who have a little bit more background knowledge, but you could at least add an example with screenshots.
If you follow this it gets your tutorial approved faster, because these points are always mentioned ;)
 
Disable the signature in the main post and attach the pictures you use to it.
Also it is just a wall of Text. You should structure it a little bit more with the use of little titles for each step for example.
Yes, this kind of tutorial is made for people who have a little bit more background knowledge, but you could at least add an example with screenshots.
If you follow this it gets your tutorial approved faster, because these points are always mentioned ;)

I already covered everything in basic steps, this tutorial has difficulty of "hard". If there were any questions or "tutoring" I could easily help out in the comments. Screen-shots were properly placed and I don't see nothing wrong with wall of text, it simply is in order- it follow from upside to the downside. The projection of tutorial was made to follow this order.
 
Top