ZBrushCentral

ZBrushCentral Syntax Highlighting

[ISubPalette, “ZPlugin:ZBC Syntax Highlighting”]

[VarDef, features(5), “”]
[VarSet, features(0), “Colorizes commands, variable names, qoutations, comments and memory blocks.”]
[VarSet, features(1), “Capitalizes command names according to the ZScriptCommandsList.txt, making you look like a pro!”]
[VarSet, features(2), “Detects tabs in your code and indents accordingly.”]
[VarSet, features(3), “Prevents character combinations that will cause a smiley to appear on ZBC.”]
[VarSet, features(4), “A couple of themes, 2/3 of them horrible, and a choice of 3 font sizes!”]

// Coming soon: [VarSet, features(5), “Detection of memory block creation commands and highlighting of the memory block name”]

[VarSet, numberOfFeatures, [VarSize, features]]

[IButton, “ZPlugin:ZBC Syntax Highlighting:Show Amazing features”, “This will show you amazing features.”,[Loop, numberOfFeatures,
[Note, [StrMerge, "Feature ", featureID + 1, ": ", features(featureID)]]

, featureID]

, 0, 1, , /BUTTON ICON/, .2] // End of IButton

Or put another way…

[ISubPalette, “ZPlugin:ZBC Syntax Highlighting”]

[VarDef, features(5), “”]
[VarSet, features(0), “Colorizes commands, variable names, qoutations, comments and memory blocks.”]
[VarSet, features(1), “Capitalizes command names according to the ZScriptCommandsList.txt, making you look like a pro.”]
[VarSet, features(2), “Detects tabs in your code and indents accordingly.”]
[VarSet, features(3), “Prevents character combinations that will cause a smiley to appear on ZBC.”]
[VarSet, features(4), “A couple of themes, 2/3 of them horrible, and a choice of 3 font sizes!”]

// Coming soon: [VarSet, features(5), “Detection of memory block creation commands and highlighting of the memory block name”]

[VarSet, numberOfFeatures, [VarSize, features]]

[IButton, “ZPlugin:ZBC Syntax Highlighting:Show Amazing features”, “This will show you amazing features.”,[Loop,numberOfFeatures,
[Note, [StrMerge, "Feature ", featureID + 1, ": ", features(featureID)]]

, featureID]

, 0, 1, , /BUTTON ICON/, .2]

[HR][/HR]

Hi,

As you can see above I have managed to create a test for epilepsy or at the very least a showcase of my poor choice of colors ( apart from the green I actually like the second one ).

How did I do it? With a webpage called ZBrushCentral Syntax Highlighter.

I am not quite finished with the page so I could still use some feedback. Testing the Syntax Highlighter with your own code and posting it here would help a lot or if you don’t feel comfortable with that you can do a test in a thread that you never publish. Suggesting color themes would also help, but keep in mind that the colors must be displayed on a background of #333333, the background color of ZBC posts.

