gta2mis gta2gci gta2mmp Syntax Highlighting for Notepad++

Anything to do with GTA1/GTA2 modding (tools, scripts and more).
Post Reply
User avatar
elypter
Immortal
Posts: 1120
Joined: 26 Dec 2009, 23:53
GH nick: elypter

gta2mis gta2gci gta2mmp Syntax Highlighting for Notepad++

Post by elypter »

most of the time i do scripting with notepad++
So yesterday i made a syntax highlighting for .mis files and consider it as a very handy way to work with those usually long and repeating .mis files
You can hide if, while, ... structures and also something that i added: "//{" & "//}" and "//:" that can be used in combination with SUBs which close with RETURN.
This way you can structure the code and only display what you are working right now

EDIT: i added .mmp and .gci file highlighting and some missing keywords to gta2mis

gta2mmp
BLACK: Version1
BLUE: Version2
GREEN: Version3
grey: comment

gta2mis
RED: START BLOCK
ORANGE: END BLOCK
LIGHT RED: META
BLACK: COMMAND
BLUE: DECLARES, CREATES, STORES and TEMPLATES
GREEN: CHECKS
green: numbers
gray: COMMENT
gray with background: MULTILINE COMMENT

gta2gci
GREEN: floats
green: integers
RED: {value}
BLUE: {carname}
grey: comment

//the gci syntax highlighting is a bit buggy because np++ doesn't support keywords with spaces in it

copy userDefineLang.xml to %APPDATA%\Notepad++\
if this doesn't work you can add the content of the file to langs.xml to add it as native language
then you can select gta2mis in the language menu

you could open this mis file for testing(current development version of tiny tiny town - army):
http://test.gta2.square7.net/tyty_army.mis

this contains a complete list of all scripting commands (at least it should). So there might be errors in it. please tell me if you find one.
userDefineLang_orig.xml has more categories for commands but it is not working due to a limitation of n++
Attachments
gta2mis_lang_for_Notepad++.zip
(6.47 KiB) Downloaded 728 times
scripting.jpg
Last edited by elypter on 25 Dec 2010, 19:25, edited 12 times in total.
yur sa'nok ngeyä
Razor
Lunatic
Lunatic
Posts: 456
Joined: 19 Jul 2008, 14:14
GH nick: Razor, R
Location: Poland / Szczecin
Contact:

Re: gta2mis Syntax Highlighting for Notepad++

Post by Razor »

well done :) try to do colored mis syntax to this board :)
User avatar
elypter
Immortal
Posts: 1120
Joined: 26 Dec 2009, 23:53
GH nick: elypter

Re: gta2mis Syntax Highlighting for Notepad++

Post by elypter »

i looked around a bit to see how it could be done. for forums there seem to be 2 major frameworks:
GeSHi:
http://qbnz.com/highlighter/
http://www.phpbb.com/community/viewtopi ... &t=2096992
http://www.phpbbstyles.co.uk/info/viewt ... p?f=6&t=39

SyntaxHighlighter:
http://alexgorbatchev.com/SyntaxHighlighter
http://alexgorbatchev.com/SyntaxHighlig ... ustom.html
http://www.undermyhat.org/blog/2009/09/ ... ighligher/
http://custom.simplemachines.org/mods/i ... p?mod=2109

but unfortunately none of these supports code folding which in my opinion is the most important feature with .mis files.
yur sa'nok ngeyä
User avatar
Cuban-Pete
Immortal
Posts: 909
Joined: 29 Jan 2010, 15:03
GH nick: Cuban-Pete

Re: gta2mis Syntax Highlighting for Notepad++

Post by Cuban-Pete »

I don't code that much GTA2, but it looks very handy. I'll keep it in mind, thanks. :)
"Mmmm, your eyes are so beautiful."
User avatar
elypter
Immortal
Posts: 1120
Joined: 26 Dec 2009, 23:53
GH nick: elypter

Re: gta2mis Syntax Highlighting for Notepad++

Post by elypter »

i added highlighting for mmp and gci files
yur sa'nok ngeyä
BenMillard
Immortal
Posts: 889
Joined: 16 May 2009, 06:14
GH nick: BenMillard
Location: London, UK
Contact:

It mostly works well but is not complete

Post by BenMillard »

