Rick:
[For those who have not looked at his object, it is a .3ds file converted to a .gsm file. The 3D Script with the lantern part is about 2600 lines of code, in addition to the lamp code Rick added, which is about 100 lines of code.]
You should treat the code you added as one block or subroutine, add a transformation at the beginning of the code to move the lamp to the desired location within the lantern, then delete that transformation at the end of that code before the lantern code. This is similar to selecting one element within your model and moving it relative to the other parts.
So on this case, the start of the code should be:
…If C And G Then
AddZ zzyzx*.5 ! move light vertically 1/2 the height of the object
DIM colorRGB[3]
colorRGB[1] = D
colorRGB[2] = E
colorRGB[3] = F…
AddZ moves the local origin in the vertical direction,
zzyzx is the height of the object (you can see this parameter in the library part main window), multiplying this by
.5 moves the local origin 1/2 the height of the object.
And the end of the lamp code should be:
…sphere dist2
model solid
EndIf
Del 1 ! delete transformation
MUL A/0.2048950, B/0.2048979, zzyzx/0.7640000…
The
Del removes the last transformation, in this case your AddZ command, so the local origin is returned to its original location for the rest of the lantern code from the .3ds file.
As for the
sic and other parameters, you can look at the main library part window under the Variable column, and read their description in the Name column so you know what they do. In this case the
sic parameter is for controlling the
Show Light Sphere parameter under the
Light Settings sub parameter list. This should help you understand what parts of the 3D (and other) Script is for in altering the object.
HTH
David