Better Triggers (Custom Trigger Editor)

Info

Changelog


Better Triggers is a custom, standalone trigger editor for Warcraft III.

Intro

The editor expands with new features and aims to improve the overall user experience for both GUI users and scripters.
To support the new features this editor saves your trigger data in a project folder in your filesystem, keeping it separate from the World Editor's save format (.wtg). This also means the changes you make in Better Triggers aren't synced with the triggers in the World Editor.

However, if you decide that you no longer want to use Better Triggers, there is an option to move all the changes in Better Triggers back into the map. Of course, this is not possible if you use 'Better Trigger'-only features.

Full documentation/guide can be found here: Better Triggers Guide
GitHub repository can be found here: Source Code
All previous releases can also be found on GitHub: Releases


Compatibility

The editor works with the following Warcraft III versions:
  • Reforged 2.0.0
  • "Old" Reforged (1.32 -> 1.36.2)
  • 1.31.1
  • 1.30.4
  • 1.29.2
  • 1.28.5


Feature Highlights
  • Source files outside your map
  • External changes to scripts are automatically picked up by the editor
  • Copy an existing map's triggers to Better Triggers
  • "Starcraft II"-inspired GUI
  • Local variables in GUI
  • 2D GUI arrays
  • Custom action- condition- and function definitions
  • More natives in GUI, including frames
  • Improved GUI to custom script conversion
  • Editor color themes
  • Map compression and protection


Requirements

Version 1.6.4 (April 6, 2025)

Fixes:
  • Fixed a naming conflict on some BT-only features when combining it with an external JASS library.
  • The autocomplete feature in the script editor would replace the last word on the line above if the caret position was on an empty line.
Version 1.6.3 (March 23, 2025)

Fixes:
  • Script completion replaced too many characters when inserting something from the completion list.
  • Fix window out of screen bounds issue that could occur when changing monitor setup.
Version 1.6.2 (March 8, 2025)

General:
  • You can now double-click folders to expand them.

Fixes:
  • Fixed a bug where preplaced units and destructibles would not drop items from item tables.
  • Fixed a bug where preplaced destructibles would not be created properly.
  • Script autocomplete now correctly replaces the entire word under the caret position.
  • (Possibly fixed) When clicking on triggers in the explorer view they could sometimes jump to a previously moved trigger's location.
Version 1.6.1 (February 20, 2025)

General:
  • Added a window that displays CommonJ and BlizzardJ for easier lookup.

Fixes:
  • Fixed a bug where changing the type of a used local variable would cause an error.
  • Fixed an issue where you could not press '.' in a Real parameter field to insert a dot.
  • Hero skill code did not show the name of the ability.
  • Added missing keywords to vJASS syntax highlighting.
Version 1.6 (January 25, 2025)

New Features:
  • Added feature to automatically download updates when clicking "Download Update" in the update prompt window.

Fixes:
  • Fixed an issue where custom water tinting did not work.
  • Fixed compile error for sound variable names (again.... Reforged 2.0 update).
Version 1.5.8 (January 13, 2025)

General:
  • Added option to single-click triggers to open them.

Fixes:
  • Fixed a crash when selecting the Night Elf option in the unit-type dropdown. Blizzard accidentally removed an icon in Reforged 2.0.
Version 1.5.7 (December 27, 2024)

Fixes:
  • Fixed a bug where custom features like frame natives for GUI were not available. This was a result of Blizzard updating War3 to 2.0
  • Fixed a bug where the script obfuscator would cause JASS runtime errors when using 'TriggerRegisterVariableEvent'
  • The script generator was outputting ForGroup instead of ForGroupBJ. This could cause unexpected behavior when combining it with 'bj_wantDestroyGroup'
Version 1.5.6 (December 6, 2024)

Fixes:
  • Fixed a JASS compile error when using this tool in combination with World Editor versions prior to 1.32.
Version 1.5.5 Hotfix (November 13, 2024)

Fixes:
  • Blizzard launched version 2.0 of Reforged, which broke this tool. This is now fixed.
  • Negative numbers were not allowed in the "Real" number input box
  • Right-clicking to rename a file did not highlight the text.
Version 1.5.4 (October 20, 2024)

General:
  • Global variables now display detailed information in the explorer view. This feature can be enabled/disabled in 'Tools -> Options'.
  • Text editor font size can now be changed in the options menu.

Fixes:
  • Attempting to paste trigger elements with nothing copied would cause an error.
  • An error would occur when attempting to convert a trigger to script when it didn't contain local variables.
  • Fixed miscellaneous errors.
Version 1.5.3 (September 1, 2024)

