• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

A new TESH Syntax Highlighter for Warcraft 3

Level 14
Joined
Dec 12, 2012
Messages
1,007
Made several screenshots of different styles. They do not have gray "bars" of editor (as screenshots in the main post), because WE is running on Win10 with Win7 compatibility.
@looking_for_help, you may add them to the main post.

Thanks, I will probably include them with the next update in the \tesh\config\themes folder and ship them with TESH so that users can choose from a set of pre-defined themes (in case they don't want to customize their own theme).
 
Level 14
Joined
Dec 12, 2012
Messages
1,007
Since this already integrates with the default editor which supports lua, do you have plans to also add highlighting for lua to TESH in the future?

I will look into it but at the moment I can't promise that. So not in the near future.

My main goal was to somehow get TESH working again with the post-Reforged WC3 versions. Since this is achieved now I will first have to think a bit how to continue with TESH from this point on.
 
Level 18
Joined
Oct 17, 2012
Messages
821
@looking_for_help The last version before Reforged compatibility would remember where I scrolled to for a custom script trigger, so that I could return to that point in the trigger after switching to another one. Latest version just sends me to the top after switching triggers back and forth.

The window for find/replace tends to appear at the bottom of my screen, so much that it sometimes will appear off the screen. By then, I could not locate it.

Just two findings that I thought you might want to look into.
 
Level 14
Joined
Dec 12, 2012
Messages
1,007
@looking_for_help The last version before Reforged compatibility would remember where I scrolled to for a custom script trigger, so that I could return to that point in the trigger after switching to another one. Latest version just sends me to the top after switching triggers back and forth.

The window for find/replace tends to appear at the bottom of my screen, so much that it sometimes will appear off the screen. By then, I could not locate it.

Thanks for the feedback, I will look into this.

I also just noticed that searching apparently only works in "up" direction correctly... This will be fixed with the next update.
 
Level 14
Joined
Dec 12, 2012
Messages
1,007
Fantastic work updating the systems @looking_for_help

I noticed that there is a bit of lag when typing too fast. Maybe you can do something about it.

Thanks for the feedback.

Yes, I noticed a few days ago already that the performance is not as good as it was before Reforged. I am not sure yet what is causing this issue...

I had to update not only the TESH code but all third party libraries as well (like Scintilla, boost, etc.), because of the change from 32 bit to 64 bit (and because they were quite outdated, so I use the latest versions now). So I have to check these differences as well, but I will definitely look into this.
 
Level 20
Joined
May 16, 2012
Messages
635
Thanks for the feedback.

Yes, I noticed a few days ago already that the performance is not as good as it was before Reforged. I am not sure yet what is causing this issue...

I had to update not only the TESH code but all third party libraries as well (like Scintilla, boost, etc.), because of the change from 32 bit to 64 bit (and because they were quite outdated, so I use the latest versions now). So I have to check these differences as well, but I will definitely look into this.

Great, good luck. Also, is it possible to add the calltip when hovering over a function?
 
Level 14
Joined
Dec 12, 2012
Messages
1,007
Does TESH 2.0 support ZINC?

No, at the moment not.

I don't really know if there even is sufficient demand for such a feature because I can't really remember anyone asking for this (I guess there are not many people using Zinc nowadays).

I never really worked with Zinc. I wanted to add brace highlighting for curly braces {} soon (because this is also required for Lua)...
Except some more keywords like for or while, is there anything else specifically required for Zinc?
 
Level 2
Joined
Jan 16, 2021
Messages
12
Hmm, seems like a great and easy to use tool, I'd like to try it.

Question: Since i dont have reforged as a hard copy battle.net launcher launches the editor. I can't seem to find any filepath to an actual Editor.Exe or WC3.exe does anyone know if im out of luck? Or is there some other way
 
Level 14
Joined
Dec 12, 2012
Messages
1,007
Hmm, seems like a great and easy to use tool, I'd like to try it.

Question: Since i dont have reforged as a hard copy battle.net launcher launches the editor. I can't seem to find any filepath to an actual Editor.Exe or WC3.exe does anyone know if im out of luck? Or is there some other way

The executable of the editor is usually located at:

C:\Program Files\Warcraft III\_retail_\x86_64\World Editor.exe

This is also mentioned in the installation instructions of the main post. If you have for some reasons a different path, you can specify it in the world_editor_exe_path.ini, located in the tesh\config subdirectory.
 
Level 3
Joined
Jan 31, 2021
Messages
3
Hello

Thanks for making this, its really useful to me.

However I noticed all of the new natives and functions are missing in the database. I tried adding them myself but now the function list crashes the world editor after a certain amount of entries have been added. I don't think i can get any diagnostics or crash reports, the thing just shuts down.

Could you look into this?

I've added the File with alle the SQL statements for all the missing things from common.j and blizzard.j that were added with reforged and over the past years. This hopefully makes it easier for you to add and troubleshoot.


Another feature that I would love is for an easy way to add a function to the include file. Like if there was a button "save highlighted to include" or something.

Cheers
 

Attachments

  • MissingNativesAndFunctionSQL.txt
    367.8 KB · Views: 162
Level 14
Joined
Dec 12, 2012
Messages
1,007
Hello

Thanks for making this, its really useful to me.

However I noticed all of the new natives and functions are missing in the database. I tried adding them myself but now the function list crashes the world editor after a certain amount of entries have been added. I don't think i can get any diagnostics or crash reports, the thing just shuts down.

Could you look into this?

I've added the File with alle the SQL statements for all the missing things from common.j and blizzard.j that were added with reforged and over the past years. This hopefully makes it easier for you to add and troubleshoot.

Thanks a lot for extracting the missing natives and constants, I will take a look at this issue.

Another feature that I would love is for an easy way to add a function to the include file. Like if there was a button "save highlighted to include" or something.

This is a good idea, I will try to add this option to the context menu.
 
Level 11
Joined
Dec 21, 2012
Messages
373
Hi there again.

Does this work for 1.29 or 1.30 versions? Is the install process same?

I've got version 1.30.4. I extracted the zip, corrected the path but when I open WETESH, it just loads normal WE without tesh functionality.
 
Level 14
Joined
Dec 12, 2012
Messages
1,007
Does this work for 1.29 or 1.30 versions? Is the install process same?

I've got version 1.30.4. I extracted the zip, corrected the path but when I open WETESH, it just loads normal WE without tesh functionality.

The new TESH 2.0 version works only with post-reforged versions of Wc3.

The main reason is that since reforged, the editor is a 64 bit executable and not 32 bit anymore. This required quite some changes in the code base to make TESH work again.

You can still download the old version of TESH 2.0 (pre-reforged), it is included in SharpCraft. You can find it there in the subdirectory:

SharpCraft World Editor Extended Bundle\profiles\Warcraft III - World Editor (WEX)\plugins\tesh.

However, be aware of the following:
  • You will need either Sharpcraft or JNGP to use it, because the old (pre-reforged) TESH 2.0 version is not a standalone extension of the WE but requires a host application (either Sharpcraft or JNGP).
  • There is no support for the old (pre-reforged) TESH 2.0 anymore, I will only continue the new version.
  • Both Sharpcraft and JNGP are no longer supported as well.
Therefore, I would recommend to update to the newest patch and use the latest version of TESH 2.0 whenever this is possible for your project.
 
Last edited:
Level 11
Joined
Dec 21, 2012
Messages
373
The new TESH 2.0 version works only with post-reforged versions of Wc3.

The main reason is that since reforged, the editor is a 64 bit executable and not 32 bit anymore. This required quite some changes in the code base to make TESH work again.

You can still download the old version of TESH 2.0 (pre-reforged), it is included in SharpCraft. You can find it there in the subdirectory:

SharpCraft World Editor Extended Bundle\profiles\Warcraft III - World Editor (WEX)\plugins\tesh.

However, be aware of the following:
  • You will need either Sharpcraft or JNGP to use it, because the old (pre-reforged) TESH 2.0 version is not a standalone extension of the WE but requires a host application (either Sharpcraft or JNGP).
  • There is no support for the old (pre-reforged) TESH 2.0 anymore, I will only continue the new version.
  • Both Sharpcraft and JNGP are no longer supported as well.
Therefore, I would recommend to update to the newest patch and use the latest version of TESH 2.0 whenever this is possible for your project.
Ah, that is sad to hear. Sharpcraft doesn't work for 1.30.4. Thanks for the answer though.
 
Level 9
Joined
Jul 20, 2018
Messages
176
I believe $hex codes are not highlighted correctly.

Снимок экрана 2021-03-09 155725.png

Also is is necessary to mention that //! inject main and //!inject main are different. The former is correct preprocessor command while the latter is just a comment.
 
Level 4
Joined
May 18, 2018
Messages
38
1631118654936.png

These native functions all have "takes" added to the end of them.
I've attached a zip with a version of the database where it's fixed. Just drop it in the data folder and replace the old one.

I also made a dark style loosely based on the vs code theme. Here's what it looks like. If anyone wants it I've attached a zip of that too.
1631119735893.png
 

Attachments

  • styles_vscodedark.zip
    1.8 KB · Views: 89
  • tesh_keywords.zip
    183.5 KB · Views: 66
Level 9
Joined
Jul 20, 2018
Messages
176
I decided to add all natives, functions and constants from the latest WC3 Patch to .db file. I applied @BLOKKADE's fix and also deleted non-existing function BlzDeleteHeroAbility.

Unfortunately, whenever you open function list or go to function definition, WE will silently crash. I suppose it crashes due to too many keywords in the database.
 
Last edited:
Level 9
Joined
Jul 20, 2018
Messages
176
I suppose it crashes due to too many keywords in the database.
I identified the problem. These constants cause WE crash, because they have too long names:

JASS:
constant abilityreallevelfield ABILITY_RLF_MANA_REGENERATION_BONUS_AS_FRACTION_OF_NORMAL = ConvertAbilityRealLevelField('Imrp')
constant unitweaponrealfield UNIT_WEAPON_RF_ATTACK_AREA_OF_EFFECT_MEDIUM_DAMAGE = ConvertUnitWeaponRealField('ua1h')



Changes in the database:
  • applied @BLOKKADE's fix;
  • deleted non-existing function BlzDeleteHeroAbility
  • added all new functions and constants except listed above.
To update database, unpack keywords-1.32.7z into tesh directory.



I someone wonders, I was using this Python 3.9 script to generate updated database.
 

Attachments

  • keywords-1.32.7z
    175.6 KB · Views: 103
Last edited:
Level 3
Joined
Jan 31, 2021
Messages
3
Oh wow thanks Prometheus. When I added the Reforged natives myself, I was pretty bummed not being able to use some of this tools features. This tool makes jass so much more bearable. Using your db file now and its working perfectly. Very much looking forward to any future updates of this. An absolute lifesaver for old maps running on vjass.
 
Level 25
Joined
Feb 2, 2006
Messages
1,689
Hi, I love and need this tool. I am not sure if there is any JASS/vJass IDE out there?

Some thoughts:
  • For me the installation path is C:\Program Files (x86)\Warcraft III\retail\x86_64 but I guess it is different for everyone? For classic you could read a registry entry as well.
  • Why not add this tool to the tools on Hive? It can be rated and downloaded there. I was searching for TESH in the tools and only found the old SharpCraft World Editor Extended Bundle
  • AI scripts are usually imported. Is it possible to somehow modify imported AI scripts with TESH?
  • Highlight the new common.j and Blizzard.j stuff from Reforged like BlzFrameSetTexture etc.
  • Add some context support for the auto completion. For example, suggest function calls only inside of functions and outside only stuff like globals, function etc. You could even support suggestion user-defined functions. I am not sure if there is a real JASS/vJass parser out there for auto completion? I only found this: JAST 1.1.1
  • You could show function/variable info on moving the house on the identifier. For example, moving the mouse over bj_MAX_INVENTORY could show you the type integer and the value of 6 (its definition/declaration). This might help to get some useful information.
 
Level 25
Joined
Feb 2, 2006
Messages
1,689
Thx but why do I have to add it myself is the author of the first post not active anymore? I know JassCraft from the past but I think it only suggests native stuff like this one. A real completion like in IDEs would be nice where it detects syntax errors and your context/local variables etc. but I guess it is too much work and people could use LUA instead.
 
Level 13
Joined
Jun 23, 2009
Messages
299
FYI, even if this version of TESH is made for the Reforged World Editor it loads up 64-bit 1.31.1 World Editor just fine. Thank you for updating this wonderful tool, I've been missing it oh so much lately :grin:

EDIT: It does cause any map you open in that World Editor instance to be instantly marked as modified for some reason but it's no biggie for me
 
Last edited:
Level 9
Joined
Jul 20, 2018
Messages
176
Added new constants and natives from 1.33. To apply update, just unpack archive into TESH directory. An archive also includes original DB as a backup.



Constants below still crash WE, so they are not included.

JASS:
constant abilityreallevelfield ABILITY_RLF_MANA_REGENERATION_BONUS_AS_FRACTION_OF_NORMAL = ConvertAbilityRealLevelField('Imrp')
constant unitweaponrealfield UNIT_WEAPON_RF_ATTACK_AREA_OF_EFFECT_MEDIUM_DAMAGE = ConvertUnitWeaponRealField('ua1h')



I someone wonders, I was using this Python 3.9 script to generate updated database.
 

Attachments

  • keywords-1.33.7z
    241.2 KB · Views: 27
Last edited:
Level 14
Joined
Dec 12, 2012
Messages
1,007
Took a while longer than planed but here is the new update anyway.

Main changes:
JSON files instead of SQLite (makes it easier to add/modiy keywords), added new keywords, Dwelltips, Zinc Highlighting and various bugfixes (search/replace for example should work now again in both directions and the window should not disappear anymore).

Here is an example showing the new dwelltips (function list description on mouse hover):

dwelltip.png


And here is a full list of changes:

Update to Version 0.9.6
  • Changed the database from SQLite to JSON
  • Now three seperate databases are used for standard, string and char keywords
  • Added the new keywords to the database (thanks @Prometheus3375 for updating the old database in the meantime, also thanks to @surfer412 and @BLOKKADE for their preparatory work).
  • Database can now be reloaded through the TESH menu item 'Reload database'
  • Dwell-Tips are now displayed on mouse dwell (can be disabled in the options dialog, thanks @chopinski and @Barade for the suggestion)
  • Improved performance during typing
  • Zinc operators and keywords are now highlighted (can be disabled in the options dialog)
  • Autocomplete window now gets placed correctly even when a calltip which includes newlines is shown at the same time
  • Improved error messages of the host application when required files are not found
  • Fixed a bug that hex numbers starting with a dollar sign were highlighted as textmacro parameters
  • Fixed a bug that textmacro parameters with invalid characters where highlighted as textmacro parameters
  • Fixed a bug that the scroll state was not saved when switching between triggers
  • Fixed a bug that fold information was not saved when switching between triggers
  • Fixed a bug that autocomplete window reopend quickly when holding a letter key
  • Fixed a bug that autocomplete for character keywords was not opened when inside a character followed by a newline
  • Fixed a bug that search and replace now again works in downward direction
  • Fixed a bug that the search and replace window had a different theme than the other windows
  • Fixed a bug of the search and replace window that the window position after reopening the window was wrong (thanks @SmitingDevil for spotting this bug)
  • Fixed a bug that changing the "Function list always on top" option could lead to a wrong parent window of the function list
  • Fixed a bug that long keywords like ABILITY_RLF_MANA_REGENERATION_BONUS_AS_FRACTION_OF_NORMAL could crash TESH when opening the function list
  • Fixed a bug that holding the CTRL key did not trigger hotspots without mouse move
  • Fixed a bug that the background of the options window was not uniform in color
 
Last edited:
Level 14
Joined
Dec 12, 2012
Messages
1,007
Awesome update! Scroll positions are restored again and the performance feels much better. The tool could also restore the cursors position in a line when going back into a trigger with code. At the moment the correct position in the view is shown again but I have to click inside the line again.

Thanks for the feedback. I thought about such a feature as well (a while ago), but the problem is that it breaks navigation through the treeview with the arrow keys. If you want to use the up/down arrow keys to switch through your triggers, the treeview has to keep the focus for that. If you set the focus to the edit window, pressing up/down again wont select the next/previous trigger in the treeview but instead move the caret one line up/down. Since this would be quite counterintuitive (and potentially annoying for people that like to navigate through the treeview using the arrow keys), I decided to not implement such a feature back then.
 
Thanks for the feedback. I thought about such a feature as well (a while ago), but the problem is that it breaks navigation through the treeview with the arrow keys. If you want to use the up/down arrow keys to switch through your triggers, the treeview has to keep the focus for that. If you set the focus to the edit window, pressing up/down again wont select the next/previous trigger in the treeview but instead move the caret one line up/down. Since this would be quite counterintuitive (and potentially annoying for people that like to navigate through the treeview using the arrow keys), I decided to not implement such a feature back then.

I've the same bug as SmitingDevil where sometimes (happened 3x times today) the code of the first vJass trigger is copy/pasted in the game "Custom Script Code" header, resulting in compilation error because of duplicate definitions.

However I have no idea of a reproducible scenario. I produced it with 2 different maps. I don't know what usefull information about the bug I could give you :S
 
Top