load object "media/test.x",1 `load terrain object, replace with own or use original
rem load image "media/fpswalkterrain.dba.jpg",76 `load texture for the terrain
rem texture object 1,76
rotate object 1,0,180,0
rem scale object 1, 200,140,200 `its too small otherwise
load object "media/trees.x",2
rem position object 1,object size x(1),0,object size z(1)
trees=0
open to read 1,"media/test.epr"
` Do this till the end of the file
while file end(1)=0
set cursor 0,0
sync
` Read the string
read string 1,Temp$
rem print Temp$
if temp$="[INSTANCES]"
trees=1
object1=1
endif
rem print Temp$
if trees=1
if LEFT$(temp$,12)="TED_Pos_XYZ="
for x=1 to 50
if left$(temp$,len(temp$)-x)="TED_Pos_XYZ="
temp1$=right$(temp$,x)
a$=" "
for lenx=2 to 50
if a$="," then goto _label1
x$=left$(temp1$,lenx)
a$=right$(x$,1)
temp2$=right$(temp1$,len(temp1$)-lenx)
next lenx
_label1:
a$=" "
for leny=2 to 50
if a$="," then goto _label2
y$=left$(temp2$,leny)
a$=right$(y$,1)
temp3$=right$(temp2$,len(temp2$)-leny)
next leny
_label2:
a$=" "
for lenz=2 to 50
if a$="," then goto _label3
z$=right$(temp3$,lenz)
a$=left$(z$,1)
next lenz
_label3:
endif
next x
clone object object1+1000,2
lenx=len(x$)-1
leny=len(y$)-1
x1$=left$(x$, lenx )
y1$=left$(y$, leny )
position object 1000+object1,-val(x1$),val(y1$),-val(z$)
inc object1
endif
endif
print "x,y,z=";Temp1$
print "y,z=";temp2$
print "z=";temp3$
print "x=";X1$
print "y=";y1$
print "z=";z$
endwhile
trees=0
` Close the file
close file 1
sync
wait key
i do it.
thx
translated translator yandex or google