ZBrushCentral

ZScript Compiler/Editor - Anyone Interested?

I’m new to these forums, but I’ve been working with ZBrush over the past year. Aside from doing all the graphics junk, I’m also a fairly seasoned programmer. I was wondering if anyone would be interested in a compiler / editor for writing ZScripts. Nothing too complex - at least initially - just something a little nicer to work with instead of Notepad. Things like code highlighting (highlighting commands in one colour, variables in another, etc. ). Some basic syntax checking (looking for unclosed brackets, misspelled commands, parameter mismatches, that kind of stuff), and automatic compiling to the ZBrush ZScripts folder.

I’m not positive, but from my searches so far there doesn’t seem to be an application around that does this yet. If there is please correct me, but if not and anyone thinks this could be a useful tool, let me know and I can start working on something in my spare time.

  • Adam Eisfeld

That would be great! :smiley:
I’m quite new to Zscript, so I have no idea if there is an editor either.
I would sure like one!

Welcome to ZBC. :slight_smile:

This sounds a great idea. I remember that Digits was working on something along these lines but that was some years ago and I guess that he put it aside for more pressing concerns. Certainly he never released anything.

I think that this would be a great help for the ZBC community and is sure to be useful for seasoned zscripters as well as an encouragement for those just getting interested.

If you’ve any questions or simply want someone to give feedback on your ideas feel free to post here or PM me.

One question: can you develop for Mac as well as PC?

Well no, it would only run on PC’s, however anyone running a partition on a mac or a virtual machine would theoretically be able to run it. It would require DirectX which is PC-Only Im afraid. I could maybe look into doing a cross-platform version in the future, but it would be a lot more work.

Alright well it sounds like it would be useful, Ill get started on some test versions and put them here when they’re done. Hopefully it doesnt take me too long, however I have quite a few assignments on the go as well.

No matter, whatever you can share will be interesting and useful.

Good luck!

Hmm, for a compiler, that’s both surprising and disappointing.

If you must have 3D capability, why not just use OpenGL? It works on both platforms (and a whole load of others as well).

For that matter, why would a compiler need any display capabilities (versus good old stdin/stdout/stderr)?

Well I had some time today to begin work. I’ve just got the basic layout and gui set up now, but I figured it was worth a post to show people Im actually doing something.

[ZCompile screen01.jpg](javascript:zb_insimg(‘180405’,‘ZCompile%20screen01.jpg’,1,0))

I’ve managed to program the system to automatically fit any resolution, so thats pretty cool. Other than that, the tool window to the left (the Project Manager) will allow you to work on multiple zscripts at the same time, kind of like photoshop allowing you to work on multiple psds at once. Each open script will be displayed in the listbox to the left.

Not much else to say, Ill keep everyone updated as work continues.

nice idea…

maybe it would be easier to write something for an editor like notpead++ ?
as i understand it that editor allows for writing plugins and definition files for specific languages so that syntax highlighting etc will work properly within the editor.

it is freeware and a very handy tool i used a lot when scripting and writing different kinds of code or just working with textfiles in general.

heres a link : http://notepad-plus.sourceforge.net/uk/site.htm

There are several threads here at ZBC that give syntax highlighting files for various editors such as: http://www.zbrushcentral.com/showthread.php?t=4514

However, if Adam wants to work on a dedicated zscript editor then I think that would be great. The ability to auto-complete commands, or check for syntax errors would be valuable features.

Yeah I thought about Notepad++ but I figured, its something Im just doing in my spare time on the train ride in / from college, and writing my own compiler would allow for pretty much any feature anyone wanted.

I’ve been planning out how the syntax highlighting will work (Ive never written a compiler before :P) and I’ve figured out how everything needs to be done. If anyone is interested here are my thoughts:

Ill create a set of string tables (a string table is essentially just a list of words that can be looked up). Each string table will be stored in a text file (so it can be modified later on if new functions come out), and represent one kind of phrase. For example one string table will contain all of the available commands, another will contain any operators, etc.

I would then need to find the last word the user wrote, and search within all of the string tables to determine if this word / phrase belongs to any string tables, and if so highlight it the appropriate colour. Obviously this would take a while to calculate with all of the possible phrases one could write. So I plan on having the system continuously filter out impossible phrases as the user enters each letter. Because the string tables will be ordered alphabetically, if the user (for example) presses the a key first, I can ignore all phrases that dont start with a. This would continue on down the line as the user enters more and more letters. When the user finally finishes the word, there will logically only be one string left that matches what they’ve written.

Another benefit of constantly filtering unneeded phrases as the user types is the ability for auto-completion. All Ill have to do is check when there are - for example - under 5 possible phrases left to search for, and display them in a dropdown box that the user can select from to auto-complete their phrase for them.

The compiling process will be a little more difficult as I haven’t worked with ZScripts much, however Im sure with my background in programming / looking over the user reference Ill be able to come up with at least a basic set of rules that can further be defined later on.

Anyways, Ill work some more on this on the train ride in tomorrow and hopefully have the beginnings of the syntax highlighting system in place.

Sounds like a great idea. Thanks for investing your time and your interest.

I am currently using Notepad ++ which works nicely with zscripting for color syntax, auto completion, brace matching, word highlighting and to collapse/unfold sections of text. So you’ve got your work cut out for you :slight_smile:

The only thing I really miss is highlighting of variable names so if I define [VarSet, myValue, 1] , myValue would be color coded / highlighted throughout the rest of the code. Incorrect variable names and mismatching variables types are where I make the most errors.

I am trying to think of other features that could make your editor stand out. Perhaps a user defined list of often used [RoutineDef, ]s ? Maybe auto completion/dropdown list of Interface Item Paths? Interface Item Paths are added to and changed between ZBrush revisions but a user created (or even better, zscript generated) list of path names should work nicely.

The GUI is looking good. My preference is no icon buttons, just a menu bar and a load of shortcuts, so this fits the bill perfectly.

Looking forward to following your progress.

BCD: I have a subject on UNIX at college and over there I have no other choice but to use vim for coding It sure is fun sometimes but for long programming I still prefer a GUI and some convenient compiler/editor like TC

if i get the GA-X58A-UD3R, is it recommend to run triple channels~? thot of buying dual rams bundle first & wait for the ram price to drop to buy 3rd ram nxtime~ <img src=“http://www.zbrushcentral.com/pixo/atn.gif”>