Can anybody tell me if line pick works with a loaded anim mesh or no? I have my level loaded in as an animesh because giles light import system demands it. Line pick goes dead.
However if I load the mesh in as a standard mesh then linepick works 100 percent but then giles light importing will not work. It took me all night to finally try and load my level as a mesh to see if that was the problem - first I tried pivots, dummy objects you name it.
Can any body tell me how to pick an anim mesh succesfully please? It would save me an unneccesary work around!
Never mind - I made my workaround. Anybody else having problems with Giles animesh and using line pick, do this:
Parse the giles file and let it create the lights as normal.
Then inside your createlights /flares/ whatever function in your main game BB file - right after you've made your lights put this code :
lx#=EntityX (Gilelights\Glight,level)
ly#=EntityY (Gilelights\Glight,level)
lz#=EntityZ (Gilelights\Glight,level)
rlx#=EntityPitch(Gilelights\Glight)
rly#=EntityYaw(Gilelights\Glight)
rlz#=EntityRoll(Gilelights\Glight)
lr#= light\far#/1.3
lrc#= light\r#
lgc#= light\g#
lbc#= light\b#
nulight=CreateLight(2)
PositionEntity nulight,lx#,ly#,lz#
LightRange nulight,lr#
LightColor nulight,lrc#,lgc#,lbc#
FreeEntity (Gilelights\Glight)
then right at the end of the fucntion put this:
FreeEntity level ; note-whatever your level var
level=LoadMesh("E:\blitz3d\mystuff\YOURLEVEL.b3d")
It works so far anyhow :)
linepick will then work with your mesh loaded level file no problems - useful for altering your gravity settings etc..
Hope that's easy enough to follow!
You could always apply the pickmode to all the sub-children using my multipurpose NextChild() function from here:
http://www.blitzbasic.com/codearcs/codearcs.php?code=796Like this (untested):
level = LoadAnimMesh("E:\blitz3d\mystuff\YOURLEVEL.b3d")
ent = level
While ent
If EntityClass(ent)="Mesh" EntityPickMode ent,2
ent = NextChild(ent)
Wend
Function NextChild(ent)
If CountChildren(ent)>0
Return GetChild(ent,1)
EndIf
Local foundunused=False
Local foundent = 0, parent,sibling
While foundunused=False And ent<>0
parent = GetParent(ent)
If parent<>0
If CountChildren(parent)>1
If GetChild(parent,CountChildren(parent))<>ent
For siblingcnt = 1 To CountChildren(parent)
sibling = GetChild(parent,siblingcnt)
If sibling=ent
foundunused = True
foundent = GetChild(parent,siblingcnt+1)
EndIf
Next
EndIf
EndIf
EndIf
ent = parent
Wend
Return foundent
End Function
Thanks Beaker - I'll try that code..however I tried pickmode laboriously with all ten 'level' children and none of them worked!