ZBrushCentral

Top level vs. Sub Level?

I am new to ZBrush 2 and ZScripting and I was wondering about how to start out a script. I made this script and for some reason it won’t work.


 [IButton, START]
  [Note, "Welcome to my Script"]
 ]
 

something like that. And ZBrush says that it can’t perform the note operation because of Top Level only thing. I may not be explaining this so here is what it fully says:


 [IButton, Start
 ] ZSCRIPT ERROR The following command cannot be used as a TopLevel command. Place this with another TopLevel-Capable command--> [Note , "Welcome to my Script"]
 
 

Could someone please explain what a TopLevel and Sublevel command is.

Top Level commands exist on their own in the script, Sub Level have to be inside a Top Level. Buttons are Top Level, Notes are Sub Level so:

Your Note needs to be inside the button. What you’ve done is put an extra bracket in where it shouldn’t be. The code should look like this:


[IButton,"START","Pop up info about this button",
//commands go here
[Note,"Welcome to my Script"]
]//end of button

Check out the Command Reference where all the zscript commands are explained in detail.