Hi all,
I'm creating a map with some splines in order to read the
vertex to construct some AI paths in the game.
I'm using B3D pipeline to export the .B3D model of the map
and I'm following the instructions of the exporter in order
to export shapes.
Then, I read this shapes and its vertex and create cubes in
each one of these vertex...
Till here all seems to go well..
The problems comes when I use Gile[s] beetween the modeller
and the blitz, to create a lightmap for the terrain.
Gile[s] assume that there exist a path called AIPath01 and it shows it at the hierarchy tree at the left, but when I
export the map with the lightmap again and try to read each
vertex of IAPath01 object, it return nothing!
It seems like if Gile[s] delete the surface of a object that
doesn't understand or something similar..
This is the function I use to read the vertex, and it works if I don't work with Gile[s] to generate the lightmap.
------------------------------------------------------
numpaths = 0
child=GetChild(level,1) ; cuenta los hijos del nivel
For i=1 To CountChildren(child)
If Left$(EntityName(GetChild(child,i)),6)="AIPath"
DebugLog("AI Path found!")
numpaths = numpaths + 1
path.TipoPath = New TipoPath ; Cremos un nuevo path
path\ref = numpaths ; referencia para identificar el path
shape = GetChild(child,i)
temp_surf = CreateSurface(shape)
For s=1 To CountSurfaces(shape)
surf=GetSurface(shape,s)
For a=0 To CountVertices(surf)-1
VertexColor surf,a,Rnd(255),Rnd(255),Rnd(255)
path\numnodes = path\numnodes + 1
path\NodeX#[path\numnodes] = EntityX#(shape,True)+VertexX#(surf,a)
path\NodeY#[path\numnodes] = EntityY#(shape,True)+VertexY#(surf,a)
path\NodeZ#[path\numnodes] = EntityZ#(shape,True)+VertexZ#(surf,a)
path\NodeEnt[path\numnodes] = CreateCube()
DebugLog("Node Created!")
PositionEntity path\NodeEnt[path\numnodes],path\NodeX#[path\numnodes],path\NodeY#[path\numnodes]+0.1,path\NodeZ#[path\numnodes]
DebugLog("-> "+Str$(path\nodex#[path\numnodes])+", "+Str$(path\nodey#[path\numnodes])+", "+Str$(path\nodez#[path\numnodes])+", ")
If numpaths = 1 Then EntityColor path\NodeEnt[path\numnodes],0 , 0 , 255
If numpaths = 2 Then EntityColor path\NodeEnt[path\numnodes],0 , 255 , 255
If numpaths = 3 Then EntityColor path\NodeEnt[path\numnodes],255 , 0 , 255
EntityAlpha path\NodeEnt[path\numnodes],1.0
Next
Next
ClearSurface(temp_surf)
;FreeEntity (shape)
;DebugLog("vertices en el path..."+Str$(CountVertices(surf)-1))
EndIf
Next
------------------------------------------------------
Please, someone knows how could I do to solve this
problem???
Thanks in advance!
I'm creating a map with some splines in order to read the
vertex to construct some AI paths in the game.
I'm using B3D pipeline to export the .B3D model of the map
and I'm following the instructions of the exporter in order
to export shapes.
Then, I read this shapes and its vertex and create cubes in
each one of these vertex...
Till here all seems to go well..
The problems comes when I use Gile[s] beetween the modeller
and the blitz, to create a lightmap for the terrain.
Gile[s] assume that there exist a path called AIPath01 and it shows it at the hierarchy tree at the left, but when I
export the map with the lightmap again and try to read each
vertex of IAPath01 object, it return nothing!
It seems like if Gile[s] delete the surface of a object that
doesn't understand or something similar..
This is the function I use to read the vertex, and it works if I don't work with Gile[s] to generate the lightmap.
------------------------------------------------------
numpaths = 0
child=GetChild(level,1) ; cuenta los hijos del nivel
For i=1 To CountChildren(child)
If Left$(EntityName(GetChild(child,i)),6)="AIPath"
DebugLog("AI Path found!")
numpaths = numpaths + 1
path.TipoPath = New TipoPath ; Cremos un nuevo path
path\ref = numpaths ; referencia para identificar el path
shape = GetChild(child,i)
temp_surf = CreateSurface(shape)
For s=1 To CountSurfaces(shape)
surf=GetSurface(shape,s)
For a=0 To CountVertices(surf)-1
VertexColor surf,a,Rnd(255),Rnd(255),Rnd(255)
path\numnodes = path\numnodes + 1
path\NodeX#[path\numnodes] = EntityX#(shape,True)+VertexX#(surf,a)
path\NodeY#[path\numnodes] = EntityY#(shape,True)+VertexY#(surf,a)
path\NodeZ#[path\numnodes] = EntityZ#(shape,True)+VertexZ#(surf,a)
path\NodeEnt[path\numnodes] = CreateCube()
DebugLog("Node Created!")
PositionEntity path\NodeEnt[path\numnodes],path\NodeX#[path\numnodes],path\NodeY#[path\numnodes]+0.1,path\NodeZ#[path\numnodes]
DebugLog("-> "+Str$(path\nodex#[path\numnodes])+", "+Str$(path\nodey#[path\numnodes])+", "+Str$(path\nodez#[path\numnodes])+", ")
If numpaths = 1 Then EntityColor path\NodeEnt[path\numnodes],0 , 0 , 255
If numpaths = 2 Then EntityColor path\NodeEnt[path\numnodes],0 , 255 , 255
If numpaths = 3 Then EntityColor path\NodeEnt[path\numnodes],255 , 0 , 255
EntityAlpha path\NodeEnt[path\numnodes],1.0
Next
Next
ClearSurface(temp_surf)
;FreeEntity (shape)
;DebugLog("vertices en el path..."+Str$(CountVertices(surf)-1))
EndIf
Next
------------------------------------------------------
Please, someone knows how could I do to solve this
problem???
Thanks in advance!