• 🏆 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

Cokemonkey11

Spell Reviewer
Level 29
Joined
May 9, 2006
Messages
3,534
Level 14
Joined
Dec 12, 2012
Messages
1,007
Hi,

So, what would it take to make this thing compatible to the 1.26 version of the world editor?

Most likely an update to grimoire (since TESH is injected via grimoire). I don't know how difficult that task would be though.

what exactly is the 1.26 Version of the world editor? I only know the latest Patch for TFT which is Version 1.26 (which I use). However, my WE is Version 1.21b - Is there a seperated patch just for the WE which isn't automatically applied when installing the latest patch for Wc3? And is this an official patch?
 
Level 5
Joined
May 6, 2013
Messages
125
Hi,
what exactly is the 1.26 Version of the world editor? I only know the latest Patch for TFT which is Version 1.26 (which I use). However, my WE is Version 1.21b - Is there a seperated patch just for the WE which isn't automatically applied when installing the latest patch for Wc3? And is this an official patch?

Not sure how the versions history looks like, i bought warcraft 3 the day that the 1.26 patch came out, and my world editor calls itself "version 1.26" (6059, which i asume is the build number) in the help page; the only other version number i've ever came across is "version 7" (which is what the editor tells itself while saving a map), and since integer version numbers sort of blow, i went with the 1.26.

Most likely an update to grimoire (since TESH is injected via grimoire). I don't know how difficult that task would be though.

updating the entire grimoire library would surely be a lot of work, but i guess TESH doesn't need all of its features, does it? Just looking through the grimoire manual, i guess most of the functions are probably not required (testmap with cmd line, -window and -opengl parameter, -run, which probably doesn't work anymore to begin with, doodad limit and map sizes, oe hack, all doesn't seem like its needed for TESH), and the ones that seem to be (clickevent, compilemap, disable normal WE syntax checker, and most likely some way to add a menu point, which is a feature i don't even see in the manual) should be fairly easy to do for me, as I've already spent quite a few days finding these things.
 
Level 14
Joined
Dec 12, 2012
Messages
1,007
no, but the jngp uses the older version(1.21) of the editor for some reason

Ok, I didn't know that... Have to check later.

updating the entire grimoire library would surely be a lot of work, but i guess TESH doesn't need all of its features, does it? Just looking through the grimoire manual, i guess most of the functions are probably not required (testmap with cmd line, -window and -opengl parameter, -run, which probably doesn't work anymore to begin with, doodad limit and map sizes, oe hack, all doesn't seem like its needed for TESH), and the ones that seem to be (clickevent, compilemap, disable normal WE syntax checker, and most likely some way to add a menu point, which is a feature i don't even see in the manual) should be fairly easy to do for me, as I've already spent quite a few days finding these things.

Actually I don't use grimoire at all, I made all this stuff on my own. I just need someone who loads the dll on start-up, nothing else.

However, does JNGP itself work with this WE-Version? Because if not it wouldn't make sense to use a TESH in the first place if vJass itself doesn't work, right?
 
Level 5
Joined
May 6, 2013
Messages
125
However, does JNGP itself work with this WE-Version? Because if not it wouldn't make sense to use a TESH in the first place if vJass itself doesn't work, right?

It doesn't, as the version grimoire is made for (1.21, iirc), has quite a lot of differences in its binary (it seems to me that somewhere between 1.21 and 1.26, blizzard must have found the /O parameter of their compiler).

Not that adding vJass compatibility would be too much to do (i'D say about 1 or 2 hours of work), but i can't use vJass anyway. I'm currently working at a 2 (or 2 and a half) man project, and my partner doesn't want to use jngp or vJass. (not that i have a problem with that, i like the challange.) Since I've replicated most of the jngp features (and even features that jngp doesn't have) on my own, the only real thing missing for me right now is a syntax highlighter, so i hoped for a way to port this one (cause it looks pretty damn awesome).
 
Level 14
Joined
Dec 12, 2012
Messages
1,007
It doesn't, as the version grimoire is made for (1.21, iirc), has quite a lot of differences in its binary (it seems to me that somewhere between 1.21 and 1.26, blizzard must have found the /O parameter of their compiler).

Not that adding vJass compatibility would be too much to do (i'D say about 1 or 2 hours of work), but i can't use vJass anyway. I'm currently working at a 2 (or 2 and a half) man project, and my partner doesn't want to use jngp or vJass. (not that i have a problem with that, i like the challange.) Since I've replicated most of the jngp features (and even features that jngp doesn't have) on my own, the only real thing missing for me right now is a syntax highlighter, so i hoped for a way to port this one (cause it looks pretty damn awesome).

