Heh, when I use my entity commands, I generate a number string so the functions can determine if its an object, camera, light, or terrain and which one it is, like so:
function LoadMesh(mesh$)
object=0
repeat
inc object
until object exist(object)=0
load object mesh$,object
misc$=str$(object)+"1"
object=val(misc$)
endfunction object
So there is no need to set global for any entity name. Gotta put a little more effort in determining if its an object, light, camera, or terrain though.
This is my PositionEntity function:
function PositionEntity(entity,xpos,ypos,zpos)
misc$=str$(entity)
length=len(misc$)
entitytype=val(mid$(misc$,length))
entitynumber=length-1
if entitynumber=1 then entityfinal=val(mid$(misc$,1))
if entitynumber=2 then entityfinal=(val(mid$(misc$,1))*10)+val(mid$(misc$,2))
if entitynumber=3 then entityfinal=(val(mid$(misc$,1))*100)+(val(mid$(misc$,2))*10)+val(mid$(misc$,3))
if entitynumber=4 then entityfinal=(val(mid$(misc$,1))*1000)+(val(mid$(misc$,2))*100)+(val(mid$(misc$,3))*10)+val(mid$(misc$,4))
if entitytype=1 then position object entityfinal,xpos,ypos,zpos
if entitytype=2 then position light entityfinal,xpos,ypos,zpos
if entitytype=3 then position camera entityfinal,xpos,ypos,zpos
if entitytype=4 then position matrix entityfinal,xpos,ypos,zpos
endfunction
Basically, it only has support for 9999 objects, lights, cameras, or matrices, but who's going ot use em all? It determines the type of Entity it is first, then it edits the scene accordingly.
Intel Celeron 1.3 Ghrz 512MB Ram NVIDIA GeForce FX 5200 128MB