Fixes:
  • Using a local variable in a for each (variable) loop would cause an error.
  • Adding files with an extension typo and then renaming to a .j or .lua would not update the files in the editor.
  • If a file had an extension typo, then was renamed with .j or .lua, then saved, the file would lose all its content.
  • Fixed a bug where deleting a trigger/script/variable etc. with the right-click menu, and then right-click in an empty area to delete another would cause an error.
  • Fixed some threading errors.
Version 1.5.2 (August 25, 2024)

Fixes:
  • Fixed an error when converting maps with empty icon strings.
  • In the unit-type selection window, the default selection was not highlighted in the Human tab. Also improved window loading speed.
Version 1.5.1 (August 24, 2024)

Hotfix:
  • The editor was stuck on verifying the Warcraft III installation on first startup.
Version 1.5 (August 24, 2024)

New Features:
  • The editor now supports some pre-Reforged versions! Tested and verified versions:
    • 1.31.1
    • 1.30.4
    • 1.29.2
    • 1.28.5
Fixes:
  • Fixed a bug where enabling "Include Trigger Data" options in the export would make the map untestable when using Better Triggers-only features.
  • The editor now correctly saves changes to array sizes.
  • Fixed a crash when dragging trigger items below an If-Then-Else statement or any trigger item with subitems.
  • Fixed a bug where users could drag trigger element into their own subitems, like dragging an If-Then-Else statement item into it's own 'Then' or 'Else' action, leading to a crash.
  • Fixed an issue where the editor loaded files into incorrect folders when those files were moved while not using the editor.
  • Fixed an error when attempting to create a parameter definition in a trigger.
  • Pasting in the trigger explorer without anything copied would cause an error.
Version 1.4.1 (August 16, 2024)

General:
  • Added option to submit bug reports in 'Tools -> Report Issue'.
Fixes:
  • Some default string parameters were quoted, leading to script runtime errors.
Version 1.4 (August 9, 2024)

New Features:
  • Implemented option to copy all trigger data from a Better Triggers project back into the map (.wtg) for use in the World Editor. This option exists in case users no longer wish to work in Better Triggers.
Fixes:
  • You could not add conditions to if-statements in action- and condition definitions.
  • Deleting local trigger data in use (parameters and local variables) would crash the editor.
  • Trigger comments would not load.
  • Upper-lower case letter changes to files would make the trigger ID collision detection complain.
Version 1.3.3 (June 29, 2024)

General:
  • Improved the script editor autocomplete feature. It now reacts to all key-presses and not only Ctrl + Spacebar.
  • Changed script editor search style and color.
Fixes:
  • Fixed a bug where copy-pasting action- and condition definition uses in a trigger would lead to a crash.
  • Fixed an issue where parameters in action- condition- and function definitions did not correctly transform complex types, leading to script errors. E.g. "Unit-Type" -> "integer".
Version 1.3.2 (June 10, 2024)

Fixes:
  • Validate Script, Test Map and Build Map functions caused a thread error when a variable tab was open.
Version 1.3.1 (May 27, 2024)

Fixes:
  • Fixed an error when attempting to reload map data after saving in the WE.
Version 1.3 (May 25, 2024)

New Features:
  • Create your own re-usable Action- Condition- and Function definitions.
  • The tool now offers map compression and protection options when exporting the final map.
  • The tool is now interoperable with HiveWE. Changes made to files with HiveWE are now picked up by Better Triggers while running the programs simultaneously.
  • Trigger Importer: Import triggers from any map (assuming they aren’t protected).
  • Added an option to generate all global variables for preplaced map objects.
  • Added an option to open the most recent project on application startup.

Fixes:
  • Fixed a crash when clicking the ‘Custom Script’ checkmark in a trigger.
Version 1.2.5 (November 15, 2023)

General:
  • Now opens all opened tabs from previous session when loading a project.

