- Joined
- Jul 20, 2018
- Messages
- 177
In this thread I would like to discuss some problems with JassHelper in Reforged. I posted them in far 2019 after 1.31 release on wc3maps.com/feedback, but that site was shut down, so I am making here a new post.
Settings inside World Editor
At first let's look at JassHelper settings in Reforged editor.
And now look at them in JNGP or WEX:
Let's refer to the JassHelper manual:
Basically,
Let me introduce a notation [xxx], where x can be 1 or 0.
For example, [101] means that Enable vJass is marked, Enable debug mode is NOT marked and Enable optimizer is marked:
I used next code snippet to test settings :
When Enable vJass is not marked, function
All tests below were performed on 1.32.10. Each spoiler box contains code after preprocessing and related comments.
Everything is disabled, so nothing should change. So it does.
Optimization is enabled, and
Optimization is disabled and not performed. Features of debug mode cannot be tested, because vJass is disabled.
Optimization is NOT enabled, but it is still done!
Optimization is enabled, but debug mode is enabled too; therefore, optimization must not be done. But alas, it is performed.
Features of debug mode cannot be tested, because vJass is disabled.
Code is left absolutely unchanged. Since pure JASS does not have
Optimization is disabled and not performed.
Debug statement is removed, despite enabled debug mode.
Optimization is enabled, but debug mode is enabled too; therefore, optimization must not be done. But it is performed anyways. Debug statement is also missing.
Configuration file
JassHelper requires
If you install a fresh copy of Reforged, then
If you edit it, after some time Blizzard Battle.net will ask you to update the game even though there none of them. When you do it, all changes made in
Summary
How to overcome issues
Settings inside World Editor
At first let's look at JassHelper settings in Reforged editor.
And now look at them in JNGP or WEX:
Let's refer to the JassHelper manual:
- --debug : This flag will make jasshelper compile in debug mode (more information in the quite extense vJass section). It also turns --nooptimize on.
- --nopreprocessor : If for some reason you just want to check normal Jass syntax, and call PJass using jasshelper as proxy, so you can use this option.
- --nooptimize : Disables optimization, refer to the script optimization section for more information.
Basically,
--nopreprocessor
and --nooptimize
are inverted in Reforged for some reason. And this change causes issues discussed below.Let me introduce a notation [xxx], where x can be 1 or 0.
For example, [101] means that Enable vJass is marked, Enable debug mode is NOT marked and Enable optimizer is marked:
I used next code snippet to test settings :
JASS:
function foo takes integer i returns integer
return i
endfunction
function main_foo takes nothing returns nothing
local integer i = foo(10)
endfunction
function main_vjass_foo takes nothing returns nothing
local integer i = foo(10)
debug local integer a = foo(15)
endfunction
main_vjass_foo
is commented.All tests below were performed on 1.32.10. Each spoiler box contains code after preprocessing and related comments.
JASS:
function foo takes integer i returns integer
return i
endfunction
function main_foo takes nothing returns nothing
local integer i= foo(10)
endfunction
//function main_vjass_foo takes nothing returns nothing
// local integer i = foo(10)
// debug local integer a = foo(15)
//endfunction
Everything is disabled, so nothing should change. So it does.
JASS:
function foo takes integer i returns integer
return i
endfunction
function main_foo takes nothing returns nothing
local integer i= ((10)) // INLINED!!
endfunction
//function main_vjass_foo takes nothing returns nothing
// local integer i = foo(10)
// debug local integer a = foo(15)
//endfunction
Optimization is enabled, and
foo
is inlined indeed.
JASS:
function foo takes integer i returns integer
return i
endfunction
function main_foo takes nothing returns nothing
local integer i = foo(10)
endfunction
//function main_vjass_foo takes nothing returns nothing
// local integer i = foo(10)
// debug local integer a = foo(15)
//endfunction
Optimization is disabled and not performed. Features of debug mode cannot be tested, because vJass is disabled.
JASS:
function foo takes integer i returns integer
return i
endfunction
function main_foo takes nothing returns nothing
local integer i= ((10)) // INLINED!!
endfunction
function main_vjass_foo takes nothing returns nothing
local integer i= ((10)) // INLINED!!
endfunction
Optimization is NOT enabled, but it is still done!
JASS:
function foo takes integer i returns integer
return i
endfunction
function main_foo takes nothing returns nothing
local integer i = ((10)) // INLINED!!
endfunction
//function main_vjass_foo takes nothing returns nothing
// local integer i = foo(10)
// debug local integer a = foo(15)
//endfunction
Optimization is enabled, but debug mode is enabled too; therefore, optimization must not be done. But alas, it is performed.
Features of debug mode cannot be tested, because vJass is disabled.
JASS:
function foo takes integer i returns integer
return i
endfunction
function main_foo takes nothing returns nothing
local integer i = foo(10)
endfunction
function main_vjass_foo takes nothing returns nothing
local integer i = foo(10)
debug local integer a = foo(15)
endfunction
Code is left absolutely unchanged. Since pure JASS does not have
debug
keyword, a syntax error is emitted.
JASS:
function foo takes integer i returns integer
return i
endfunction
function main_foo takes nothing returns nothing
local integer i= foo(10)
endfunction
function main_vjass_foo takes nothing returns nothing
local integer i= foo(10)
endfunction
Optimization is disabled and not performed.
Debug statement is removed, despite enabled debug mode.
JASS:
function foo takes integer i returns integer
return i
endfunction
function main_foo takes nothing returns nothing
local integer i= ((10)) // INLINED!!
endfunction
function main_vjass_foo takes nothing returns nothing
local integer i= ((10)) // INLINED!!
endfunction
Optimization is enabled, but debug mode is enabled too; therefore, optimization must not be done. But it is performed anyways. Debug statement is also missing.
Configuration file
JassHelper requires
jasshelper.conf
file to specify paths to pjass.exe
, blizzard.j
and common.j
and some other settings. Below you can see jasshelper.conf
with all usable settings in Reforged:
Code:
[jasscompiler]
"pjass.exe"
"$COMMONJ $BLIZZARDJ $WAR3MAPJ"
[lookupfolders]
// Just type the folders where //! import would look for if relative paths where used, include the final \
// embed them in quotes
// example: "c:\"
// The order causes priority:
[noreturnfixer]
// Change [noreturnfixer] to [doreturnfixer] in order to enable the patch 1.24 return bug fixer
// (not necessary unless you are on patch 1.24, bug was fixed in patch 1.24b)
[doshadowfixer]
// Enable the local variable shadowing phase
// To disable automatic .evaluate of methods that are called from above their declaration,
// add a line containing [forcemethodevaluate]
// To disable implicit usage of members and methods (i.e., not requiring this. ),
// add a line containing [noimplicitthis]
If you install a fresh copy of Reforged, then
jasshelper.conf
will look next way:
Code:
[jasscompiler]
"pjass.exe"
"$COMMONJ $BLIZZARDJ $WAR3MAPJ"
If you edit it, after some time Blizzard Battle.net will ask you to update the game even though there none of them. When you do it, all changes made in
jasshelper.conf
will be erased. This issue makes Reforged button in the launcher to always be "Update". Thus, you never know for sure, whether there is a true update or launcher just want to "fix" the game.Summary
- JassHelper can perform optimization even if it is not enabled.
- Debug mode is always disabled.
- Some combinations of options lead to syntax errors.
- Blizzard Launcher always tries to "fix" customized
jasshelper.conf
, replacing "Play" button with "Update".
How to overcome issues
- Save maps as a directory, disable JassHelper in the editor and use JassHelper via CLI (tutorial).
- Disable automatic updates for WarCraft III Reforged and always hold a copy of customized
jasshelper.conf
. I personally always open it in Notepad++ before updates to save changes.
Last edited: