• Check out the results of the Techtree Contest #19!
  • Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

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

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
 
Been using this for a while, can't help but think it deserves a higher grading, its such an amazing tool
 
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 ?
 
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.
 
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:
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:
 
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
 
I got two bugs or maybe it is an export error.
I noticed that when I exported my map and opened it in original world editor, that my string variables are getting messed up:
This is how my string variables should look like.
StringsRight.png


But instead they look like this. They even got some text from the credits that are in the quest section or the end screen when getting defeated.
StringsWrong.png


When I go to the trigger that creates my multiboard and where it gives it a title, it now says <Empty> instead of "Leaderboard" as the title. When I click on it to edit the string it says this instead of "Leaderboard".

String.png



The other bug is that if I got trigger which are written in JASS they get completely wiped of all code when exporting and opening in original world editor. For example my Death Region trigger.

This is how it should look like.
Death regions.png


Instead after exporting it looks like this and the world editor of course throws me a error since it can't call the trigger.
No death regions.png
 
Really love this but reading the documentation, I assumed that doing Include trigger data would show me the triggers back in the WE's trigger editor. Which it does, but almost all of them are blank.

I imported a map into BetterTriggers, already containing 50+ triggers.
I only created 1 new trigger in BT, and Exported the map.
Opened it in WE, now all of my (untouched) triggers are all blank. I do see variables.

I probably misunderstand, so please help clarify: what's going on? @LazZ
 
Really love this but reading the documentation, I assumed that doing Include trigger data would show me the triggers back in the WE's trigger editor. Which it does, but almost all of them are blank.

I imported a map into BetterTriggers, already containing 50+ triggers.
I only created 1 new trigger in BT, and Exported the map.
Opened it in WE, now all of my (untouched) triggers are all blank. I do see variables.

I probably misunderstand, so please help clarify: what's going on? @LazZ
There is an issue with converting triggers back with "Include trigger data". The guy above reported something similar and I'm currently still trying to solve the issue. The GUI trigger format is kind of arcane.
 
There is an issue with converting triggers back with "Include trigger data". The guy above reported something similar and I'm currently still trying to solve the issue. The GUI trigger format is kind of arcane.
Ah gotya, thanks. Wasn't sure if I misunderstood the scope of the program but alright, can't complain. Really fantastic program though and kudos for keeping it alive even though the game is ancient by now 👌
 
There is an issue with converting triggers back with "Include trigger data". The guy above reported something similar and I'm currently still trying to solve the issue. The GUI trigger format is kind of arcane.
Oh and one small thing, I did notice that only a couple of triggers did convert back into WE normally, so I was able to see the actions in the GUI editor. Not sure if you already found a usecase like that in order to investigate but feel free to DM me in case you want my map files.
 
There is an issue with converting triggers back with "Include trigger data". The guy above reported something similar and I'm currently still trying to solve the issue. The GUI trigger format is kind of arcane.
This didn't happen before when you created this program in 2022 right? No one else seemed to have complained about this and now out of nowhere @Shadefall and I have similar problems with the program. I think it might have to be a blizzard update issue. I could be also wrong but that's what I think.
 
Oh and one small thing, I did notice that only a couple of triggers did convert back into WE normally, so I was able to see the actions in the GUI editor. Not sure if you already found a usecase like that in order to investigate but feel free to DM me in case you want my map files.
Thanks but I already got lots of test maps.

This didn't happen before when you created this program in 2022 right? No one else seemed to have complained about this and now out of nowhere @Shadefall and I have similar problems with the program. I think it might have to be a blizzard update issue. I could be also wrong but that's what I think.
The feature was added in 2024 (version 1.4, see changelog in the description) and is one of the least tested features (oopsie). The tool is also not widely adopted, so it makes sense no one has complained until now. It's a completely custom tool so Blizzard has nothing to do with it. I'm testing maps that were saved with different versions of the World Editor and it's the same issue for all of them.
 
Another question, is it an expected outcome that when you move one folder with triggers up into a parent folder, all the triggers disappear (at least visually)? :P
 
This is a godsend for my work on Custom Team Survival, considering default Trigger Editor has some very annoying catastrophic bugs.
I'm not planning on using BT-only features as I want to keep the map friendly to further modification by not-so-advanced GUI users, but it is not viable to do so as there are bugs present. After one circle of importing to BetterEditors and exporting triggers back to .w3x:
  • If GUI trigger was disabled and referenced triggers/variables were removed (WE shows their name as Turn On gg_trg_RemovedTrigger), such triggers will be shown as errors on import. I found lack of verbose messages disturbing and needed to double-check the trigger's integrity.
  • Btw, exporting triggers back failed with some reference exception, until I removed the errors from point above.
  • Comment Triggers are not imported at all.
  • "Category is Comment" folders are imported as plain categories.
  • Variable's Initial Value is lost.
  • Triggers converted to Code are exported as empty. Comments are exported correctly.
  • Code Block triggers are exported correctly.
  • I've not found any empty GUI triggers, seems like all of them are exported correctly. I didn't check them to be a 1:1 match, though.
I am amazed by this tool. I usually only code Lua, but this still might replace my usual routine with the dencer.warcraft-vscode extension. If I was a Director, I'd mark this Director's Cut even despite the mentioned issues, as they can be circumvented with relative ease.

Some feature requests:

Autosave each interval / on focus change.
I've lost a bunch of work due to some error after inlining some triggers code. That code was entirely lost, cause triggers were deleted from file structure, but not saved in the target triggers.

