Choose one of two heroes to fight the endless horde of enemies. Spells are quick-cast and controlled by mouse movement
How to build it?
1.) Open MJT_GUI.exe - that's the GUI for the transpiler.
2.) A window pops up Create/Open - click Open and select demo.mjp
3.) A new window pops up, on the left side there will be buttons, on the right, some empty space for the transpiler output.
4.) On the left, the first button is Map: ... It probably shows up with red text. That's because the .w3x file is in a different place in your computer than on mine.
5.) Click the Map button and select the MJS_Demo.w3x file
6.) The second button is libraries. If you click it, you can select which libraries are being used by the project. The map uses all provided libraries as it tries to demo all of them. The libraries themselves are located in the MJT's folder (std and libs subdirectory)
7.) The next button is save. Click it now, so you don't have to repeat step 4 every time you build the project.
8.) The next two buttons are Build and Build Debug. Click Build (not Build Debug) to build the project. Pay attention to the output on the right side.
9.) Ideally one the last lines in the output will say something like this: //! import "...."
10.) Open MJS_Demo.w3x in Warcraft III's Editor
11.) Open the Trigger Editor
12.) There is a code trigger in MJT Import/Import - copy the line from step 9 in it.
13.) Save the map and test it.
14.) Enjoy!
What is Build Debug?
At step 8, you can click Build Debug instead of Build ot generate a lot of additional info that helps you debug if your spells are not working correctly. While debug mode can't catch warcraft crashes, it will catch problems that stop the code from running - infinite loops, uninitialized variables, etc. MJS_Demo comes with a buggy spell that only shows up if you build in debug mode - it's called "Problematic Spell". It's so bad, that it freezes Warcraft III, so use it at your own peril. At the same time debug mode will point you to the function that causes the problem and its stack trace (which function called it, and what function was calling that function, etc.). You'll notice, that private function names start with "p18__" or similar. You use the transpiler output to find out which file generated that function (suprise, it'll be src\debug_example\problematic_spell.j) Can you find and fix the bug?
How does the MJT Tooltip generation work?
Each spell in the source code has a
// TOOLTIP
// ...
// TOOLTIP_DATA
// ...
// ENDTOOLTIP
section that defines the tooltip for the spell.
Tooltip data is a table format where you can define columns with <keys> that is replaced in the original tooltip text to provide the final tooltip text by level.
After step 8, you can open tooltips.txt next to demo.mjp where you can copy the tooltip texts from to your map.
Notes:
1.) Check Initialization/Map Init trigger - it calls InitializeSystem(). This is the entry point of the MJT project that will take care of everything else.
2.) There is also an MJS_Start.w3x that contains everything that is required by the libraries (dummy units, initialization trigger, template abilities), but nothing else. You can start your map here, or simply copy these things to your map from here.