Ranking
Original Post
[lua] Bug?
This code:
    
for k = 0, 1 do
        for i=0, 19 do
                x, y, z = get_joint_pos(k, i)
                Info = get_joint_info(k, i)
                State = Info.state
                if(State == 1) then
                set_color(1, 0, 0, 1)
                elseif(State == 2) then
                set_color(0, 0, 1, 1)
                elseif(State == 3) then
                set_color(1, 0, 1, 1)
                elseif(State == 4) then
                set_color(0, 1, 0, 1)
                end
                Radius = get_joint_radius(k, i)
                --x = x/2
                --y = y/2
                --z = z/2+1
                draw_sphere(x, y, z, Radius+0.01)
        end
    end
This code draws spheres of different colour on the players joints.
If all are set to extend, the bottom half go blue and the top half go red.
Suggesting that for the lower joints the get_joint_info(p,j).state's are set up differently.
:D
Yeah, apparently the joints are set up differently. I would have written down the differences, but I never bothered to.
Here are some JavaScript array literals that might help.
joints[n] corresponds to jointStates[n]
jointStates[n][i] corresponds to the state you get when you use set_joint_state(player, n, i)

  var joints = ['neck', 'chest', 'lumbar', 'abs', 'right pecs', 'right shoulder', 'right elbow', 'left pecs', 'left shoulder', 'left elbow', 'right wrist', 'left wrist', 'right glute', 'left glute', 'right hip', 'left hip', 'right knee', 'left knee', 'right ankle', 'left ankle'];

  var jointStates = [
    ['extend', 'contract', 'hold', 'relax'],
    ['right rotate', 'left rotate', 'hold', 'relax'],
    ['right bend', 'left bend', 'hold', 'relax'],
    ['contract', 'extend', 'hold', 'relax'],
    ['extend', 'contract', 'hold', 'relax'],
    ['lower', 'raise', 'hold', 'relax'],
    ['extend', 'contract', 'hold', 'relax'],
    ['extend', 'contract', 'hold', 'relax'],
    ['lower', 'raise', 'hold', 'relax'],
    ['extend', 'contract', 'hold', 'relax'],
    ['extend', 'contract', 'hold', 'relax'],
    ['extend', 'contract', 'hold', 'relax'],
    ['contract', 'extend', 'hold', 'relax'],
    ['contract', 'extend', 'hold', 'relax'],
    ['contract', 'extend', 'hold', 'relax'],
    ['contract', 'extend', 'hold', 'relax'],
    ['extend', 'contract', 'hold', 'relax'],
    ['extend', 'contract', 'hold', 'relax'],
    ['contract', 'extend', 'hold', 'relax'],
    ['contract', 'extend', 'hold', 'relax']
  ];
Radioactive torso's description should be, "You have cancer like wow."