World Editor Helper is a world editor hack, its initial feature was to replace World Editor's JASS syntax checker with PJASS, a 3rd party syntax checker that is much faster than World Editor's and that does not crash/give wrong error messages in case of a syntax error.
Other features include: plugin support, an internal JASS preprocessor for defines and import and a map browser.
Once World Editor Helper is installed, Desktop, Start Menu and quick launch icons for World Editor Helper might be available depending on the options you chose. Otherwise you can find World Editor Helper in the installation folder. Open the link and World Editor Helper should be able to start World Editor.
World Editor Helper is currently unable to work when double clicking map files directly.
You can recognize that World Editor Helper is working by verifying that a [World Editor Helper] menu has been added to the main window's menu bar.
If an error message like "unable to query registry key value!" is shown then your wc3 is not installed correctly, you can fix this by reinstalling warcraft III or by adding a correct registry key yourself
You can easily fix the registry yourself by creating a file with these contents:
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Blizzard Entertainment\Warcraft III]
"InstallPathX"="C:\\Program Files\\Warcraft III"
"InstallPath"="C:\\Program Files\\Warcraft III"
Just replace C:\\Program Files\\Warcraft III with your warcraft III folder, notice that double '\' is required. Save this file as wc3.reg , make sure the extension is .reg , then double click the new file, Windows's Registry Editor will ask you a confirmation.
Once World Editor Helper is running correctly, you can test it by opening or creating any map and saving , you should be able to notice a variation in the final process.
If PJASS finds a syntax error , World Editor Helper will open a syntax error window specifying the error message, line number and the section of the map script with issues. It is analog to World Editor's syntax error window but it supports syntax highlight.
You can keep the syntax error window open while browsing your triggers for the errors and correcing them. Once you no longer need the syntax errors window you can close it by using the title bar's close button.
PJASS might get a new version, and in that case it would be a good idea to update World Editor Helper's PJASS as well.
To update PJASS you can simply replace [World Editor HelperFolder]\PJASS.exe with the new version of PJASS.exe
You can change many options using World Editor Helper's configuration dialog, [World Editor Helper\Configure...]
This tab allows you to browse and configure the installed plugins (if any), you can disable/enable a plugin by checking/unchecking its checkbox. Once a plugin is selected you can also query the configure and about buttons if the plugin supports them.
Notice that if you enable/disable a plugin you might need to restart World Editor Helper in order for the change to take effect.
With this tab you can select wheter a preprocessor is active or not and also control the execution order of preprocessors.
Initially, the only preprocessor available is World Editor Helper's internal preprocessor. Plugins may also add preprocessors that you would have to configure here.
Some preprocessors might fail if not called in the right order, the correct order to use depends on various factors, so it is prefferable that the preprocessor authors explain what is the best order to use.
The map browser offers an interface that helps you find maps, to open the map folder simply use [World Editor Helper Menu\Map Browser]
The map browser will preview the maps' name and preview image. You can browse different folders, once you find the map you want to open, double click it.
World Editor Helper supports plugins. A World Editor Helper plugin should be distributed in the form of a .DLL file. To install a plugin, make sure World Editor Helper is closed and simply copy the .dll file to World Editor Helper Folder\Plugins , you can then open World Editor Helper and verify the plugin works by the plugin tab of the configuration dialog.
World Editor Helper cannot be loaded by World Editor Unlimited's loader but it is distributed with the LikeWEU.DLL plugin that allows it to apply WEU' updates to data files so you can use it's features.
If you want to use WEU and World Editor Helper at the same time you have to copy LikeWEU.DLL to the plugins folder. You'll also need WEU to have been installed correctly (so LikeWEU can locate it in the registry and load it).
You can contribute World Editor Helper by developing plugins using C++, C, Pascal (Delphi), or win32 languages. World Editor Helper offers a function library that assists plugins in things like injecting mpq data or processing the map during save. For more information download World Editor Helper's source. And you can also contact Zoxc
World Editor Helper comes with an internal JASS preprocessor that adds define and import syntax to JASS. In order to use it make sure it is enabled in the preprocessors tab of the World Editor Helper configuration dialog.
The following is a syntax reference for said extensions.
The import command is equivalent to other languages' #include , require_once and uses. Simply let's you use scripts in an external file.
To use it, simply follow the //! import "file" syntax.
import attempts to get .j files from the map's folder and if the file is not found there it also looks up the World Editor Helper\imports\ folder
In case you are placing the external .j file in the map"s folder, then you"d have to either change World Editor" option of where to save files for testmap or to avoid to use testmap without saving first.
For example:
//! import "src\\supersystem" //! import src\superfunction //! import "x lib" //! import "src\\superfunction" function importtest takes nothing returns nothing call x_lib_Init() call SuperFunction(SuperSystem_GetId()) endfunction
You can see some variations of the import command, in this case the files it will use are mapsfolder\src\supersystem.j , mapsfolder\src\superfunction.j and x lib.j or World Editor Helper\imports\src\supersystem.j , World Editor Helper\imports\src\superfunction.j and World Editor Helper\imports\x lib.j . The difference between using or not " for the file names is that quoted file names can have spaces, but they need double \\ for the \ , and non-quoted file names only need one \ but cannot have spaces.
Notice that the same file is used in 2 instances of an import command, if World Editor Helper finds another import command then it will just ignore it.
The define command creates text macros for JASS allowing the user to define tokens that can be replaced by plenty of things when evaluated. Everything done by define happens in compile time so it is faster than constant variables/functions and has different uses as well.
There are two syntaxes for define: //! define IDENTIFIER DESCRIPTION or //! define IDENTIFIER(ARG1,ARG2,...,ARG3) DESCRIPTION.
It is easier to explain by some examples:
//! define DEFPI 3.141567 //! define INC(a) set a=a+1 function DefineTest takes nothing returns nothing local real x=DEFPI INC(x) endfunction
Will be converted into:
function DefineTest takes nothing returns nothing local real x=3.141567 set x=x+1 endfunction
Notice how it didn't matter that we used INC's argument as variable in the assignment.
Another example:
//! define Nested 12.0 //! define Formula34(l,y,z) l*500.0+Nested+y+z //! define Author "This is the author value" function DefineTest takes nothing returns nothing call BJDebugMsg(Author+Formula34(1,24.,35.)) endfunction
This becomes:
function DefineTest takes nothing returns nothing call BJDebugMsg("This is the author value"+1*500.0+12.0+24.+35.) endfunction
This will cause a syntax error later, notice that //! define won' protect you from errors, it doesn't add parenthesis on its own either, if you want parenthesis you have to add them in the definition yourself.
We exchange safety with flexibility here, defines are so flexible that you can even use them to override natives and blizzard.j functions:
function CreateTimerDummy takes nothing returns nothing call BJDebugMsg("Created Timer") return CreateTimer() endfunction //! define CreateTimer CreateTimerDummy //! define UnitAddAbilityBJ(a,u) UnitAddAbility(u,a) function DefineTest takes nothing returns nothing local timer t=CreateTimer() call UnitAddAbilityBJ('Aloc',GetTriggerUnit()) call TimerStart(t,0.5,true, function DoNothing) set t=null endfunction
Would become into:
function CreateTimerDummy takes nothing returns nothing call BJDebugMsg("Created Timer") return CreateTimer() endfunction function DefineTest takes nothing returns nothing local timer t=CreateTimerDummy() call UnitAddAbility(GetTriggerUnit(),'Aloc') call TimerStart(t,0.5,true, function DoNothing) set t=null endfunction
The gobal merger will look for globals statement and combine them at the top. This means that you can add many globals sections and don't have to use World Editor's Variable Editor to create globals.
globals
integer Number1
string Text1
endglobals
function Something takes nothing returns nothing
call BJDebugMsg(Text1)
endfunction
globals
integer Number2
string Text2
endglobals
Would become into:
globals
integer Number1
string Text1
integer Number2
string Text2
endglobals
function Something takes nothing returns nothing
call BJDebugMsg(Text1)
endfunction