Hello!
I've started using Sublime instead of the default AppGameKit editor and came across the old thread:
https://forum.thegamecreators.com/thread/206696 and I thought that I would share with you my updated syntax (.tmLanguage) file for the AppGameKit package.
To use it, simply download the sublime package from the thread I linked up here ^, open it with winrar, and replace the "AGK.tmLanguage" file with the one linked on this post
The supplied syntax file is for build "2017.01.09" of the AppGameKit compiler.
For future reference
Updating the commands in the syntax file is rather easy, follow these steps:
1) Go to the help documentation for AGK and open up the "Index of commands"
2) Copy the entire list of commands into a text editor (word for example)
3) Select all the text in the file, enable and then disable the "Bullet list" option to get rid of the bullet points
4) Save the file as a plain .txt file
Then create a new AppGameKit project and call it something like "SyntaxFileCreator" and use the following code:
// Project: SyntaxFileCreator
// Created: 2017-01-25
// show all errors
SetErrorMode(2)
// set window properties
SetWindowTitle( "SyntaxFileCreator" )
SetWindowSize( 1024, 768, 0 )
// set display properties
SetVirtualResolution( 1024, 768 )
Line As String
Stri As String
Char As String
If GetFileExists ( "output.txt" ) Then DeleteFile ( "output.txt" )
OpenToRead(1,"functions.txt")
While FileEOF ( 1 ) = 0
Line = ReadLine(1)
Stri = " <dict>" + Chr ( 13 ) + Chr ( 10 ) + " <key>match</match>" + Chr ( 13 ) + Chr ( 10 ) + " <string>\b"
For i = 1 To Len ( Line )
Char = Mid ( Line , i , 1 )
If Val ( Char ) <> 0
Stri = Stri + Char
Else
Stri = Stri + "[" + Upper ( Char ) + Lower ( Char ) + "]"
EndIf
Next i
Stri = Stri + "\b</string>" + Chr ( 13 ) + Chr ( 10 ) + " <key>name</key>" + Chr ( 13 ) + Chr ( 10 ) + " <string>entity.name.function</string>"+ Chr ( 13 ) + Chr ( 10 ) + " </dict>"+ Chr ( 13 ) + Chr ( 10 )
OpenToWrite ( 2 , "output.txt" , 1 )
WriteString(2,Stri)
CloseFile (2)
EndWhile
CloseFile(1)
Now follow these final steps:
1) Open the default write-directory for AGK apps and copy the contents of the "output.txt" file
2) Open up the AGK.tmLanguage file the AGK package for sublime (again, use WinRAR to open it)
3) Paste the contents of the "output.txt" file over all the blocks in the xml that look like this: (have "keyword.source.agk")
<dict>
<key>match</key>
<string>\b[Aa][Nn][Dd]\b</string>
<key>name</key>
<string>keyword.source.agk</string>
</dict>
4) Save the file and restart sublime!
cheers