Single line comments are fine ( // ) but I have a feeling multi-line comments ( /* */ ) that actually span multiple lines, might become an issue. They seem to work fine in tests, but like most forums ZBrushCentral probably does some cleanup when a post is no longer editable, like removing empty INDENT tags? I hope Aurick can chime in on this.

So, how do you actually use it?

  • Go to the [ZBrushCentral Syntax Highlighter](http://markoshea.dk/zscript-documentation/zbc-syntax-highlighting.html) page.
  • Copy / paste your ZScript.
  • Preview the font size and theme you want.
  • Copy the BB Code ( Bulletin Board Code ).
  • Back on ZBrushCentral reply to this thread or make your own and enter source mode (top left button of the new post interface)
  • Paste the BB Code and exit source mode.
  • Submit post and be happy that you have blinded someone with my terrible TVCode color theme.

I am open to suggestions so please try it out and let me know of any improvements you would like to see.

Take care,

ps. No, the other links on ZBrushCentral Syntax Highlighter are not yet active.

Hi Mark,

This is wonderful and will be very useful. (And yes, it’s pretty much useless with Firefox on Windows…)

Thank you very much for taking the time to do this and for sharing with the community - very much appreciated.

I’ve only had a quick look but one addition that would be very nice is if it actually served coffee.

All the best,

Thank you Marcus. Glad that you like it. No coffee served now or in the future, but if you drop by you can always have a cup of green tea :slight_smile:

All browsers should work fine now, although I did make a tiny change and haven’t yet tried Internet Explorer. Fingers crossed.

Apart from memory block name highlighting (right now strings like MY_MEMORY_BLOCK are highlighted) I will probably save the selected font size and theme, so the next time you use the tool you do not need to change anything.

Btw, the new animated themes, Disco and Strobe Light, are nearly done and look blindingly good :wink:

Thank you for sharing the knowledge or ae forum

Very nice! Thanks for creating this!!

-Joseph

Thank you lemaigroup and Joseph (love your plugins), glad you like it.

The font size and theme settings are now stored between sessions. I also changed the TVCode theme from pretty bad on ZBC to “Hey, I think I am okay with this”.

Really cool Mark: many thanks for creating and sharing this. :smiley:

I will give it a shot. :slight_smile:

Cheers Andrea. Thank you.

Someone asked me about the privacy of the code that you enter in the ZBC Syntax Highlighter tool, so I have added a privacy disclaimer to the page. It goes like this:

  • Nothing that is entered is transmitted to a server or stored anywhere.
  • All syntax computation is done on the client side, i.e. your computer.
  • I use a browser cookie to store the font size and theme you used, so you don't have to select it again. Nothing else.
  • I don't want to look at your code. I have enough trouble looking at my own.

Hope that satisfies any worries.

1 Like

I like notepad++(Notepad plus plus), it is an awesome text editor. I found that using notepad++ to do some work like ZScript Syntax Highlighting is such a simple job. Following is the configuration:

Step 1: Copy the following text and save as a xml file named “zcript.xml”.
[noparse]<NotepadPlus>
<UserLang name=“ZScript” ext=“zscript” udlVersion=“2.1”>
<Settings>
<Global caseIgnored=“no” allowFoldOfComments=“no” foldCompact=“no” forcePureLC=“0” decimalSeparator=“0” />
<Prefix Keywords1=“no” Keywords2=“no” Keywords3=“no” Keywords4=“no” Keywords5=“no” Keywords6=“no” Keywords7=“no” Keywords8=“no” />
</Settings>
<KeywordLists>
<Keywords name=“Comments”>00// 01 02 03/* 04*/</Keywords>
<Keywords name=“Numbers, prefix1”></Keywords>
<Keywords name=“Numbers, prefix2”></Keywords>
<Keywords name=“Numbers, extras1”></Keywords>
<Keywords name=“Numbers, extras2”></Keywords>
<Keywords name=“Numbers, suffix1”></Keywords>
<Keywords name=“Numbers, suffix2”></Keywords>
<Keywords name=“Numbers, range”></Keywords>
<Keywords name=“Operators1”>,</Keywords>
<Keywords name=“Operators2”></Keywords>
<Keywords name=“Folders in code1, open”>[</Keywords>
<Keywords name=“Folders in code1, middle”></Keywords>
<Keywords name=“Folders in code1, close”>]</Keywords>
<Keywords name=“Folders in code2, open”></Keywords>
<Keywords name=“Folders in code2, middle”></Keywords>
<Keywords name=“Folders in code2, close”></Keywords>
<Keywords name=“Folders in comment, open”></Keywords>
<Keywords name=“Folders in comment, middle”></Keywords>
<Keywords name=“Folders in comment, close”></Keywords>
<Keywords name=“Keywords1”>IShowActions***x000D;***x000A;ISubPalette***x000D;***x000A;ISlider***x000D;***x000A;IButton***x000D;***x000A;ISwitch***x000D;***x000A;IUnPress***x000D;***x000A;IPress***x000D;***x000A;IEnable***x000D;***x000A;VarDef***x000D;***x000A;VarSet***x000D;***x000A;Loop***x000D;***x000A;Note***x000D;***x000A;StrMerge***x000D;***x000A;VarSize***x000D;***x000A;</Keywords>
<Keywords name=“Keywords2”></Keywords>
<Keywords name=“Keywords3”></Keywords>
<Keywords name=“Keywords4”></Keywords>
<Keywords name=“Keywords5”></Keywords>
<Keywords name=“Keywords6”></Keywords>
<Keywords name=“Keywords7”></Keywords>
<Keywords name=“Keywords8”></Keywords>
<Keywords name=“Delimiters”>00" 01 02" 03 04 05 06( 07 08) 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23</Keywords>
</KeywordLists>
<Styles>
<WordsStyle name=“DEFAULT” fgColor=“FF8000” bgColor=“FFFFFF” fontStyle=“0” nesting=“0” />
<WordsStyle name=“COMMENTS” fgColor=“FF0000” bgColor=“FFFFFF” fontStyle=“0” nesting=“0” />
<WordsStyle name=“LINE COMMENTS” fgColor=“FF0000” bgColor=“FFFFFF” fontStyle=“0” nesting=“0” />
<WordsStyle name=“NUMBERS” fgColor=“FF00FF” bgColor=“FFFFFF” fontStyle=“0” nesting=“0” />
<WordsStyle name=“KEYWORDS1” fgColor=“008000” bgColor=“FFFFFF” fontStyle=“0” nesting=“0” />
<WordsStyle name=“KEYWORDS2” fgColor=“000000” bgColor=“FFFFFF” fontStyle=“0” nesting=“0” />
<WordsStyle name=“KEYWORDS3” fgColor=“000000” bgColor=“FFFFFF” fontStyle=“0” nesting=“0” />
<WordsStyle name=“KEYWORDS4” fgColor=“000000” bgColor=“FFFFFF” fontStyle=“0” nesting=“0” />
<WordsStyle name=“KEYWORDS5” fgColor=“000000” bgColor=“FFFFFF” fontStyle=“0” nesting=“0” />
<WordsStyle name=“KEYWORDS6” fgColor=“000000” bgColor=“FFFFFF” fontStyle=“0” nesting=“0” />
<WordsStyle name=“KEYWORDS7” fgColor=“000000” bgColor=“FFFFFF” fontStyle=“0” nesting=“0” />
<WordsStyle name=“KEYWORDS8” fgColor=“000000” bgColor=“FFFFFF” fontStyle=“0” nesting=“0” />
<WordsStyle name=“OPERATORS” fgColor=“FF00FF” bgColor=“FFFFFF” fontStyle=“0” nesting=“0” />
<WordsStyle name=“FOLDER IN CODE1” fgColor=“FF00FF” bgColor=“FFFFFF” fontStyle=“0” nesting=“0” />
<WordsStyle name=“FOLDER IN CODE2” fgColor=“000000” bgColor=“FFFFFF” fontStyle=“0” nesting=“0” />
<WordsStyle name=“FOLDER IN COMMENT” fgColor=“000000” bgColor=“FFFFFF” fontStyle=“0” nesting=“0” />
<WordsStyle name=“DELIMITERS1” fgColor=“8000FF” bgColor=“FFFFFF” fontStyle=“0” nesting=“0” />
<WordsStyle name=“DELIMITERS2” fgColor=“0000A0” bgColor=“FFFFFF” fontStyle=“0” nesting=“0” />
<WordsStyle name=“DELIMITERS3” fgColor=“FF00FF” bgColor=“FFFFFF” fontStyle=“0” nesting=“0” />
<WordsStyle name=“DELIMITERS4” fgColor=“000000” bgColor=“FFFFFF” fontStyle=“0” nesting=“0” />
<WordsStyle name=“DELIMITERS5” fgColor=“000000” bgColor=“FFFFFF” fontStyle=“0” nesting=“0” />
<WordsStyle name=“DELIMITERS6” fgColor=“000000” bgColor=“FFFFFF” fontStyle=“0” nesting=“0” />
<WordsStyle name=“DELIMITERS7” fgColor=“000000” bgColor=“FFFFFF” fontStyle=“0” nesting=“0” />
<WordsStyle name=“DELIMITERS8” fgColor=“000000” bgColor=“FFFFFF” fontStyle=“0” nesting=“0” />
</Styles>
</UserLang>
</NotepadPlus>
[/noparse]

Step 2: open Notepad++, select “Language | Define your language…” from the main menu. That will open a new window with the title “User Defined Language”.

Step 3: Click the “Import…” button in the top left corner of the new window, select the “zscript.xml” file and click OK.

Step 4: Then, in the “Language” menu, you should see a menuitem named “ZScript”. If not, close notepad++ and reopen it.

Step 5: Open your zscript file in the notepad++. If the zscript file’s suffix is “.zscript”, then the notepad++ should automatic highlighting the syntax. If not, select “Language | ZScript” from the main menu, and it works.