1. The Aftermath has been revealed for the 19th Terraining Contest! Be sure to check out the Results and see what came out of it.
    Dismiss Notice
  2. Melee Mapping Contest #3 - Results are out! Congratulate the winners and check plenty of new 4v4 melee maps designed for this competition!
    Dismiss Notice
  3. The winners of our cinematic soundtrack competition have been decided! Step by the Music Contest #11 - Results to check the entries and congratulate the winners!
    Dismiss Notice

Executable Project Tutorial

Discussion in 'Miscellaneous Tutorials' started by A Void, Aug 4, 2014.

  1. A Void

    A Void

    Joined:
    Mar 29, 2011
    Messages:
    2,480
    Resources:
    10
    Models:
    2
    Spells:
    1
    Tutorials:
    7
    Resources:
    10
    [​IMG]

    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. [​IMG]


    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:
    [​IMG]
    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: Nov 3, 2016
  2. A Void

    A Void

    Joined:
    Mar 29, 2011
    Messages:
    2,480
    Resources:
    10
    Models:
    2
    Spells:
    1
    Tutorials:
    7
    Resources:
    10
    Bump, when will this get approved?
     
  3. Chaosy

    Chaosy

    Joined:
    Jun 9, 2011
    Messages:
    10,500
    Resources:
    17
    Maps:
    1
    Spells:
    10
    Tutorials:
    6
    Resources:
    17
  4. A Void

    A Void

    Joined:
    Mar 29, 2011
    Messages:
    2,480
    Resources:
    10
    Models:
    2
    Spells:
    1
    Tutorials:
    7
    Resources:
    10
    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.
     
  5. Chaosy

    Chaosy

    Joined:
    Jun 9, 2011
    Messages:
    10,500
    Resources:
    17
    Maps:
    1
    Spells:
    10
    Tutorials:
    6
    Resources:
    17
    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.
     
  6. WaterKnight

    WaterKnight

    Joined:
    Aug 18, 2009
    Messages:
    4,018
    Resources:
    5
    Maps:
    1
    Tutorials:
    4
    Resources:
    5
    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.
     
  7. A Void

    A Void

    Joined:
    Mar 29, 2011
    Messages:
    2,480
    Resources:
    10
    Models:
    2
    Spells:
    1
    Tutorials:
    7
    Resources:
    10
    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.
     
  8. WaterKnight

    WaterKnight

    Joined:
    Aug 18, 2009
    Messages:
    4,018
    Resources:
    5
    Maps:
    1
    Tutorials:
    4
    Resources:
    5
    And that it's becoming illegal. No, I meant that the map file needs to be within the wc3 directory for wc3 to correctly launch it but that has not vindicated either. Wonder why I put this in there then.
     
  9. A Void

    A Void

    Joined:
    Mar 29, 2011
    Messages:
    2,480
    Resources:
    10
    Models:
    2
    Spells:
    1
    Tutorials:
    7
    Resources:
    10
    Illegal, what are you talking about? Let's not head into off-topic..
     
  10. WaterKnight

    WaterKnight

    Joined:
    Aug 18, 2009
    Messages:
    4,018
    Resources:
    5
    Maps:
    1
    Tutorials:
    4
    Resources:
    5
    Shipping the game is. What kind of replies do you want?
     
  11. A Void

    A Void

    Joined:
    Mar 29, 2011
    Messages:
    2,480
    Resources:
    10
    Models:
    2
    Spells:
    1
    Tutorials:
    7
    Resources:
    10
    Well yes, I just said that its possible to include the game inside the .exe along with your map. If I ever wanted to do that I would pay zero attention to stupid policies of illegal.
     
  12. A Void

    A Void

    Joined:
    Mar 29, 2011
    Messages:
    2,480
    Resources:
    10
    Models:
    2
    Spells:
    1
    Tutorials:
    7
    Resources:
    10
    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..
     
  13. bhusta

    bhusta

    Joined:
    Mar 6, 2008
    Messages:
    842
    Resources:
    4
    Icons:
    1
    Maps:
    2
    Tutorials:
    1
    Resources:
    4
    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 ;)
     
  14. A Void

    A Void

    Joined:
    Mar 29, 2011
    Messages:
    2,480
    Resources:
    10
    Models:
    2
    Spells:
    1
    Tutorials:
    7
    Resources:
    10
    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.
     
  15. Daffa the Mage

    Daffa the Mage

    Map Moderator

    Joined:
    Jan 30, 2013
    Messages:
    7,447
    Resources:
    25
    Packs:
    1
    Maps:
    8
    Spells:
    15
    Tutorials:
    1
    Resources:
    25
    Remove the signature, then I guess it's all set.
    Your Tutorial still has your signature attached (your first post).
     
  16. A Void

    A Void

    Joined:
    Mar 29, 2011
    Messages:
    2,480
    Resources:
    10
    Models:
    2
    Spells:
    1
    Tutorials:
    7
    Resources:
    10
    All done. :)
     
  17. PurgeandFire

    PurgeandFire

    Code Moderator

    Joined:
    Nov 11, 2006
    Messages:
    7,418
    Resources:
    18
    Icons:
    1
    Spells:
    4
    Tutorials:
    9
    JASS:
    4
    Resources:
    18
    I apologize for the incredibly long delay. Approved. I like the conciseness of this tutorial. I imagine most tutorials on this topic would delve deep into a particular application, but I actually like that this tutorial just gives you the commands you need and allows you to work from there. Nice job.
     
  18. A Void

    A Void

    Joined:
    Mar 29, 2011
    Messages:
    2,480
    Resources:
    10
    Models:
    2
    Spells:
    1
    Tutorials:
    7
    Resources:
    10
    I've made an example .exe for the map Iceborn made by APproject. Link.

    The .exe was made using the base of this tutorial.
     
    Last edited: Jun 22, 2015