This year I started using Notepad++ for writing HTML and CSS instead of my own editor. Highlighting is great but I change all the colours to Mozilla style, based on the way "View Source" looks in Firefox.

I turn off code folding, bookmarks and nearly all the 'dynamic' or 'smart' features, although I keep matching tags so the nesting lines light up a bit. I deviate from that by avoiding bold, italics and using the Consolas as the font instead of Courier New.

I've just tried out your highlighter by adding it to my user defined language. (I had already added .htaccess highlighting.) This might be what I switch to instead of MisPad 1.8.0.3 but...is there a one-button way to compile from it on Windows 7?

It mostly works fine but some keywords don't get the right styler colour. For example, the code folding list contains DO which seems to stop DONT_DROP from getting the right styler.

It doesn't include keywords for the hundreds of constants defined in GTA. Object names, radio station names and sounds are the most obvious. It also doesn't include END or special values like NO_TRAIN.

For some reason Notepad++ doesn't apply number styling to my co-ordinates either. Any ideas?

I'm using the 6.3.2 version of it.
User avatar
elypter
Immortal
Posts: 1120
Joined: 26 Dec 2009, 23:53
GH nick: elypter

Re: gta2mis gta2gci gta2mmp Syntax Highlighting for Notepad+

Post by elypter »

the problem with syntax highlighting in npp is that only a very limited amount of different things can be highlighted differnetly. maybe this has been changed in newer versions. i also remembera problem with multiline comments.

if you find a way to add the argument keywords without deleting other stuff that would be great. i was pretty annoyed that i wasnt able to add them.

about the codefolding stuff: i remember adding something so i could use codefolding for jumps like if they were functions. i used this in one or two of my maps. not sure if thats the problem or if its just a bug that i fixed later and forgot to update.

for compilation when working with npp i used the regular dma compiler and a batch file to delete the temp files.
yur sa'nok ngeyä
BenMillard
Immortal
Posts: 889
Joined: 16 May 2009, 06:14
GH nick: BenMillard
Location: London, UK
Contact:

Re: gta2mis gta2gci gta2mmp Syntax Highlighting for Notepad+

Post by BenMillard »

There are 2 or 3 empty boxes for more keywords.

From the menu, go to Language > Define Your Language. Open the User language list and select gta2mis. Change to the Keywords Lists tab and there are 8 groups to choose from.

I only use one colour for commands, another for constants.
User avatar
elypter
Immortal
Posts: 1120
Joined: 26 Dec 2009, 23:53
GH nick: elypter

Re: gta2mis gta2gci gta2mmp Syntax Highlighting for Notepad+

Post by elypter »

il check that out when im back on my desktop. maybe they really improved it slightly
yur sa'nok ngeyä
User avatar
B-$hep
Immortal
Posts: 568
Joined: 24 Apr 2009, 21:43
GH nick: B-Shep
Location: EU

Re: gta2mis gta2gci gta2mmp Syntax Highlighting for Notepad+

Post by B-$hep »

So nobody uses Scriptpad?
Great, i will ask Sektor to delete the topic and i will stop working on it.


Dunno whats wrong, lots of stuff can be added that npp doesnt support, plus it has folding.

etc etc..
Forget it then. Forget about anything i made.

So thankful community. Work and work and they just use npp.


Bye..
Always wear safety glasses while programming.
User avatar
T.M.
Immortal
Posts: 960
Joined: 29 Jan 2010, 15:00
Location: F21B3EED

Re: gta2mis gta2gci gta2mmp Syntax Highlighting for Notepad+

Post by T.M. »

B-$hep wrote:So nobody uses Scriptpad?
Great, i will ask Sektor to delete the topic and i will stop working on it.


Dunno whats wrong, lots of stuff can be added that npp doesnt support, plus it has folding.

etc etc..
Forget it then. Forget about anything i made.

So thankful community. Work and work and they just use npp.


Bye..
Image
BenMillard
Immortal
Posts: 889
Joined: 16 May 2009, 06:14
GH nick: BenMillard
Location: London, UK
Contact:

Re: gta2mis gta2gci gta2mmp Syntax Highlighting for Notepad+

Post by BenMillard »

B-$hep, you have a thread about your tool already. Keep announcements about it there.
Post Reply