This is the map and code of the Warcraft 3 map Custom Hero Survival.
WARNING: CHS.W3X is readable in the World Editor but cannot be saved without first following the "Setup the map" tutorial below.
Setup the map:
- Download the project and save it in a directory
- Open command line to the project directory (With explorer open to the project directory, Right Click > Open in Windows Terminal)
- Copy paste: ./CreateImportFile.exe "Trigger" "TriggerList.j" and press enter. Close the command line.
- Open "CHS.w3x" in the Warcraft 3 World Editor
- Go to the trigger editor and open the "Import" trigger in the "JASS" category.
- Replace the path in //! import "C:\Users\Eigenaar\Projects\CHS\TriggerList.j" with the path of the TriggerList.j file in the project you saved.
- Save the map, if it doesn't give an error you're done.
To include new .j files (jass code files) in the map you can use one of these 3 methods:
Manually:
- Get the path of the file you created.
- Add it into the TriggerList.j file
- Save the map in the editor.
- Success
Automatically (with VS Code)
- Open the project in vscode
- Ensure the file you've created is somewhere in the "Trigger" directory in the project
- Run the "Create Import File" task (or press Ctrl+Shift+B)
- Success
Automatically (without VS Code)
- Ensure you have all the code you want to be imported in (sub)folders of one big folder.
- Open command line and start CreateImportFile.exe. To do that it requires 2 arguments: 2a. Argument 1: The folder of files you want to import. For example "C:/Warcraft/CHS/Trigger" 2b. Argument 2: The path and name of the "import file" you want it to create. For example: "TriggerList.j"
For example you can start it like this: ./CreateImportFile.exe "C:/Warcraft/CHS/Trigger" "TriggerList.j" 3. Success
To make the jass compile command work:
- Unzip the JassHelper.zip in the JassHelper Req folder into the directory above the CHS directory (this project).
so it ends up looking like this:
C:
CHS CHS Readme.md CHS.w3x -all other files in the project- JassHelper common.j Blizzard.j JassHelper -lots of files- - Run the build task