Fixes:
  • Fixed a crash when attempting to copy triggers from a map (sorry, didn't catch that until now).
Version 1.2.4 (October 29, 2023)

General:
  • Updated runtime to .NET 6.
  • Added a 'project settings' window.
  • It is now possible to collaborate on triggers with multiple people, as the editor now generates random id's for triggers and variables.
  • Selecting a trigger in the 'Changed Triggers' window will now bring the selected trigger into view in the trigger explorer.

Fixes
  • Fixed a bug where local variables lead to script errors in Lua mode.
Version 1.2.3.2 (August 26, 2023)

Fixes:
  • Fixed a bug where pre-placed items would not be set correctly in the script, leading to null variables for all preplaced items.
  • You can now use local variables as conditionals in if-statements.
  • Fixed an issue where the 'Recent Files' list could reset.
Version 1.2.3.1 (May 9, 2023)

Fixes:
  • The tool now correctly reloads map data after your map has finished saving.
Version 1.2.3 (April 16, 2023)

General:
  • Game directory now defaults to "C:/Program Files (x86)/Warcraft III" when launching the first time.
  • The map selection window now uses Window's native folder picker.

Fixes:
  • Fixed a first time use crash when the map had script errors when validating the script.
  • Fixed a bug where the tool would not apply script changes to Lua mode maps.
Version 1.2.2.2 (April 3, 2023)

Fixes:
  • Fixed a crash when testing a map and the application was installed in a path with whitespaces.
  • Fixed a crash when a user had an empty DVD drive on their system.
Version 1.2.2.1 (March 15, 2023)

Hotfix
Version 1.2.2 (March 13, 2023)

New Features:
  • Option to select between different editor color themes.
  • Added an option to show/hide trigger category icons inside the 'Trigger Element Menu'.

General:
  • Regular map files (.w3x and .w3m) are now supported. Your map is no longer required to be in folder mode.
  • The tool now only replaces the map script for the test map and exported map, and not for the source map.

Fixes:
  • Fixed an edge case bug when generating the script for unit/destructible item tables.
Version 1.2.1 (February 22, 2023)

General:
  • You can now Ctrl + scroll in the script editor to change font size.
  • Added a script font style setting.
  • Added all natives, BJ functions, constants and more to the script editor's autocomplete.

Fixes:
  • Fixed a rare crash when swapping between game versions.
  • Fixed a bug where the text editor would attempt to autocomplete every keystroke.
Version 1.2 (February 12, 2023)

New Features:
  • You can now create frames in GUI!
  • More GUI natives.
  • CliCli-style trigger editor mode option.
  • All open tabs can now be closed from a right-click menu.
  • Added system-wide hotkey option (hotkey presses register without the window being in focus) for the following actions:
    • Validate Triggers
    • Test Map
    • Build Map

General:
  • Projects now load significantly faster.
  • The 'Trigger Converter' has been removed from the 'Tools' menu, and is now only accessible in the 'New Project' window.
  • Added 'imagefile' parameter control that displays War3 icons.

Fixes:
  • Fixed a bug where 'handle' type parameters were not listed in the parameter selection window.
  • For Lua mode, 'TriggerRegisterVariableEvent' in GUI now works correctly. Lua mode in the World Editor handles this native differently than everything else, and I only caught it by pure luck.
Version 1.1.4 (January 24, 2023)

General:
  • App settings are now stored in AppData/Local.
  • Improved search functionality.

Fixes:
  • Fixed a crash when the user would create files with unknown extensions in the src folder.
  • Fixed a bug where array index links were not rendered.
  • Fixed a bug where variable initial values were not checked when saving your map, leading to script errors.
  • Fixed an issue where files and folders would move to the cursor location after closing the right-click menu.
  • Fixed various local variable bugs.
  • The editor now correctly displays modified object data names for 1.33+ maps.
Version 1.1.3 (December 20, 2022)

General:
  • Supports WC3 patch 1.35.

Fixes:
  • Fixed some filesystem bugs.
  • Fix for jumpy trigger elements. When creating a new trigger element on double-click and then holding and dragging after the dialog menu closed, the element could jump to the last 'parent' used in a 'move' command, which could be an invalid trigger element location.
  • Fixed an error where WESTRINGs for some presets were not correctly fetched, leading to a crash when adding them as parameters.
  • Empty strings are now allowed in parameters.
Version 1.1.2 (December 10, 2022)

General:
  • Updated icon.
  • Added a new 'New Project' window.
  • The map path is now saved with the project when converting triggers from a map.

Fixes:
  • Fixed misc errors.
Version 1.1.1 (December 2, 2022)

General:
  • Local variables now actually use locals in the script, so GUI users can get the best benefits of locals. However, the option for arrays has been removed.
Version 1.1 (December 1, 2022)

New Features:
  • Local variables are now available for GUI triggers.
  • Added editor versioning.
  • Default parameters for new trigger elements.
  • Keybinding menu.
  • Global variables menu.
  • "Copy as text" for GUI triggers.
  • Search functionality for the trigger explorer.
  • Option to switch between game versions.

General:
  • Improved undo/redo to handle changes to GUI triggers and variables more properly.

Fixes:
  • Fixed a bug where "Value Of Real Variable" event would not accept variables.
  • Fixed a bug where empty arrays would count as valid parameters.
  • Fixed a crash that could occur in the parameter menu.
  • Fixed a crash when trying to disable/enable elements in the trigger explorer.
  • Fixed a crash when attempting to copy/cut/paste or enable/disable trigger elements with the context menu while no element was selected.
  • Fixed a crash when attempting to drag-drop trigger elements while editing their name.
  • Misc. fixes.
Version 1.0.4 (August 19, 2022)

General:
  • The trigger explorer now remembers what folders were expanded in a project.
  • Added GUI ECA's from 1.33.
  • Added a few missing types and keywords for Jass syntax highlighting.
  • Improved 'Set Variable' parameter selection. Array index values are kept when changing to a variable with the same number of dimensions.
Fixes:
  • Fixed a crash that could occur when loading different projects too many times.
  • Selected variable parameters now scroll into view when clicking on the parameter link.
Version 1.0.3 (August 13, 2022)

General:
  • Added a rename option for the right-click menu in the trigger explorer.
  • Partial non-ASCII name support for variables, triggers, regions, cameras etc. etc.
  • Object data now displays 'Editor Suffix'.
Fixes:
  • Fixed a crash when variables with references were deleted (through the filesystem) while Better Triggers wasn't running. The next time someone would load and test a project it would crash.
  • Custom units now show up for the correct race.
  • Units now have the correct icon.
  • Fixed an issue where trigger elements could jump to the cursor point after creating new trigger elements/parameters.
Version 1.0.2 (August 5, 2022)

Fixes:
  • Fixed a crash when converting certain maps with the Trigger Converter.
  • Fixed a crash that could occur when cut/pasting trigger elements.
  • Fixed a crash when attempting to select abilities, buffs and more from the parameter list.
  • Fixed some edge case compile errors.
  • Fixed a bug where a variable type change was not correctly changed for the initial value.
Version 1.0.1 (August 3, 2022)

General:
  • Subtree now expands when creating special trigger elements.
  • You can now double click parameter values.

Fixes:
  • Fixed a bug when copy/pasting special trigger elements.
  • Fixed name searching for some parameter values.
Contents

Better Triggers (Binary)

Reviews
eejin
I love the quick edit at the bottom of GUI triggers, saves having to go through multiple windows and dialogs. Some minor points: Auto detection of the game folder would be sweet (Almost always C:/Program Files(x86)/Warcraft III) The startup popup...
If i rename the file it reverts its content to a prev state. Then I did step back back back back.
Did not save. But it saved anyways somehow and did not allow me to go forward.

The experience is so far away from vs code as it can be. The instrumen is barely usable.
That's an annoying bug, I'll look into it when I get time. Though I do recommend that you just use vscode directly when editing your scripts, like shown here: Better Triggers – Script Live Update
 
Level 8
Joined
Sep 16, 2016
Messages
227
Been using this for a while, can't help but think it deserves a higher grading, its such an amazing tool
 
Level 6
Joined
Oct 29, 2024
Messages
31
Great project. I edited it to use as CLI tool for protecting my map (it now opens the map file, copies all the files from my workspace to the new project, renames the map (change wts file) protect it and creates a new protected + unprotected versions.
It's a bit too hacky a solution though to be published (I don't know cs or GUI, and was just pressing buttons from the code to make it work)
 
1.27 or older isn't longer being supported because Blizzard added tons of new natives starting with 1.29+, and some of the triggers available in this tool are also relying a lot with those new natives (the devs had even added the "Blz" prefixes for each new natives).
The tool enables/disables features and available natives depending on your WC3 version. It doesn't rely on them. I just haven't taken the time to support all older versions, because the structure of the game's files change a lot with each version.
 
The tool enables/disables features and available natives depending on your WC3 version. It doesn't rely on them. I just haven't taken the time to support all older versions, because the structure of the game's files change a lot with each version.
Hello LazZ, it's even possible somehow in one day you make version for 1.26 warcraf or it's not possible ?
 
Level 3
Joined
Mar 15, 2021
Messages
22
I just stumbled upon this tool today, and I absolutely love it so far! I'm having an issue with real numbers in GUI though, for some reason it doesn't allow me to type a real value in the "value" field at all, only integers. I'm using the latest version.
 
Level 12
Joined
Jul 4, 2016
Messages
634
Is there any plans on making it work for the latest patch?

Clicking the continue button on the setup window just puts it back to the Setup Window after a bit of loading.
 
Is there any plans on making it work for the latest patch?

Clicking the continue button on the setup window just puts it back to the Setup Window after a bit of loading.
It already works on the latest. I've experienced times when I had to launch WC3 via Battle.net, then close it and re-open BT. You could try that.
It has something to do with an external library that doesn't read the CASC files correctly when WC3 hasn't been launched for a while. At least that seems to be the behavior.
Let me know if the issue still persists.
 
Last edited:
Level 12
Joined
Jul 4, 2016
Messages
634
It already works on the latest. I've experienced times when I had to launch WC3 via Battle.net, then close it and re-open BT. You could try that.
It has something to do with an external library that doesn't read the CASC files correctly when WC3 hasn't been launched for a while. At least that seems to be the behavior.
Let me know if the issue still persists.
My bad, apparently I had a older version once I updated to the latest, it worked. :peasant-thumbs-up:
 
Level 12
Joined
Jul 4, 2016
Messages
634
I think I mentioned this before for a different map, for whatever reason, the jasshelper for Better Trigger throws a error that the official editor's jasshelper does not.

1743554025898.png
 
Top