1. #1
    Senior Member Follow User Gallery
    Join Date
    Jul 2014

    Question Trouble with arrays

    Still in remedial Zscripting School I managed to break Zbrush by creating an array

    [VarDef, w(0),"one"]
    [VarDef, w(1),"two"]
    [VarDef, w(2),"three"]

    I'd like to blame the typo in the technical docs on arrays. ;)

    This works, but sets all three elements to the same string, which is limiting ;)
    [VarDef, w(2),"one"]

    This is what I'd expect to type but kicks up the error: Incorrect type of variable input/output

    [VarDef, w(),"one", "two","three"]

    Do you have to specify the number of elements in the array first? because I tried that too to no avail.

  2. #2
    Moderator Follow User Gallery
    Join Date
    Jun 2004


    You declare a list variable like this:

    [VarDef, myList(5),""]

    That creates a list variable of 5 items that can contain strings. (It's currently full of empty strings.)

    You can than set the individual values like this:


    To create a list variable for numbers you would use:

    Make sure you only use [VarDef] to create the list, and you have to decide on the size of the list at that time.

  3. #3
    Senior Member Follow User Gallery
    Join Date
    Jul 2014


    Ha ha! I now see the error of my ways!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts