ChatGPT-4 (C4) and I Are Both Mystified

 


Never mind what this script is supposed to do. As written in line 7, character 9 produces a syntax error. But the line looks perfectly Ok to me. 

The problem is defining "i" while defining the for loop. It turns out this is not allowed in LSL, but it *should* be (in other similar languages). The following small modification fixes things:


But no matter how often I told C4 there was a syntax error, it kept re-writing the script with the same error. So the question arises, does C4 know LSL syntax? When this is explicitly pointed out to C4, we get this amusing dialogue:

C4 admits its error and correctly rewrites the script. There are lessons to be learned here, but I'm unsure what ...

It's clear that the user here (me) needs to be fairly proficient with LSL and isolating errors.

It may be that C4 parses and generates LSL according to syntax rules that are similar to other languages but not identical. It's a bit cool that it makes the same mistake I would have. Artificial Stupidity.

Although syntactically correct, the script is still wrong in several respects. For example, the "specification" called for touch response to all prims, not just the root, as well as color changes on all prims, not just the root.

Even so, with all its warts, the script provides a good starting point by using all the correct functions. One function call llGetNumberOfPrims(), takes no arguments, although C4 puts one in at first. LSL doesn't seem to mind the extra meaningless parameter. C4 happily takes it out and apologizes for putting it in.

In any case, C4 does not seem to be a substitution for a competent LSL programmer. For such a programmer, the best approach still seems to be to find examples close to what is intended. A good script editor that forces correct syntax would be a tool any pro would use.




Comments

Popular posts from this blog

Facebook and Bing - A Killer Combination

A Process ...

Warp Speed Generative AI