Hmm, very strange problem occurring now... I copied the function again for a different purpose and it worked fine. Then I tried again and it isn't working.
Here is the code for the function that isn't working:
function QuestionUVIndex(QObject as Integer)
lock vertexdata for limb QObject, 0
set vertexdata uv 0, 0.16667, 0
set vertexdata uv 1, 0, 0
set vertexdata uv 2, 0.16667, 0.2
set vertexdata uv 3, 0, 0
set vertexdata uv 4, 0, 0.2
set vertexdata uv 5, 0.16667, 0.2
unlock vertexdata
endfunction
But when I tried this:
function QuestionUVIndex(QObject as Integer)
lock vertexdata for limb 131, 0
set vertexdata uv 0, 0.16667, 0
set vertexdata uv 1, 0, 0
set vertexdata uv 2, 0.16667, 0.2
set vertexdata uv 3, 0, 0
set vertexdata uv 4, 0, 0.2
set vertexdata uv 5, 0.16667, 0.2
unlock vertexdata
endfunction
...where I replaced the variable "QObject" with a number, it worked for that particular object.
Obviously, I'm thinking that I passed the wrong variable to the function, but when I created the small test routine:
DO
TEXT 100, 100, STR$(QObject)
SYNC
LOOP
The variable QObject was the correct number. So for some reason it seems that it won't allow me to use a variable in the "lock vertexdata for limb" command.