Alright, in principle it should work without any problems. If you "replicated" (what do you mean with that, actually?) JNGP you also hooked into the WE, right? Because then you could just load the tesh.dll which should automatically do the rest. Did you try that?
 
Level 5
Joined
May 6, 2013
Messages
125
(what do you mean with that, actually?)

I just made my own version of the most important functions (-window on testmap startup, custom menu entries, custom exe execution on map compile etc.)

Alright, in principle it should work without any problems. If you "replicated" (what do you mean with that, actually?) JNGP you also hooked into the WE, right? Because then you could just load the tesh.dll which should automatically do the rest. Did you try that?

I tried it, but just loading it into the process memory doesn't seem to do the trick (i can see the dll in the process memory, but it doesn't seem to change anything), so i figured there would be some sort of dependencies on features of jngp (like, special dlls with special functions that have to be loaded beforehand.)
 
Level 14
Joined
Dec 12, 2012
Messages
1,007
I just made my own version of the most important functions (-window on testmap startup, custom menu entries, custom exe execution on map compile etc.)

Hm ok, but what advantages over the standard JNGP do you get by this? I mean why not just use JNGP without using vJass keywords while coding? This way you could use everything normal and your partner would be happy too because he couldn't even notice the difference.


I tried it, but just loading it into the process memory doesn't seem to do the trick (i can see the dll in the process memory, but it doesn't seem to change anything), so i figured there would be some sort of dependencies on features of jngp (like, special dlls with special functions that have to be loaded beforehand.)

Does it also load the hook.dll? Because internal the tesh.dll should load the hook.dll, otherwise it won't work.
 
Level 5
Joined
May 6, 2013
Messages
125
Hm ok, but what advantages over the standard JNGP do you get by this? I mean why not just use JNGP without using vJass keywords while coding? This way you could use everything normal and your partner would be happy too because he couldn't even notice the difference.

I'm not sure if and what jngp might shatter when opening a map done with a newer editor, i only see the "this map was created with a newer version, some features might get lost" message, which is kind of scary, and would also be hard to track down as a possible source of errors.

Does it also load the hook.dll? Because internal the tesh.dll should load the hook.dll, otherwise it won't work.

Doesn't seem to get loaded. I assume the init function fails at some point, but i wouldn't know how to find out where as of right now, as i would have to write an injection routine first (currently i just ask my debugger to gently inject it)
 
Level 14
Joined
Dec 12, 2012
Messages
1,007
Doesn't seem to get loaded. I assume the init function fails at some point, but i wouldn't know how to find out where as of right now, as i would have to write an injection routine first (currently i just ask my debugger to gently inject it)

I just tried it with the 1.26 Editor and in principle it works without any problems. However what is a problem is that in this version of the editor the trigger-window isn't named "Trigger Editor" but has some locale name. As the tesh.dll must identify the trigger editor window before it can proceed, it won't work if there is no such window. Whats the exact name of your trigger editor window?

At the moment you can't configure the search string for the window unfortunatly, I will make it configurable in one of the next updates.

Until then you could try to use some Windows API to change the name of the Window. Use something like:

SendMessage(trigger_editor_window, WM_SETTEXT, 0, reinterpret_cast<LPARAM>("Trigger Editor")); // From Windows.h

where "trigger_editor_window" is the handle of your trigger editor window (you could get that with Spy++ for example).
 
Level 5
Joined
May 6, 2013
Messages
125
However what is a problem is that in this version of the editor the trigger-window isn't named "Trigger Editor" but has some locale name.

My local name is "Auslöser-Editor". Works like a charm if you change it to Trigger Editor. Thx a lot :D

Guess you wouldn't need to change the search string as nobody except me would want to use it without jngp anyway.

edit: still can't rep you. that rep system really needs a rework ._.
 
Level 14
Joined
Dec 12, 2012
Messages
1,007
My local name is "Auslöser-Editor". Works like a charm if you change it to Trigger Editor. Thx a lot :D

Guess you wouldn't need to change the search string as nobody except me would want to use it without jngp anyway.

Thats great to hear :)

So if you find bugs/have suggestions/feedback just put it here ;)

But I will definitly make the search string configurable, just in case.
 
Level 14
Joined
Dec 12, 2012
Messages
1,007
So it works independently of Grimoire, right?

Yes, exactly. Actually it is completely stand-alone, so maybe I will include an .exe to the next release so that people who just use the vanilla editor can use it directly too.

Sorry for spreading the misinformation. I'll go stand in a corner now.

Hey thats no problem, no need for doing so :D

I actually never documented that anywhere, so how should you (or anyone else) know ;)
 
