| I keep getting this error i've located the problem. 
 seems to be coming from this function
 
 
 
Function savepackage(afile$,pack:package)
If afile$ = "" Or pack = Null Then Return -1
Local indexdoc:xmlDocument = xmlDocument.Create()
Local inode:xmlNode,map:area,mat:TTMaterial
Local cnode:xmlNode,tnode:xmlNode,pm:TPixmap
Local filelist:TList = New TList,pfile:packfile
'lets create an index
indexdoc.Root().Name = "includes"
'lets add our areas if any
For mat = EachIn material_list
	If mat.pack = pack Then
	inode = indexdoc.Root().AddNode("material", AS_CHILD)
	inode.Attribute("handle").Value = mat.pbucket_handle$
	inode.Attribute("index").Value = mat.index
	inode.Attribute("name").Value = mat.mat_name$
	inode.Attribute("red").Value = mat.colalphshin#[0]
	inode.Attribute("green").Value = mat.colalphshin#[1]
	inode.Attribute("blue").Value = mat.colalphshin#[2]
	inode.Attribute("alpha").Value = mat.colalphshin#[3]
	inode.Attribute("shine").Value = mat.colalphshin#[4]
	inode.Attribute("blend").Value = mat.matbmode
		For i = 0 To 5
		inode.Attribute("flag"+i).Value = mat.matflags[i]	
		Next
	
	cnode = inode.AddNode("texture", AS_CHILD)
		For i = 0 To 2
		If texture$[i] <> "" Then
		tnode = cnode.AddNode("image", AS_CHILD)
		tnode.Attribute("index").Value = i		
		tnode.Attribute("anim").Value = mat.texanim[i]
		tnode.Attribute("frames").Value = mat.texframes[i]
		tnode.Attribute("w").Value = mat.texsizew[i]
		tnode.Attribute("h").Value = mat.texsizeh[i]
		tnode.Attribute("blend").Value = mat.textureblend[i]	
			For ii = 0 To 9
			tnode.Attribute("flag"+ii).Value = mat.texflags[ii+(i*10)]
			Next
		pfile = New packfile
		pm = LockImage(mat.texturecache[i])
		UnlockImage(mat.texturecache[i])
		SavePixmapPNG( pm,pfile.bfile,9 )
		pfile.file$ = pack.packid$+"."+pack.packname$+"."+mat.mat_name$
		tnode.Attribute("file").Value = pack.packid$+"."+pack.packname$+"."+mat.mat_name$
		ListAddLast(filelist,pfile)	
		EndIf
		Next
	
	EndIf
Next
For map = EachIn area_list
	If map.pack = pack Then
	inode = indexdoc.Root().AddNode("area", AS_CHILD)
	inode.Attribute("areaid").Value = map.areaid$
	inode.Attribute("areaname").Value = map.areaname$
	inode.Attribute("areatype").Value = map.areatype
	'now to add geometry data
	pfile = New packfile
		
	pfile.bfile = writegeodata(map.world)
	pfile.file$ = pack.packid$+"."+pack.packname$+"."+map.areaname$
	inode.Attribute("file").Value = pack.packid$+"."+pack.packname$+"."+map.areaname$
	ListAddLast(filelist,pfile)
	EndIf
Next
'Rem
pfile = New packfile
indexdoc.Save(pfile.bfile,FORMAT_BINARY)
pfile.file$ = "index"
ListAddLast(filelist,pfile)
'now save the resources together
For pfile = EachIn filelist
pfile.bbcfile = Crunch(pfile.bfile,4)
Next
'now add to archive file
For pfile = EachIn filelist
AddToArchive(pfile.bbcfile,pfile.file$,afile$)
Next
'End Rem
ClearList filelist
End Function 
 im using a modified version of BBCruncher but i commented out those functions and i still get the problem i think it may be related to maxml
 
 
 |