why won't this work?

Blitz3D Forums/Blitz3D Beginners Area/why won't this work?

stayne(Posted 2006) [#1]
when i execute, i get an error at PositionEntity, and it tells me that m\mesh doesn't exist. i'm stumped! when i "Print meshfile", it looks right, quotes and all.

here is my code
propfile=ReadFile("zone.txt")
r=ReadLine(propfile)
i = 1
While i < r
	m.model=New model
	ReadLine(propfile)
	meshfile$ = ReadLine(propfile)
	m\mesh=LoadMesh(meshfile)
	meshx=ReadLine(propfile)
	meshy=ReadLine(propfile)
	meshz=ReadLine(propfile)
        ReadLine(propfile)
        ReadLine(propfile)
        ReadLine(propfile)
	PositionEntity m\mesh,meshx,meshy,meshz
	Print loaded
	i=i+1
Wend
CloseFile("zone.txt")


here's the zone.txt file contents:
4

"Props\WoodenTower_01\BUILD_TowerWood_01.b3d"
2700.0
411.0
3185.0
0.0
0.0
0.0

"Props\SmallOldRoundHouse\BUILD_Sml_RoundHouse_01.b3d"
2854.0
384.0
3047.0
0.0
0.0
-1.0

"Props\SmallOldRoundHouse\BUILD_Sml_RoundHouse_01.b3d"
431.0
533.0
2181.0
-1.0
-1.0
-1.0

"Props\TrollDwelling_01\BUILD_TrollDwell_01.b3d"
1724.0
450.0
2117.0
0.0
-132.0
0.0



Yeshu777(Posted 2006) [#2]
Off the top of my head, your not checking for the blank lines.

Try taking the blank lines out.


stayne(Posted 2006) [#3]
i thought ReadLine(propfile) skips to the next line?


Yeshu777(Posted 2006) [#4]
Yes it does and after a closer look you are skipping the blank lines.


OJay(Posted 2006) [#5]
err...quotes are no valid chars in a path/filename! either change this line:
	meshfile$ = ReadLine(propfile)

to:
	meshfile$ = Replace(ReadLine(propfile),Chr(34),"")


or change your zone.txt to:
4

Props\WoodenTower_01\BUILD_TowerWood_01.b3d
2700.0
411.0
3185.0
0.0
0.0
0.0

Props\SmallOldRoundHouse\BUILD_Sml_RoundHouse_01.b3d
2854.0
384.0
3047.0
0.0
0.0
-1.0

Props\SmallOldRoundHouse\BUILD_Sml_RoundHouse_01.b3d
431.0
533.0
2181.0
-1.0
-1.0
-1.0

Props\TrollDwelling_01\BUILD_TrollDwell_01.b3d
1724.0
450.0
2117.0
0.0
-132.0
0.0



stayne(Posted 2006) [#6]
:) you're the man. i appreciate it.