Level 14
Joined
Dec 12, 2012
Messages
1,007
How is the class not unique? the whole idea of classes it that they are unique.

The Trigger Editor Window has the class "#32770" (you can check that with Spy++ for example).

Unfortunatly, the Object Editor Window for example also has "#32770". Same with lets say the Sound Editor Window, and so on. So how should I differentiate between those windows?
 
Level 14
Joined
Dec 12, 2012
Messages
1,007
Meaby this is parent class for editor windows (trigger, sound, object etc.), rather than the child one.

It is the class ID of the window, the child windows are only the controls on the window. Even their class atoms are equal, therefore its not possible to use the class information to differentiate between those windows. They both belong to the exact same class.
 
Level 3
Joined
Dec 30, 2010
Messages
53
0.8.5 seems to be slow when opening dialogs and sometimes it looks like it enters an unfinite loop and the trigger editor starts blinking. First time it happened when I opened the object editor, subsequent times it happened when opening a dialog in the trigger editor e.g. when trying to edit the message of a "Game - Display message" action.
This is on a Windows 8 netbook with JNGP 2.0.7.
 
Level 14
Joined
Dec 12, 2012
Messages
1,007
0.8.5 seems to be slow when opening dialogs and sometimes it looks like it enters an unfinite loop and the trigger editor starts blinking. First time it happened when I opened the object editor, subsequent times it happened when opening a dialog in the trigger editor e.g. when trying to edit the message of a "Game - Display message" action.
This is on a Windows 8 netbook with JNGP 2.0.7.

Hi, what you mean with "slow"? The window takes a long time to open but then it does open or do you mean it really enter an "infinite loop" (which would mean that the Editor freezes completly)?

If it just takes some time to open: Are you sure this is TESH related? Because on my PC it also takes quite some time to open the Object Editor for the first time, even without any TESH.
 
Level 22
Joined
Sep 24, 2005
Messages
4,821
I think he means the redraw rate(? dunno how it's called sorry) of the trigger editor window when your TESH is being used. I noticed the screen flickering too even when the Trigger Editor is on the background, though in my case, its not that bad.
 
Level 14
Joined
Dec 12, 2012
Messages
1,007
I think he means the redraw rate(? dunno how it's called sorry) of the trigger editor window when your TESH is being used. I noticed the screen flickering too even when the Trigger Editor is on the background, though in my case, its not that bad.

Ok, when exactly does that happen?

You have the trigger editor window open and in the background - does it now flicker all the time or only if you do some specific actions on the foreground windows (if yes, which actions and which windows). Does this flicker always occure or only sometimes? What flickers exactly, the code window only or the whole trigger editor window?

And whats your system specs?
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
If it just takes some time to open: Are you sure this is TESH related? Because on my PC it also takes quite some time to open the Object Editor for the first time, even without any TESH.

that is because the first time you open object editor it will try to read everything from the mpq archives stored on your hard drive to the ram, so it can show the default data to you, which is kind of slow considering it loads quite good amount of stuff(SSD would speed this up a bit)
 
Level 14
Joined
Dec 12, 2012
Messages
1,007
that is because the first time you open object editor it will try to read everything from the mpq archives stored on your hard drive to the ram, so it can show the default data to you, which is kind of slow considering it loads quite good amount of stuff(SSD would speed this up a bit)

Yes, but this lag is not TESH related because it also happens if you don't use any TESH at all.
 
Level 22
Joined
Sep 24, 2005
Messages
4,821
Ok, when exactly does that happen?

You have the trigger editor window open and in the background - (a)does it now flicker all the time or (b)only if you do some specific actions on the foreground windows (if yes, which actions and which windows). Does this flicker always occure or only sometimes? What flickers exactly, (c) the code window only or the whole trigger editor window?

(d) And whats your system specs?

(a) and (b) No, I haven't extensively tested it but I reproduced it when I tried to open a child window on the scenario menu > Map Descriptions, all tabs flicker on click (when active), but not indefinitely, just when the window isn't entirely drawn yet, when the window is already drawn the flickering stops. It looks like a screen tear (like when v-sync is disabled). Sorry I can't get a screenshot, it's not that long when it appears, maybe half or thirds of a second. Also, the rendering of the window is a bit slowed. I tried rolling back to the default tesh and that issue didn't appear.

(c) Only on the child window I open, the main editor window doesn't flicker.

(d) My PC is fucking old, anyway:

sysspecs.png


The video card's memory is 512 on AGP bus (hahahaha XD)
 
Level 14
Joined
Dec 12, 2012
Messages
1,007
(a) and (b) No, I haven't extensively tested it but I reproduced it when I tried to open a child window on the scenario menu > Map Descriptions, all tabs flicker on click (when active), but not indefinitely, just when the window isn't entirely drawn yet, when the window is already drawn the flickering stops. It looks like a screen tear (like when v-sync is disabled). Sorry I can't get a screenshot, it's not that long when it appears, maybe half or thirds of a second. Also, the rendering of the window is a bit slowed. I tried rolling back to the default tesh and that issue didn't appear.

Ok, with this information I can reproduce the behavior. It doesn't flicker for me, but it takes way longer to open the window if the TESH is active which shouldn't happen.

Thanks for reporting and the description, I need to investigate this (never noticed this before).
 
Level 3
Joined
Dec 30, 2010
Messages
53
Hi, what you mean with "slow"? The window takes a long time to open but then it does open or do you mean it really enter an "infinite loop" (which would mean that the Editor freezes completly)?

If it just takes some time to open: Are you sure this is TESH related? Because on my PC it also takes quite some time to open the Object Editor for the first time, even without any TESH.
I'm not talking about the delay in opening the object editor. Clicking the message on the "Game - Text Message" dialog takes considerably more time in 0.8.5 than it does in 0.8.0 and sometimes the window freezes trying to redraw the dialogs. I'd post a video but my connection is really bad here.
 
Level 14
Joined
Dec 12, 2012
Messages
1,007
I'm not talking about the delay in opening the object editor. Clicking the message on the "Game - Text Message" dialog takes considerably more time in 0.8.5 than it does in 0.8.0 and sometimes the window freezes trying to redraw the dialogs. I'd post a video but my connection is really bad here.

Alright, I will take a look at this ASAP.
 
Level 3
Joined
Dec 30, 2010
Messages
53
Pressing "Spaces to Tabs" or "Tabs to Spaces" duplicates the character that is right after the caret.
e.g Tes|t --> "Spaces to Tabs" --> Tes|tt

Also about the previous bug, I could post a video from my netbook if you want. On my desktop it doesn't "freeze", and I wouldn't even notice the delay if I didn't know about it. On my netbook that has a 1Ghz processor sometimes it seems as if it tries to re-draw the window if it takes too long to draw it leading in to something that looks like an infinite loop.
 
Level 14
Joined
Dec 12, 2012
Messages
1,007
Pressing "Spaces to Tabs" or "Tabs to Spaces" duplicates the character that is right after the caret.
e.g Tes|t --> "Spaces to Tabs" --> Tes|tt

Nice find, you are right. At least easy to fix this one ;)

Also about the previous bug, I could post a video from my netbook if you want. On my desktop it doesn't "freeze", and I wouldn't even notice the delay if I didn't know about it. On my netbook that has a 1Ghz processor sometimes it seems as if it tries to re-draw the window if it takes too long to draw it leading in to something that looks like an infinite loop.

Video would be nice if thats no problem for you, the more infos I get the easier I can fix issues. Especially with such redrawing issues.

technical question, when I press tab, do I actually get \t placed to the document, or you do the same shitty trick that the old tesh does(4 spaces)?

You get \t placed in the document.
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
great news for me. Because with the old tesh you will get 4 spaces and with normal editor you cant even insert it without copying it from clipboard, yet '\t\t\t\t' is valid Jass(not \t but with tab, just to symbolize it, funny enough, '\t' is still valid, but you cant place anything behind the t. The same goes for n)
 
Level 3
Joined
Dec 30, 2010
Messages
53
If you select "TESH --> Options..." and a custom text script is loaded the editor freezes as soon as it displays the dialog "Options are not yet implemented".
Not a priority but still an annoyance.
(You can still unfreeze it if you right click the button of the dialog in the task bar and select Close)
 
Level 14
Joined
Dec 12, 2012
Messages
1,007
If you select "TESH --> Options..." and a custom text script is loaded the editor freezes as soon as it displays the dialog "Options are not yet implemented".
Not a priority but still an annoyance.
(You can still unfreeze it if you right click the button of the dialog in the task bar and select Close)

Hm, yes you are right. Seems to only happen in Release Mode, when I tested it in Debug Mode everything works... My todo list is getting longer :D

great news for me. Because with the old tesh you will get 4 spaces and with normal editor you cant even insert it without copying it from clipboard, yet '\t\t\t\t' is valid Jass(not \t but with tab, just to symbolize it, funny enough, '\t' is still valid, but you cant place anything behind the t. The same goes for n)

Yes, actually I don't know why the old TESH does this, because the default behavior of Scintilla isn't like this. Therefore I think "its a feature, not a bug" ;)
 
Level 3
Joined
Dec 30, 2010
Messages
53
On varsion 0.3 changelog it says:
- Added a filter for the //TESH.scrollpos=85 thing of the old tesh
but in version 0.8 and 0.8.5 (dunno about previous versions) lines like:
Code:
//TESH.scrollpos=13
//TESH.alwaysfold=0
appear in custom scripts.
 
Level 14
Joined
Dec 12, 2012
Messages
1,007
On varsion 0.3 changelog it says:

but in version 0.8 and 0.8.5 (dunno about previous versions) lines like:
Code:
//TESH.scrollpos=13
//TESH.alwaysfold=0
appear in custom scripts.

You are right, in version 0.8 when I fixed the bug with the korean chars I completly reworked the text sending process. The filter seems not to work with this new technique, I will re-implement it in the next version.

Thanks for the bug report.
 
Level 3
Joined
Dec 30, 2010
Messages
53
There was a script that started with:
Code:
//TESH.scrollpos=223
//TESH.alwaysfold=0

After saving it transformed into:
Code:
?kh?[(crollpos=223
//TESH.alwaysfold=0

I can't reproduce it, but it has already happened twice, and another time the script vanished completely and was replaced with a 0.
No idea what could be causing this (I'm not even sure it has anything to do with TESH) but my guess is that it is related to the localization support change.
I stumbled into this again and I still don't know how to reproduce it. I pasted a trigger category (a folder) into a test map, added some lines into a custom script, then selected some other custom scripts (and I think I disabled some of them) and when I went back to the custom script I had edited all the code was missing, the only thing left was a question mark "?".
I tried to get the code back by using undo but it didn't work. I reached the point before pasting the trigger category then used redo, it re-pasted the trigger category, then disabled the triggers I had disabled but the code in the trigger I had edited was the one from the paste and didn't contain any of the changes.
 
Level 4
Joined
Jun 28, 2009
Messages
46
Hi looking_for_help. Thank you for this cool plugin. However I want it be able to auto-complete custom functions, methods, variables, structs.

Say I have

JASS:
public struct MyStruct
    static integer count
    integer val

    static method start takes nothing returns nothing
        call DoNothing()
    endmethod
endstruct

public function MyFunction takes nothing returns nothing
endfunction

And it should be:

JASS:
MyS
   truct

local MyStruct ms = MyStruct.create()
local integer n = MyStruct.
                           count

local integer v = ms.
                     val

call My
       MyFunction()

call MyStruct.
              create()
              start()

I hope I had made myself clear.

I think there would be a huge load of work to do but I really need it.
Because in a larger project, every time when I call my functions or use my structs, I have to go back in the source code to see what functions and methods I have created.
I know it's always been good to document and comment well to avoid such situation, but you still need to navigate back and check the comments right? To select methods and member variables available from a dropdown list could not be any cooler!
Hope you could add this in the next release. Cheers:)
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
your dropdown idea is insane in complexity. It most likely isnt even feasible to do, because even bigger IDEs like Visual Studio or Code::Blocks only support class-wide highlightning not class-specific type-wide highlightning, and this way you would actually need to know that before MyStruct. is integer variable to only highlight integers.

However LFH said multiple times in past that he would like to make autocomplete for custom user types/functions etc, but my guess would be he has been busy irl and also it is still pretty hard to do, because you need to parse the whole script while typing to see what is function etc.
 
Level 14
Joined
Dec 12, 2012
Messages
1,007
Hi looking_for_help. Thank you for this cool plugin. However I want it be able to auto-complete custom functions, methods, variables, structs.

...

Hope you could add this in the next release. Cheers:)

Hi,

yes, I want to add this feature too, but its basically what edo said. And at the moment there are still some small bugs and the option dialog is still missing, so those have priority for now.

I'm also not yet sure whether this is even possible at all (with a reasonable performance), because I'm still searching for an efficient way to access the text of non-selected triggers. Without this, an intellisense could just parse the code of the currently selected trigger and wouldn't take into account the symbols defined in other translation units. So it would be quite worthless.

So this feature might come in the future, but don't expect it too soon.
 
Level 4
Joined
Jun 28, 2009
Messages
46
Thank you for your replies @edo494 & @looking_for_help. I knew such feature can't be missed long ago before you create TESH. There must be some reason not to implement it and today I got it confirmed.

I will be looking for alternative approaches like the eclipse plugin Xtext DSL + Cjass #import feature or WurstScript by Frotty. DSL is still too hard for me to learn and WurstScript is too late to be introduced lol (it would take me ages to translate my Vjass and Zinc to WurstScript).

Anyways, thank you for your reply and... I'll be back with my fat and heavy codez, and test my tolerance.
 
Top