Thanks for the replies.
I am not doing any extern stuff. I don't know what a callback is. I'm not using any dangerous pointers. Unless stuff like this is dangerous: "Global Area:Byte[,][,][]"
None of the include files are executing anything except CreateList() comands as initializers to global fields.
I've cut the code down to this:
Strict
Import "gui/gui.bmx"
Import "guykind.bmx"
Import "tilekind.bmx"
Include "tile.bmx"
Include "guy.bmx"
Include "battle.bmx"
Include "screen.bmx"
Include "item.bmx"
Print "about to call ttilekind.setup(0)"
ttilekind.setup(0)
Each include also declares and initializes a few globals.
Here is the erroring function definition and its type fields:
Type TTileKind
Global FontDraw(Text:String,X:Int,Y:Int,CenterX:Byte,CenterY:Byte,AlignRight:Byte)
'has it loaded the full size version yet?
Field LoadedBig:Byte
'the small version is stored in Image, until the big one is loaded and overwrites it.
'smallimage holds the small version for the editor to use at any time.
Field SmallImage:timage
Field Image:timage
'
Field ShadowImage:timage
'
Field ImageArray:timage[]
'
Field ImageArrayAm:Int
'if the drawtile is not the bottom right of its area,. how far away from the bottom.
Field DrawTileYLess:Int
Field Color:Byte[3]
'how fast a guy will walk when on this tilekind.
'multiplier. default is 1, which is will make to guy move at his normal speed.
Field Speed:Float
'How fast a guy will change his speed to the speed of this tile.
'the lower the speedchange the more momentum will carry over to the tile.
'And when low, it will take longer to start going fast.
'multiplier. 1=normal.
Field SpeedChange:Float
'
Field Id:Int
'for the editor
Field Group:Int
'pixel offset for drawing
Field HandleX:Int
Field HandleY:Int
'size in tiles
Field SizeX:Int
Field SizeY:Int
'standard scale. or if min<>max then random scales when the tile is created
Field ScaleXMin:Float
Field ScaleXMax:Float
'if scaleymin=0 then it will always scale the y to whatever it scales the x to.
Field ScaleYMin:Float
Field ScaleYMax:Float
'how much could be subtracted at random from its normal color.
Field ColorMinus:Byte[3]
'what area the tile takes up. used for collision
Field Area:Byte[,][,]
'what area has its terrain.
'differs from regular area when a tile has some walkable terrain and some unwalkable area.
'in that case the area[] will be the unwalkable, and the areawalk will be the terrain area.
Field AreaWalk:Byte[,][,]
'a twalk const. what kind of terrain
Field Walk:Int
'if this tile is unwalkable on its area, but there is also another terrain here. for editor
Field Walk2:Int
'if this tilekind actually uses the image of another.
Field KindImageUse:ttilekind
'all the tiles that can be automatiacally randomly placed insteadof/on this tile.
Field PutRandomList:TList
Global All:Byte[,][,]
Global Am:Int=874
Global Array:ttilekind[]
Global grouplist:TList[]
Global GroupAm:Int
Const GroupBeach=1
Const GroupSand=2
Const GroupGrass=3
Const GroupRock=4
Const GroupLavaCave=5
Const GroupIceCave=6
Const GroupSnow=7
Const GroupDirtRocky=8
Const GroupDirtSmooth=9
Const GroupStoneGround=10
Const GroupBrickCrystal=11
Const GroupTileGrey=12
Const GroupStoneRockGround=13
Const GroupGrassBorder=14
Const GroupCaveBorder=15
Const GroupWaterBorder=16
Const GroupCliff=17
Const GroupStoneWall=18
Const GroupFence=19
Const GroupPlant=20
Const GroupTree=21
Const GroupBuilding=22
Const GroupOutDoor=23
Const GroupInDoor=24
Const GroupRug=25
Const GroupFloorBoard=26
Const GroupCarpet=27
Const GroupCounter=28
Const GroupWhiteWall=29
Const GroupBridge=30
Function Setup(LoadAll:Byte)
Print "in ttilekind.setup"