Update TESH and add your own functions.

Level 22
Nov 14, 2008

TESH Tutorial

by baassee

This is just a simple tutorial how to add your own functions so they get highlighted by TESH

Yet I have to tell you this right here and now that this tutorial contains some materials from a site which I can't mention because it isn't allowed. Most coders know this site especially Russians (I think you know where I am going right now). So I will just upload the files needed into a ZIP and I give full credit to the authors which I can't mention due to what was said above. If I can get this approval by an admin to upload these files as they are very useful I would be glad, else I will just delete the "update" part of this tutorial.

I have spoken with TriggerHappy about this and he said no, so I removed the other part.


JASS NewGen Pack installed. Link

Common sense of browsing in your computer.

Useful Links:


How to open 7z files.

Make your own highlight functions for TESH

As you might have seen there is a "included" folder inside the TESH folder. This folder is used for if you want to make custom highlight for your functions.

Step 1

First you'll open JNGP and convert a new trigger into custom text or you do this in a normal text editor like word/notepad or just within a THW JASS tag like I will do.

You have to decide what functions you will use, I will use the API of GroupUtils, TimerUtils and SimError, very common libraries.

We look up there functions and rewrite them in our JASStag or editor like this:


function NewGroup takes nothing returns group
	//local group g = NewGroup()

function ReleaseGroup takes group g returns boolean
	//call ReleaseGroup(g)

function GroupRefresh takes group g returns nothing
	//call GroupRefresh(g)

function GroupEnumUnitsInArea takes group whichgroup, real x, real y, real radius, boolexpr filter returns nothing
	//call GroupEnumUnitsInArea(g, 0., 0., 300., null)

function GroupUnitsInArea takes group whichgroup, real x, real y, radius returns nothing
	//call GroupUnitsInArea(g, 0., 0., 300.)


function NewTimer takes nothing returns timer
	//Get a timer (alternative to CreateTimer)
	//set t = NewTimer()

function ReleaseTimer takes timer t returns nothing
	//call ReleaseTimer(t)

function SetTimerData takes timer t, integer value returns nothing
	//call SetTimerData(t, 2)

function GetTimerData takes timer t returns integer
	//Get the timer's value.
	//You can assume a timer's value is 0 after NewTimer.

//Sim Error

function SimError takes player ForPlayer, string msg returns nothing
	//ForPlayer : The player to show the error
	//msg       : The error msg

Step 2

Copy this into a text editor file and change the name of the file to "CommonFunctions.j". This will give you an error that you might screw this up when you change the format, ignore this, it wont.

Remember when you add your custom highlights, the text files have to be converted into .j files else it won't work!

Step 3

Save the file and move it into the "include" folder inside the Tesh folder.

Step 4

Open up JNGP and open the function list and there it is!


And this is how it will look like when you code!


Also it will show your arguments!


Now you're done!

Some known issues which I can't solve.

-Adding your own natives into TESH (like with RTC), you can't highlight these as inserting it as a normal native in the function list, it wont show.

native Yournative takes arguments returns stuff, wont show

Solution to that is to make your "custom native" a function which takes the same as the native.

function Yournative takes arguments returns stuff

-I suppose this only works with .j files, if anyone know more please just reply.
Last edited by a moderator:
Level 22
Nov 14, 2008
Nice stuff. This is mentioned in the readme/manual of TESH, but this tutorial explains it better. Good job, ~approved.

I'm going to set this as [misc] though, because it deals with an external program relating to WE.

Thanks :)

Alright, didn't acutally know which I was going to set :p can you just rename it to "How to add your own functions in TESH"? As I removed the update part.