- Joined
- Jan 23, 2015
- Messages
- 124
Credits go to Vex, without whom advise I would not manage to get everything else working.
Criticism is welcomed.
As for now, there's no modification (JNGP, Sharpcraft ext.) of World Editor that is able to run under WINE (at least for me), but JassHelper standalone still works almost flawlessly (though I couldn't get lua extensions to work, like ObjMerger read last post, grimext seems to work now). It can be found in JNGP or here. But using JH isn't comfortable by default, as you need to write path to JH.exe, blizzard.j and common.j every time you want to compile something not in the JH directory, so I've discovered my own way.
0. Setting up JassHelper
Probably it would be better to get JH from JNGP, because there you can find almost all you need for JH in one. In one folder with jasshelper you need: sfmpq.dll, and a copy in /bin and in /grimext; Blizzard.j and common.j, probably laying in same folder for simplicity; pjass.exe; grimext folder with lua5.1.dll and all the extensions.
Check wine registry if something won't work, especially for grimext:
Now place JH folder where you want and remember path to it. As for me, I chose ~/.JassHelper.
1. Terminal commands
Probably you would not be happy to write ~/.JassHelper/clijasshelper.exe ~/.JassHelper/common.j ... every time you want to compile something. You can add bash script that will allow you to run jasshelper from terminal without matter about working directory with only one command. It should know JH directory path and take two parameters which is script and map files, then just run JH in wine. Save script in a text file named "jasshelper" (file name is command name) and place it in /bin/ directory, and now you are able to run JH from terminal with command "jasshelper map.w3x script.j", just like some other compilator is used.
For my own comfort I've added functionality to copy resulting map in wc3 test directory, checks if arguments are present and debug option.
Note that JH will store its logs and backups dirs into the working directory from where the script was called.
You can also create same commands for wc3 or WE to run maps from terminal with something like this, thanks to -loadfile option in both .exe files:
Same for WE, just change .exe in wine command to World Editor.exe.
And remember that your wc3 directory can be different from mine, so don't forget to change WCDIR (or you can write FindWc3 script for everyone's good =) ).
2. Makefiles
Now, after you have terminal commands to compile and to run your maps, you can create makefiles that would compile and debug your project map in one terminal command from your project folder named "make".
Considering map's name is map.w3x and its script is script.j
With Vex's advice to place code in external files and some cool text editor like VS Code (with extension for jass syntax) Jass/vJass programming begins to be pretty much similar to C/C++.
After all things done I have more efficient platform to develop my maps than it was on Windows with JNGP, and I guess other people familiar with command prompt would like this too.
I think almost everything of this could be applied also to Windows, but I didn't tried. After all this months of work under Linux Mint I think I'll never return back to win, since linux is much more useful and comfortable for me.
Consider moving on Linux?
Criticism is welcomed.
As for now, there's no modification (JNGP, Sharpcraft ext.) of World Editor that is able to run under WINE (at least for me), but JassHelper standalone still works almost flawlessly (
0. Setting up JassHelper
Probably it would be better to get JH from JNGP, because there you can find almost all you need for JH in one. In one folder with jasshelper you need: sfmpq.dll, and a copy in /bin and in /grimext; Blizzard.j and common.j, probably laying in same folder for simplicity; pjass.exe; grimext folder with lua5.1.dll and all the extensions.
Check wine registry if something won't work, especially for grimext:
jasshelper.conf should contain full paths to every extension that are used in the community and I strongly recommend enable the [forcemethodevaluate] option to disable unwanted trigger overhead.The path is:HKEY_CURRENT_USER/Software/Grimoire
with string field namedWar3InstallPath
where wined path to wc3 should be placed.
Now place JH folder where you want and remember path to it. As for me, I chose ~/.JassHelper.
1. Terminal commands
Probably you would not be happy to write ~/.JassHelper/clijasshelper.exe ~/.JassHelper/common.j ... every time you want to compile something. You can add bash script that will allow you to run jasshelper from terminal without matter about working directory with only one command. It should know JH directory path and take two parameters which is script and map files, then just run JH in wine. Save script in a text file named "jasshelper" (file name is command name) and place it in /bin/ directory, and now you are able to run JH from terminal with command "jasshelper map.w3x script.j", just like some other compilator is used.
Code:
#!/bin/sh
JHDIR="$HOME/.JassHelper"
FILE=$1
SCRIPT=$2
wine "$JHDIR/clijasshelper.exe" "$JHDIR/common.j" "$JHDIR/blizzard.j" "$SCRIPT" "$FILE"
Code:
#!/bin/bash
DIR="$PWD"
JHDIR="$HOME/.JassHelper"
WCDIR="$HOME/.wine/drive_c/Warcraft 3"
FLAGS=""
declare -i CNT=1
while getopts ":d" flag; do
case "${flag}" in
d) FLAGS="$FLAGS --debug"; CNT+=1 ;;
*) echo "Unexpected option ${flag}" ;;
esac
done
FILE=${!CNT}
CNT+=1
SCRIPT=${!CNT}
if [ -z "$FILE" ]
then
echo "Input map file (.w3x) > "
read FILE
fi
if [ -z "$SCRIPT" ]
then
echo "Input map script file (.j) > "
read SCRIPT
fi
wine "$JHDIR/clijasshelper.exe" $FLAGS "$JHDIR/common.j" "$JHDIR/blizzard.j" "$SCRIPT" "$FILE"
if [ -z "$OUTDIR" ]
then
OUTDIR="$WCDIR/Maps/Test"
fi
echo "Output in > $OUTDIR"
cp -f "$FILE" "$OUTDIR"
You can also create same commands for wc3 or WE to run maps from terminal with something like this, thanks to -loadfile option in both .exe files:
Code:
#!/bin/sh
WCDIR="$HOME/.wine/drive_c/Warcraft 3"
if [ -z "$1" ]
then
echo "Input map file (.w3x) > "
read 1
fi
echo "$1"
echo "$(winepath -w $1)"
wine "$WCDIR/Frozen Throne.exe" -loadfile "$(winepath -w $1)"
And remember that your wc3 directory can be different from mine, so don't forget to change WCDIR (or you can write FindWc3 script for everyone's good =) ).
2. Makefiles
Now, after you have terminal commands to compile and to run your maps, you can create makefiles that would compile and debug your project map in one terminal command from your project folder named "make".
Code:
run: map.w3x war3map.j
jasshelper -d map.w3x war3map.j
wc3 map.w3x
map: map.w3x war3map.j
jasshelper -d map.w3x war3map.j
compile: map.w3x war3map.j
jasshelper map.w3x war3map.j
With Vex's advice to place code in external files and some cool text editor like VS Code (with extension for jass syntax) Jass/vJass programming begins to be pretty much similar to C/C++.
After all things done I have more efficient platform to develop my maps than it was on Windows with JNGP, and I guess other people familiar with command prompt would like this too.
I think almost everything of this could be applied also to Windows, but I didn't tried. After all this months of work under Linux Mint I think I'll never return back to win, since linux is much more useful and comfortable for me.
Consider moving on Linux?
Last edited: