Old Code Not Compiling

Blitz3D Forums/Blitz3D Programming/Old Code Not Compiling

Miraj(Posted 2007) [#1]
It used to work in 187 which was the last time I ever used B3D. I'm getting an 'EndFunction Expected' in this section of code.

Function makeSkybox(skyFolder$,skyName$,skyScale%)
	skybox = CreateMesh()
	mainFolder$ = CurrentDir$()
	ChangeDir("skys")

 front
	brush = LoadBrush(skyName$ + "_front.png",49)
	surface = CreateSurface(skybox,brush)
	AddVertex(surface,-1,+1,-1,0,0)
	AddVertex(surface,+1,+1,-1,1,0)
	AddVertex(surface,+1,-1,-1,1,1)
	AddVertex(surface,-1,-1,-1,0,1)
	AddTriangle(surface,0,1,2)
	AddTriangle(surface,0,2,3)
	FreeBrush(brush)

 right
	brush = LoadBrush(skyName$ + "_right.png",49)
	surface = CreateSurface(skybox,brush)
	AddVertex(surface,+1,+1,-1,0,0)
	AddVertex(surface,+1,+1,+1,1,0)
	AddVertex(surface,+1,-1,+1,1,1)
	AddVertex(surface,+1,-1,-1,0,1)
	AddTriangle(surface,0,1,2)
	AddTriangle(surface,0,2,3)
	FreeBrush(brush)

 back
	brush = LoadBrush(skyName$ + "_back.png",49)
	surface = CreateSurface(skybox,brush)
	AddVertex(surface,+1,+1,+1,0,0)
	AddVertex(surface,-1,+1,+1,1,0)
	AddVertex(surface,-1,-1,+1,1,1)
	AddVertex(surface,+1,-1,+1,0,1)
	AddTriangle(surface,0,1,2)
	AddTriangle(surface,0,2,3)
	FreeBrush(brush)
 
 left
	brush = LoadBrush(skyName$ + "_left.png",49)
	surface = CreateSurface(skybox,brush)
	AddVertex(surface,-1,+1,+1,0,0)
	AddVertex(surface,-1,+1,-1,1,0)
	AddVertex(surface,-1,-1,-1,1,1)
	AddVertex(surface,-1,-1,+1,0,1)
	AddTriangle(surface,0,1,2)
	AddTriangle(surface,0,2,3)
	FreeBrush(brush)

 top
	brush = LoadBrush(skyName$ + "_top.png",49)
	surface = CreateSurface(skybox,brush)
	AddVertex(surface,-1,+1,+1,0,1)
	AddVertex(surface,+1,+1,+1,0,0)
	AddVertex(surface,+1,+1,-1,1,0)
	AddVertex(surface,-1,+1,-1,1,1)
	AddTriangle(surface,0,1,2)
	AddTriangle(surface,0,2,3)
	FreeBrush(brush)
   
 bottom
	brush = LoadBrush(skyName$ + "_bottom.png",49)
	surface = CreateSurface(skybox,brush)
	AddVertex(surface,-1,-1,-1,1,0)
	AddVertex(surface,+1,-1,-1,1,1)
	AddVertex(surface,+1,-1,+1,0,1)
	AddVertex(surface,-1,-1,+1,0,0)
	AddTriangle(surface,0,1,2)
	AddTriangle(surface,0,2,3)
	FreeBrush(brush)
    
 scale, flip, make fullbright and unfogged
	ScaleMesh(skybox,skyScale%,skyScale%,skyScale%)
	FlipMesh(skybox)
	EntityFX(skybox,9)
	ChangeDir(mainFolder$)
	Return(skybox)
End Function



Miraj(Posted 2007) [#2]
I still have the old .exe I compiled years ago, but when I try to run it I get "Illegal Memory Address" Any help either getting it to compile on 198 or getting the old one to run would be much appreciated.


skidracer(Posted 2007) [#3]
try putting a ; in front of all your comments, (especially the line that starts with scale, flip etc.)


Miraj(Posted 2007) [#4]
So now I feel about as stupid as is possible. :p I wrote that about 5 years ago, and it hasn't been changed since. Kinda weird that it compiled fine in those days. Thanks for the help. Works fine now. :)