Howdy Prancer,
Great Tutorial, after many years of DB ownership I'm finally getting into the programming part.
Leads me to my question.
I'm currently following the tutorial and have run into a problem, actually 2 but they may be related.
Page 4 of the pdf.
In the UpdateGUI() function there is a SELECT block which has the CASE NewIcn, it should call the SetupNewMap() function which isn't described in the pdf text. I just put in the CreateMap() function there to get it to compile.
Now it compiles but at runtime I am getting an illegal image at line 86 which is in the CreateMap() function, specifically the
IF MATRIX EXIST(1) = 1
Any help would be appreciated.
`CreateMap() Creates initial Map
FUNCTION CreateMap()
IF MATRIX EXIST(1) = 1
DELETE MATRIX 1
ENDIF
MAKE MATRIX 1, MapSizeX, MapSizeY, MapSegmentsX, MapSegmentsY
DIM Map(MapSegmentsX, MapSegmentsY)
PREPARE MATRIX TEXTURE 1, Tiles, 10,1
SET MATRIX TEXTURE 1,1,1
SET MATRIX TRIM 1, .002, 0
FOR i = 0 to MapSegmentsX -1
For y = 0 to MapSegmentsY - 1
SET MATRIX TILE 1,i,y,2
Map(i,y) = 2
NEXT y
NEXT i
UPDATE MATRIX 1
XROTATE CAMERA 90
POSITION CAMERA MapSizeX/2, MapSizeX-(MapSizeX/5),MapSizeY/2
ENDFUNCTION
Main.dba declarations
`Setup Variables
`=====Globals=====
GLOBAL MapName$ = "Default"
GLOBAL MapSizeX = 20
GLOBAL MapSizeY = 20
GLOBAL TileX = 20
GLOBAL TileY = 20
GLOBAL MapSegmentsX = 5
GLOBAL MapSegmentsY = 5
GLOBAL CurrentTile = 2 `2 = Buildable(grass) 1 = Unbuildable(sand) 3=Wall (wall) 4= Spawn
GLOBAL CurDir$
CurDir$ = GET DIR$()
GLOBAL HighlightX
GLOBAL HighlightY
GLOBAL Tiles = 21
`=====Constants=====
#CONSTANT SideBar = 2
#CONSTANT TopBar = 3
#CONSTANT LoadIcn = 4
#CONSTANT SaveIcn = 5
#CONSTANT NewIcn = 6
#CONSTANT Buildable = 10
#CONSTANT Unbuildable = 11
#CONSTANT Wall = 12
#CONSTANT Spawn = 13
#CONSTANT Finish = 14
-Gooney
Uboats in space...hmmmm. Aces of the Vaccuum?