Newbie to SL and LSL but a long-time programmer. I'm working on some, seemingly, very basic stuff as a learning tool for myself. right now I'm trying to do a simple light switch. My thought was to use llGetPrimitiveParams, toggle the boolean Light parameter and then llSetPrimitiveParams. This would at least be slightly elegant and reusable by changing only the parameter I want to change and preserving the rest in any light fixture. I can turn the light on and off just fine with a constant list of parameters, but displaying the results of llGetPrimitiveParams - I'm SO confused.
The light starts on.
The First llGet looks exactly like the Build Panel for the object, as expected. The light is red with a radius of 1.
list lt = llGetPrimitiveParams([PRIM_POINT_LIGHT]);
Lamp: 1, <1.000000, 0.000000, 0.000000>, 1.000000, 1.000000, 0.750000
the First llSet works exactly as expected and shuts the light off. I can tell that the parameters are all still correct by the features panel in build. Here's the list that gets passed (23 = PRIM_POINT_LIGHT)
Lamp: 23, 0, <1.000000, 0.000000, 0.000000>, 1.000000, 1.000000, 0.750000
The results of the second llGet, however are simply incorrect. It returns a white light with a radius of 10 - regardless of the fact that this is NOT it's current state.
Lamp: 0, <1.000000, 1.000000, 1.000000>, 1.000000, 10.000000, 0.750000
Of course, then, the llSet does turn the light back on, but with these now incorrect parameters as reflected both visually and in the build panel.
Have I hit a bug or am I doing something wrong?
Thanks