Focus on the edited line after the action/parameter/etc selection window is closed.

Option to convert custom actions and BT-only actions to custom scripts on map export.

Object Manager for triggers to see how they cross-reference each other. It's been a very useful WE feature while I acknowledged myself to a new code triggerbase. Mayber as a "references/backreferences" tab for GUI trigger / variable.

Parse custom script to show which global variables (and triggers) are referenced there.
 
Last edited:
There seems to be a severe bug in Lua maps that causes all preplaced destructables to be created twice, independent of whether Generate all map object variables is enabled or not. This bug seems similar to the one described here. Exporting and resaving the map in the World Editor fixes the issue, so I am confident that it is caused by Better Triggers.
 
To add more info to Antares' report; basically, BetterTriggers generates create destructable call for every destructable when it's not supposed to.

As mentioned in HiveWE wiki, the doodad's flags contains a 'not used in script' property which if true, makes the game generate the destructable from .doo file directly, if set to false, it will not generate it and will expect the script to do it instead (in order to get the destructable reference for map script)
1750406119951.png
 
There seems to be a severe bug in Lua maps that causes all preplaced destructables to be created twice, independent of whether Generate all map object variables is enabled or not. This bug seems similar to the one described here. Exporting and resaving the map in the World Editor fixes the issue, so I am confident that it is caused by Better Triggers.
To add more info to Antares' report; basically, BetterTriggers generates create destructable call for every destructable when it's not supposed to.

As mentioned in HiveWE wiki, the doodad's flags contains a 'not used in script' property which if true, makes the game generate the destructable from .doo file directly, if set to false, it will not generate it and will expect the script to do it instead (in order to get the destructable reference for map script)

Solid feedback and info. I'll update the tool ASAP.
 
I had problems using the automatic updater, but the fix worked perfectly. Thank you!

Now to redo the lighting because all the lights were actually duplicated unbeknownst to me :plol:.

Yeah the auto-updater broke in v1.6.5 but should be fixed now.
Happy to hear the change works at least :grin:
 
The author has dropped the support of this tool for older versions (1.26/1.27) due to the game file's structure being different for each versions, iirc.
Oh Ravager! Oh you! Why must you put words into the author’s mouth and spreading misinformation? That could be lethal.

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.
 
Well I spend a bunch of hours working in this but when I finally exported my map it crashes warcraft when I try to make a lobby for it.

When I try to export it including Trigger Data I can still open it in the editor (though it takes longer than before and map size is 5 times larger???). The map then works after saving it in the regular editor and/or fixing the file size with w3 optimizer (which removed 80 %), but the version I can edit is still huge now.
 
Another Blizzard update, and another Better Triggers waiting room!
If you want to just make it work, adding

Code:
/// <summary>Introduced in patch 2.0.4.</summary>
v6117 = 6117,

in EditorVersion.cs and recompiling seemed like it solved it for me (I tried creating a pull request but it's inside a submodule so dropped it).

There might be something I'm missing and I can't promise this won't break anything, but after this change I managed to load and save a map that appears to be playable
 
Hey! I'm just recently testing this out, and it's a really amazing work. Thank you @LazZ for empowering us with these tools!!!

I'm trying to figure out what's the best approach to include BetterTriggers in the workflow.
  • Is auto-sync with the map possible? Meaning that if I make changes to triggers, they reflect in the map right away?
  • Based on the above, I was able to test and I see the changes in the map, but if I want to edit terrain/units, what's the workflow like? Do I export the map and open it in WE, save and re-import? Or is there a way I can edit terrain/units, save and use BetterTriggers as my "Trigger Editor" window?
  • If I edit a GUI trigger using Visual Studio, will it get converted to JASS (Custom Script)? Or will it retain its GUI form in the WE Editor?
  • When saving, I noticed some bad pathing to my sounds, so I had some compile errors (minor and fixable I guess).

Apologies if some of these questions might have been answered above or in the docs (I tried looking!) and appreciate any guidance given from the commmunity. Thanks in advance.
 
Hey! I'm just recently testing this out, and it's a really amazing work. Thank you @LazZ for empowering us with these tools!!!

I'm trying to figure out what's the best approach to include BetterTriggers in the workflow.
  • Is auto-sync with the map possible? Meaning that if I make changes to triggers, they reflect in the map right away?
  • Based on the above, I was able to test and I see the changes in the map, but if I want to edit terrain/units, what's the workflow like? Do I export the map and open it in WE, save and re-import? Or is there a way I can edit terrain/units, save and use BetterTriggers as my "Trigger Editor" window?
  • If I edit a GUI trigger using Visual Studio, will it get converted to JASS (Custom Script)? Or will it retain its GUI form in the WE Editor?
  • When saving, I noticed some bad pathing to my sounds, so I had some compile errors (minor and fixable I guess).

Apologies if some of these questions might have been answered above or in the docs (I tried looking!) and appreciate any guidance given from the commmunity. Thanks in advance.
  1. Not possible. It requires some hacks to sync with the WE directly and I don't know how to do that. The app was built as standalone.
  2. You save the map in the WE and changes are automatically reloaded in BT. See this: Guide – Nextra
  3. GUI triggers in BT are just JSON files. It will retain the GUI form but I highly advise against doing this unless you're trying to fix something that was broken.
  4. Not sure what this is. There was an issue with sound paths a while ago, but if I remember correctly that was fixed.
 
Back
Top