If you decide to use the app just replace the code in main.agc with this. It will add a sequence number to duplicates.
If it helps your app i might be able to make duplicate names cloned objects or instanced objects
// Project: Scene
// Created: 2018-10-23
// show all errors
SetErrorMode(2)
// set window properties
SetWindowTitle( "Scene" )
SetWindowSize( 1024, 768, 0 )
SetWindowAllowResize( 1 ) // allow the user to resize the window
// set display properties
SetVirtualResolution( 1024, 768 ) // doesn't have to match the window
SetOrientationAllowed( 1, 1, 1, 1 ) // allow both portrait and landscape on mobile devices
SetSyncRate( 30, 0 ) // 30fps instead of 60 to save battery
SetScissor( 0,0,0,0 ) // use the maximum available screen space, no black borders
UseNewDefaultFonts( 1 ) // since version 2.0.22 we can use nicer default fonts
SetPrintSize(18)
SetClearColor(0x80, 0x80, 0x80)
SetPrintColor(0x20, 0x20, 0x20)
#constant BUILDER = 1
type user
value as point
endtype
type track
id as integer
dir as point
speed as float
friction as float
path as integer[]
gravity as float
last as point
endtype
type texture
u as float
v as float
endtype
type face
v1 as point
v2 as point
v3 as point
vp1 as integer
vp2 as integer
vp3 as integer
u1 as texture
u2 as texture
u3 as texture
up1 as integer
up2 as integer
up3 as integer
np1 as integer
np2 as integer
np3 as integer
n1 as point
n2 as point
n3 as point
endtype
type center
name as string
point as point
endtype
type stats
v as integer
u as integer
f as integer
endtype
global MapFile as integer
global PathFile as integer
global vertex as point[]
global textures as texture[]
global normals as point[]
global centers as center[]
models as model[]
lights as light[]
paths as path[]
locations as location[]
boundaries as bounds[]
global faces as face[]
camera as camera
create3DPhysicsWorld()
global gravity as integer = -3
Set3DPhysicsGravity(0, gravity, 0)
//SetSunDirection(0, -1, 0.3)
SetSunActive(1)
SetAmbientColor(140, 140, 140)
SetSunColor(40, 40, 40)
SetSunDirection( 0, -1, 0 )
shadowmode as integer
shadowMode = 3 // start with cascade shadow mapping which gives the best quality
SetShadowMappingMode( shadowMode )
SetShadowSmoothing( 1 ) // random sampling
SetShadowMapSize( 1024, 1024 )
SetShadowRange( -1 ) // use the full camera range
SetShadowBias( 0.0012 ) // offset shadows slightly to avoid shadow artifacts
/// shadow stuff
scene as string
scene = "hoops"
stats as stats
stats = SplitModel(scene)
#constant BUILDING TRUE
LoadScene(scene, models, paths, lights, locations, boundaries, camera)
do
print(ScreenFPS())
Sync()
loop
function SplitModel(folder as string)
file as integer
line as string
group as string
s as stats
n as string
path as string
file = OpenToRead(folder+".obj")
line = ReadLine(file)
MapFile = OpenToWrite(MakeFilename(folder, folder+".map"))
PathFile = OpenToWrite(MakeFilename(folder, folder+".pth"))
WriteLine(MapFile, "# name pos type uv transparency physics body texture mipmapping")
WriteLine(MapFile, "# model/name x y z (model/clone/point) (clamp/repeat) (transparent/opaque) (static/none) (cylinder/sphere/box) filename normal/mipmap")
WriteLine(MapFile, "#")
WriteLine(MapFile, "# point types beginning with 'L' are lights ")
WriteLine(MapFile, "# cam point type is the camera")
WriteLine(MapFile, "# look point type is the camera 'lookat' point")
WriteLine(MapFile, "#")
repeat
if mid(line, 1, 3) = "vn "
normals.insert(AddNormal(line))
endif
if mid(line, 1, 2) = "v "
vertex.insert(AddVertex(line))
endif
if mid(line, 1, 3) = "vt "
textures.insert(AddTexture(line))
endif
if mid(line, 1, 2) = "f "
faces.insert(AddFace(line))
endif
if mid(line, 1, 2) = "g "
if group <> ""
if IsPath(group) or IsShape(group)
BuildPath(folder, group)
else
BuildModel(folder, group)
endif
faces.length = -1
endif
group = GetStringToken2( line, " ", 2 )
endif
line = ReadLine(file)
until FileEof(file) = 1
if IsPath(group) or IsShape(group)
BuildPath(folder, group)
else
BuildModel(folder, group)
endif
CloseFile(file)
CloseFile(MapFile)
CloseFIle(PathFile)
s.v = vertex.length
s.u = textures.length
s.f = faces.length
endfunction s
function AddFace(line as string)
f as face
v1 as string
v2 as string
v3 as string
v1 = GetStringToken2( line, " ", 2 )
v2 = GetStringToken2( line, " ", 3 )
v3 = GetStringToken2( line, " ", 4 )
f.v1 = vertex[val(GetStringToken2( v1, "/", 1 )) - 1]
f.v2 = vertex[val(GetStringToken2( v2, "/", 1 )) - 1]
f.v3 = vertex[val(GetStringToken2( v3, "/", 1 )) - 1]
f.u1 = textures[val(GetStringToken2( v1, "/", 2 )) - 1]
f.u2 = textures[val(GetStringToken2( v2, "/", 2 )) - 1]
f.u3 = textures[val(GetStringToken2( v3, "/", 2 )) - 1]
f.n1 = normals[val(GetStringToken2( v1, "/", 3 )) - 1]
f.n2 = normals[val(GetStringToken2( v2, "/", 3 )) - 1]
f.n3 = normals[val(GetStringToken2( v3, "/", 3 )) - 1]
endfunction f
function AddNormal(line as string)
v as point
v.x = ValFloat(GetStringToken2( line, " ", 2 ))
v.y = ValFloat(GetStringToken2( line, " ", 3 ))
v.z = ValFloat(GetStringToken2( line, " ", 4 ))
endfunction v
function AddVertex(line as string)
v as point
v.x = ValFloat(GetStringToken2( line, " ", 2 ))
v.y = ValFloat(GetStringToken2( line, " ", 3 ))
v.z = ValFloat(GetStringToken2( line, " ", 4 ))
endfunction v
function AddTexture(line as string)
t as texture
t.u = ValFloat(GetStringToken2( line, " ", 2 ))
t.v = ValFloat(GetStringToken2( line, " ", 3 ))
endfunction t
global duplicates as string[]
function BuildModel(folder as string, name as string)
file as integer
vert as point[]
tex as texture[]
norm as point[]
i as integer
f as face
v as point
t as texture
b as bounds
n as string
s as string
u as string
c as String
body as string
physics as string
path as path
ctr as center
m as string
mm as string
p1 as string
num as integer
if mid(name, 1, 5) = "Group"
exitfunction
endif
if mid(name, 1, 4) = "ball"
b.x.min = 9999999
endif
b.x.min = 9999999
b.y.min = 9999999
b.z.min = 9999999
b.x.max = -9999999
b.y.max = -9999999
b.z.max = -9999999
for i=0 to faces.length
f = faces[i]
b = GetBounds(f.v1, b)
b = GetBounds(f.v2, b)
b = GetBounds(f.v3, b)
next
b.x.shift = b.x.min + ( b.x.max - b.x.min ) / 2
b.y.shift = b.y.min + ( b.y.max - b.y.min ) / 2
b.z.shift = b.z.min + ( b.z.max - b.z.min ) / 2
n = GetName(name)
if IsClone(name)
n = GetBase(n)
s = "clone"
elseif IsPoint(name) or IsVector(name)
s = "point"
elseif IsBounds(name)
s = "bounds"
elseif IsCenter(name)
ctr.name = n
ctr.point.x = b.x.shift
ctr.point.y = b.y.shift
ctr.point.z = b.z.shift
centers.insert(ctr)
exitfunction
else
for i=0 to centers.length
ctr = centers[i]
if ctr.name = n
b.x.shift = b.x.shift + (ctr.point.x - b.x.shift)
b.y.shift = b.y.shift + (ctr.point.y - b.y.shift)
b.z.shift = b.z.shift + (ctr.point.z - b.z.shift)
exit
endif
next
s = "model"
if n = "lit"
n = n
endif
if IsBase(name) = TRUE and IsClone(name) = FALSE
n = n + GetNumbers(name)+".obj"
else
num = 0
while duplicates.find(n) > -1
n = n + str(num)
inc num
endwhile
duplicates.insertsorted(n)
n = n + ".obj"
endif
endif
if IsMipMap(name)
mm = "mipmap"
else
mm = "normal"
endif
if IsUv(name)
u = "repeat"
else
u = "clamp"
endif
if IsTransparent(name)
c = "transparent"
else
c = "opaque"
endif
if IsStaticBody(name)
physics = "static"
elseif IsDynamicBody(name)
physics = "dynamic"
else
physics="none"
endif
if IsShapeCylinder(name)
body = "cylinder"
if IsYplane(name)
body="cylindery"
elseif IsXplane(name)
body="cylinderx"
elseif IsZplane(name)
body="cylinderz"
endif
elseif IsShapeSphere(name)
body = "sphere"
elseif IsShapeBox(name)
body = "box"
elseif IsShapePoly(name)
body = "poly"
else
body = "none"
endif
m = GetBase(name)
if IsBase(name)
m = StripNumbers(name)
endif
if s = "point"
if mid(GetBase(name),1,1) = "L"
p1 = GetStringToken(name, "~.", 2)
WriteLine(MapFile, n+" "+str(b.x.shift)+" "+str(b.y.shift)+" "+str(b.z.shift * -1)+" "+s+" "+mid(GetStringToken(p1, "x", 1),2,-1)+" x"+GetStringToken(p1, "x", 2))
else
if IsVector(name)
v = GetVector(faces[0])
s = "point "+str(v.x)+" "+str(v.y)+" "+str(v.z * -1)
endif
WriteLine(MapFile, n+" "+str(b.x.shift)+" "+str(b.y.shift)+" "+str(b.z.shift * -1)+" "+s)
endif
exitfunction
endif
if s = "bounds"
WriteLine(MapFile, n+" "+str(b.x.min)+" "+str(b.y.min)+" "+str(b.z.min * -1)+" "+s+" "+str(b.x.max)+" "+str(b.y.max)+" "+str(b.z.max * -1))
exitfunction
endif
WriteLine(MapFile, n+" "+str(b.x.shift)+" "+str(b.y.shift)+" "+str(b.z.shift * -1)+" "+s+" "+u+" "+c+" "+physics+" "+body+ " " +m+".png" + " " + mm )
if IsClone(name) = TRUE or IsCenter(name) = TRUE
exitfunction
endif
n = MakeFilename(folder, n)
file = OpenToWrite(n)
for i=0 to faces.length
faces[i].vp1 = ProcessVert(faces[i].v1, vert, FALSE)
faces[i].vp2 = ProcessVert(faces[i].v2, vert, FALSE)
faces[i].vp3 = ProcessVert(faces[i].v3, vert, FALSE)
faces[i].up1 = ProcessUV(faces[i].u1, tex)
faces[i].up2 = ProcessUV(faces[i].u2, tex)
faces[i].up3 = ProcessUV(faces[i].u3, tex)
faces[i].np1 = ProcessVert(faces[i].n1, norm, FALSE)
faces[i].np2 = ProcessVert(faces[i].n2, norm, FALSE)
faces[i].np3 = ProcessVert(faces[i].n3, norm, FALSE)
next
for i=0 to vert.length
WriteLine(file, "v "+str((vert[i].x - b.x.shift))+" "+str(vert[i].y - b.y.shift)+" "+str((vert[i].z - b.z.shift)))
next
for i=0 to norm.length
WriteLine(file, "vn "+str(norm[i].x)+" "+str(norm[i].y)+" "+str(norm[i].z))
next
for i=0 to tex.length
WriteLine(file, "vt "+str(tex[i].u)+" "+str(tex[i].v))
next
for i=0 to faces.length
f = faces[i]
WriteLine(file, "f "+str(f.vp1 + 1)+"/"+str(f.up1 + 1)+"/"+str(f.np1 + 1)+" "+str(f.vp2 + 1)+"/"+str(f.up2 + 1)+"/"+str(f.np2 + 1)+" "+str(f.vp3 + 1)+"/"+str(f.up3 + 1)+"/"+str(f.np3 + 1))
next
CloseFile(file)
endfunction
function GetVector(face as face)
d1 as float
d2 as float
d3 as float
apex as point
base1 as point
base2 as point
middle as point
v as point
o as integer
a as integer
d1 = Distance3D(face.v1, face.v2)
d2 = Distance3D(face.v2, face.v3)
d3 = Distance3D(face.v3, face.v1)
if d3 < d1 and d3 < d2
a = 2
apex = face.v2
LowestX(face.v3, face.v1)
base1 = face.v3
base2 = face.v1
elseif d2 < d1 and d2 < d3
a = 1
apex = face.v1
LowestX(face.v2, face.v3)
base1 = face.v2
base2 = face.v3
elseif d1 < d2 and d1 < d3
a = 3
apex = face.v3
LowestX(face.v1, face.v2)
base1 = face.v1
base2 = face.v2
endif
middle.x = (base2.x - base1.x) / 2 + base1.x
middle.y = (base2.y - base1.y) / 2 + base1.y
middle.z = (base2.z - base1.z) / 2 + base1.z
endfunction v
function LowestX(p1 ref as point, p2 ref as point)
p as point
p = p1
if p1.x > p2.x
p1 = p2
p2 = p
endif
endfunction
function ProcessVert(v as point, vert ref as point[], duplicates as integer)
i as integer
vt as point
vert.insert(v)
i = vert.length
endfunction i
function ProcessUV(u as texture, tex ref as texture[])
i as integer
uv as texture
tex.insert(u)
i = tex.length
endfunction i
function BuildPath(folder as string, name as string)
if IsShape(name)
BuildModel(folder, name)
endif
if IsXPlane(name)
BuildXPath(name)
elseif IsZplane(name)
BuildZPath(name)
endif
endfunction
type line
p as point[]
endtype
function BuildZPath(name as string)
p as path
y as float
f as face
n as face
i as integer
v as point
s as string
d as integer
d1 as integer
lines as line[]
line as line
i1 as integer
i2 as integer
v1 as point
line1 as line
found as integer
y = -9999999
for i=0 to faces.length
f = faces[i]
f.v1.x = round(f.v1.x * 100) / 100.0
f.v1.y = round(f.v1.y * 100) / 100.0
f.v1.z = round(f.v1.z * 100) / 100.0
f.v2.x = round(f.v2.x * 100) / 100.0
f.v2.y = round(f.v2.y * 100) / 100.0
f.v2.z = round(f.v2.z * 100) / 100.0
f.v3.x = round(f.v3.x * 100) / 100.0
f.v3.y = round(f.v3.y * 100) / 100.0
f.v3.z = round(f.v3.z * 100) / 100.0
faces[i] = f
next
f = faces[0]
if f.v1.y > y
y = f.v1.y
endif
if f.v2.y > y
y = f.v2.y
endif
if f.v3.y > y
y = f.v3.y
endif
for i=0 to faces.length // Find all points along the upper edge of the shape
f = faces[i]
line.p.length = -1
if ( f.v1.y < y and f.v2.y < y ) or ( f.v2.y < y and f.v3.y < y ) or ( f.v3.y < y and f.v1.y < y ) // poly pointing up
continue
endif
if f.v1.y >= y and f.v2.y >= y and f.v3.y >= y // horizontal poly
continue
endif
if f.v1.y >= y
line.p.insert(f.v1)
endif
if f.v2.y >= y
line.p.insert(f.v2)
endif
if f.v3.y >= y
line.p.insert(f.v3)
endif
if line.p.length > 1
Message("Too many vertex")
endif
lines.insert(line)
next
i = 0
d = 0
line = lines[i]
v = line.p[d]
p.nodes.insert(v)
inc d
v = line.p[d]
lines.remove(i)
repeat
found = FALSE
for i=0 to lines.length
line = lines[i]
for d = 0 to line.p.length
v1 = line.p[d]
if v1.x = v.x and v1.z = v.z
p.nodes.insert(v)
found = TRUE
exit
endif
next
if found = TRUE
exit
endif
next
if found = FALSE
Message("Next node not found")
endif
d = abs(d - 1)
v = lines[i].p[d]
lines.remove(i)
until lines.length < 0
v1 = p.nodes[0]
if v1.x = v.x and v1.y = v.y and v1.z = v.z
:
else
p.nodes.insert(v)
endif
d = p.nodes.length
// p.nodes = OrderNodes(p.nodes)
i = p.nodes.length
s = Getbase(name)
if IsReverse(name)
for i=p.nodes.length -1 to 0 step -1
v = p.nodes[i]
s = s+" "+str(v.x)+","+str(v.y)+","+str(v.z * -1)
next
else
for i=0 to p.nodes.length
v = p.nodes[i]
s = s+" "+str(v.x)+","+str(v.y)+","+str(v.z * -1)
next
endif
WriteLine(PathFile, s)
endfunction
function OrderNodes(nodes as point[])
new as point[]
i as integer
p as point
d as float
c as float
n as point
o as integer
x as integer
o = 0
p = nodes[o]
new.insert(p)
nodes.remove(o)
repeat
c = 999999
for i=0 to nodes.length
d = Distance3D(nodes[i], p)
if d < c and d > 0
x = i
c = d
n = nodes[i]
endif
next
if c = 999999
Message("Cant find nearest")
endif
new.insert(n)
p = n
nodes.remove(x)
until nodes.length = -1
endfunction new
function AddZNode(nodes ref as point[], point as point)
i as integer
n as point
for i = 0 to nodes.length
n = nodes[i]
if n.x = point.x and n.z = point.z
exitfunction FALSE
endif
next
nodes.insert(point)
endfunction TRUE
function BuildXPath(name as string)
p as path
z as float
f as face
i as integer
v as point
s as string
z = -9999999
for i=0 to faces.length
f = faces[i]
// f.v1.x = f.v1.x * 10000
f.v1.x = round(f.v1.x * 100) / 100.0
f.v1.y = round(f.v1.y * 100) / 100.0
f.v1.z = round(f.v1.z * 100) / 100.0
f.v2.x = round(f.v2.x * 100) / 100.0
f.v2.y = round(f.v2.y * 100) / 100.0
f.v2.z = round(f.v2.z * 100) / 100.0
f.v3.x = round(f.v3.x * 100) / 100.0
f.v3.y = round(f.v3.y * 100) / 100.0
f.v3.z = round(f.v3.z * 100) / 100.0
faces[i] = f
next
f = faces[0]
if f.v1.z > z
z = f.v1.z
endif
if f.v2.z > z
z = f.v2.z
endif
if f.v3.z > z
z = f.v3.z
endif
for i=0 to faces.length
f = faces[i]
if f.v1.z >= z
AddXNode(p.nodes, f.v1)
endif
if f.v2.z >= z
AddXNode(p.nodes, f.v2)
endif
if f.v3.z >= z
AddXNode(p.nodes, f.v3)
endif
next
i = p.nodes.length
p.nodes.sort()
s = Getbase(name)
if IsReverse(name)
for i=p.nodes.length -1 to 0 step -1
v = p.nodes[i]
s = s+" "+str(v.x)+","+str(v.y)+","+str(v.z * -1)
next
else
for i=0 to p.nodes.length
v = p.nodes[i]
s = s+" "+str(v.x)+","+str(v.y)+","+str(v.z * -1)
next
endif
WriteLine(PathFile, s)
endfunction
function AddXNode(nodes ref as point[], point as point)
i as integer
n as point
for i = 0 to nodes.length
n = nodes[i]
if n.x = point.x
exitfunction
endif
next
nodes.insert(point)
endfunction
function CloneName(name as string)
i as integer
n as String
n = n + ".obj"
endfunction n
function getBounds(v as point, b as bounds)
if v.x > b.x.max
b.x.max = v.x
endif
if v.x < b.x.min
b.x.min = v.x
endif
if v.y > b.y.max
b.y.max = v.y
endif
if v.y < b.y.min
b.y.min = v.y
endif
if v.z > b.z.max
b.z.max = v.z
endif
if v.z < b.z.min
b.z.min = v.z
endif
endfunction b
function GetSeq(name as string)
s as string
c as string
n as string
i as integer
s = GetStringToken(name, "~.", 2)
for i=1 to len(s)
c = mid(s, i, 1)
if c >= "0" and c =< "9"
n = n + c
else
exit
endif
next
i = val(n)
endfunction i
function IsMipMap(name as string)
r as integer
if FindString(GetStringToken(name, "~.", 2), "m", 1, 1) > 0
r = TRUE
else
r = FALSE
endif
endfunction r
function IsPath(name as string)
r as integer
if FindString(GetStringToken(name, "~.", 2), "l", 1, 1) > 0
r = TRUE
else
r = FALSE
endif
endfunction r
function IsReverse(name as string)
r as integer
if FindString(GetStringToken(name, "~.", 2), "r", 1, 1) > 0
r = TRUE
else
r = FALSE
endif
endfunction r
function IsVector(name as string)
r as integer
if FindString(GetStringToken(name, "~.", 2), "v", 1, 1) > 0
r = TRUE
else
r = FALSE
endif
endfunction r
function IsTransparent(name as string)
r as integer
if FindString(GetStringToken(name, "~.", 2), "t", 1, 1) > 0
r = TRUE
else
r = FALSE
endif
endfunction r
function IsShape(name as string)
r as integer
if FindString(GetStringToken(name, "~.", 2), "q", 1, 1) > 0
r = TRUE
else
r = FALSE
endif
endfunction r
function IsUv(name as string)
r as integer
if FindString(GetStringToken(name, "~.", 2), "u", 1, 1) > 0
r = TRUE
else
r = FALSE
endif
endfunction r
function IsBounds(name as string)
r as integer
if FindString(GetStringToken(name, "~.", 2), "i", 1, 1) > 0
r = TRUE
else
r = FALSE
endif
endfunction r
function IsPoint(name as string)
r as integer
if FindString(GetStringToken(name, "~.", 2), "p", 1, 1) > 0
r = TRUE
else
r = FALSE
endif
endfunction r
function GetNumbers(name as string)
w as string
s as string
i as integer
c as string
w = GetStringToken(name, "~.", 2)
for i=1 to len(w)
c = mid(w, i, 1)
if c >= "0" and c =< "9"
s = s + c
endif
next
endfunction s
function StripNumbers(name as string)
w as string
s as string
i as integer
c as string
w = GetStringToken(name, "~.", 1)
for i=1 to len(w)
c = mid(w, i, 1)
if c >= "0" and c =< "9"
exit
endif
s = s + c
next
endfunction s
function IsBase(name as string)
r as integer
s as string
s = GetStringToken(name, "~.", 2)
if FindString(s, "b", 1, 1) > 0
r = TRUE
else
r = FALSE
endif
endfunction r
function IsShapeCylinder(name as string)
r as integer
s as string
s = GetStringToken(name, "~.", 2)
if FindString(s, "g", 1, 1) > 0
r = TRUE
else
r = FALSE
endif
endfunction r
function IsShapePoly(name as string)
r as integer
s as string
s = GetStringToken(name, "~.", 2)
if FindString(s, "w", 1, 1) > 0
r = TRUE
else
r = FALSE
endif
endfunction r
function IsShapeBox(name as string)
r as integer
s as string
s = GetStringToken(name, "~.", 2)
if FindString(s, "h", 1, 1) > 0
r = TRUE
else
r = FALSE
endif
endfunction r
function IsShapeSphere(name as string)
r as integer
s as string
s = GetStringToken(name, "~.", 2)
if FindString(s, "f", 1, 1) > 0
r = TRUE
else
r = FALSE
endif
endfunction r
function IsDynamicBody(name as string)
r as integer
s as string
s = GetStringToken(name, "~.", 2)
if FindString(s, "d", 1, 1) > 0
r = TRUE
else
r = FALSE
endif
endfunction r
function IsStaticBody(name as string)
r as integer
s as string
s = GetStringToken(name, "~.", 2)
if FindString(s, "s", 1, 1) > 0
r = TRUE
else
r = FALSE
endif
endfunction r
function IsCenter(name as string)
r as integer
s as string
s = GetStringToken(name, "~.", 2)
if FindString(s, "e", 1, 1) > 0
r = TRUE
else
r = FALSE
endif
endfunction r
function IsZPlane(name as string)
r as integer
s as string
s = GetStringToken(name, "~.", 2)
if FindString(s, "z", 1, 1) > 0
r = TRUE
else
r = FALSE
endif
endfunction r
function IsYPlane(name as string)
r as integer
s as string
s = GetStringToken(name, "~.", 2)
if FindString(s, "y", 1, 1) > 0
r = TRUE
else
r = FALSE
endif
endfunction r
function IsXPlane(name as string)
r as integer
s as string
s = GetStringToken(name, "~.", 2)
if FindString(s, "x", 1, 1) > 0
r = TRUE
else
r = FALSE
endif
endfunction r
function IsClone(name as string)
r as integer
s as string
s = GetStringToken(name, "~.", 2)
if FindString(s, "c", 1, 1) > 0
r = TRUE
else
r = FALSE
endif
endfunction r
#insert "LoadScene.agc"