Okay I got my SKS Tile Editor and Viewer to work in DBC
heres the codez
Heres the DBC codes for the Level Editor
REM Project: SKS Tile Editor
REM Created: 9/1/2004 7:23:10 PM
REM
REM ***** Main Source File *****
REM
sync on : sync rate 60
set sprite 1000,1,0
hide mouse
GoSub Load_Tiles_and_Images
GoSub SetUpArrays
`=================================
`--------START MAIN LOOP----------
`=================================
do
GoSub LoadLevel
`Paste The Background Grid onto the screen
sprite 52,BackgroundX,BackgroundY,52
`Attack a Tile to the Mouse X and Y coordinates
sprite 51,PointerX,PointerY,1
GoSub Info
PointerX = MouseX()
PointerY = MouseY()
GoSub TileCode
GoSub Grid
GoSub PasteTileCode
GoSub SaveLevel
sync
loop
Load_Tiles_and_Images:
`Specify the Number Of Tiles that you have loaded
NumberOfTiles = 23
load image "Tiles1.bmp",1,1
load image "Tiles2.bmp",2,1
load image "Tiles3.bmp",3,1
load image "Tiles4.bmp",4,1
load image "Tiles5.bmp",5,1
load image "Tiles6.bmp",6,1
load image "Tiles7.bmp",7,1
load image "Tiles8.bmp",8,1
load image "Tiles9.bmp",9,1
load image "Tiles10.bmp",10,1
load image "Tiles11.bmp",11,1
load image "Tiles12.bmp",12,1
load image "Tiles13.bmp",13,1
load image "Tiles14.bmp",14,1
load image "Tiles15.bmp",15,1
load image "Tiles16.bmp",16,1
load image "Tiles17.bmp",17,1
load image "Tiles18.bmp",18,1
load image "Tiles19.bmp",19,1
load image "Tiles20.bmp",20,1
load image "Tiles21.bmp",21,1
load image "Tiles22.bmp",22,1
load image "Tiles23.bmp",23,1
load image "TilesBlank.bmp",100,1
load image "spritesBackground.bmp",52,1
load image "spritesBlankBackground.bmp",53,1
`If you uncomment the following lines of code
`You can load a map which you can place sprites on
`load image "BackgroundBackground.bmp",100,1
`paste image 30,20,1
return
SetUpArrays:
dim NumberofTile(1000)
dim TilePositionX(1000)
dim TilePositionY(1000)
dim TileType(1000)
dim TileAreaL(300,15)
dim TileAreaT(300,15
dim TileAreaR(300,15)
dim TileAreaB(300,15)
return
Info:
If keystate(23) = 1 then ShowInfo = 1
If keystate(24) = 1 then ShowInfo = 0
if ShowInfo = 1
set text opaque
text 1,1, STR$(TilePasted)
text 1,15, "MouseX: " + Str$(MouseX())
text 1,30, "MouseY: " + Str$(MouseY())
endif
if ShowInfo = 0
text 1,1, ""
text 1,15, ""
text 1,30, ""
endif
return
TileCode:
for N = 2 to 11
`Sets the 0 - 9 number keys to select tiles
if Keystate(N) = 1 then Tile = N - 1
next N
if rightkey() = 1 and MoveTileRight = 0
`If rightkey is pressed then change the tile
MoveTileRight = 1
Tile = Tile + 1
wait 100
MoveTileRight = 0
endif
if leftkey() = 1 and MoveTileLeft = 0
`If leftkey is pressed then change the tile
MoveTileLeft = 1
Tile = Tile - 1
wait 100
MoveTileLeft = 0
endif
if Tile > NumberOfTiles then Tile = 1
if Tile < 1 then Tile = NumberOfTiles
for T = 1 to NumberOfTiles
`Sets your Mouse Cursor to the current Tile Selected
if Tile = T then sprite 51,PointerX,PointerY,T
next T
return
Grid:
if keystate(34) = 1 then ToggleGrid = 0
if keystate(35) = 1 then ToggleGrid = 1
if ToggleGrid = 0 then sprite 52,BackgroundX,BackgroundY,52
if ToggleGrid = 1 then sprite 52,BackgroundX,BackgroundY,53
return
PasteTileCode:
if mouseclick() = 1 and Tile > 0 and TileReady = 0
TileReady = 1
inc TilePasted
For Y1 = 1 to 15
For X1 = 1 to 20
`Divides the screen up into 300 different 32*32 squares
TileAreaL(X1 * Y1,Y1) = (X1 * 32) - 32
TileAreaT(X1 * Y1,Y1) = (Y1 * 32) - 32
TileAreaR(X1 * Y1,Y1) = (X1 * 32)
TileAreaB(X1 * Y1,Y1) = (Y1 * 32)
next X1
next Y1
for a = 1 to 300
for b = 1 to 15
`This basically says if Mouse Cursor is inside a Square of the grid
`And mouse is clicked then Paste the current tile inside that Square.
if PointerX >= TileAreaL(a,b) and PointerX =< TileAreaR(a,b) and PointerY >= TileAreaT(a,b) and PointerY =< TileAreaB(a,b)
paste image Tile,TileAreaL(a,b),TileAreaT(a,b)
`This Array Stores the X and Y coordinates of the image
`Just pasted.
TilePositionX(TilePasted) = TileAreaL(a,b)
TilePositionY(TilePasted) = TileAreaT(a,b)
endif
next b
next a
`This Array Stores the current Image number
NumberofTile(TilePasted) = Tile
`This Array stores either a 1 or 2
`1 tells the program that the tile will just be pasted
`2 Tells the program that the tile will put on the screen as a sprite
TileType(TilePasted) = 1
wait 150
TileReady = 0
endif
if mouseclick() = 2 and Tile > 0 and TileReady = 0
TileReady = 1
inc TilePasted
paste image Tile,PointerX,PointerY
`This Array Stores the current Image number
NumberofTile(TilePasted) = Tile
`This Array Stores the X and Y coordinates of the image
`Just pasted.
TilePositionX(TilePasted) = PointerX
TilePositionY(TilePasted) = PointerY
`This Array stores either a 1 or 2
`1 tells the program that the tile will just be pasted
`2 Tells the program that the tile will put on the screen as a sprite
TileType(TilePasted) = 2
if ShowInfo = 1
set text size 10
text 1,45,"Image Number" + " " + STR$(TilePasted)
text 1,60,"Will be Saved as a sprite"
endif
wait 150
TileReady = 0
endif
if spacekey() = 1
paste image 100,PointerX,PointerY
inc TilePasted
NumberofTile(TilePasted) = 100
TilePositionX(TilePasted) = PointerX
TilePositionY(TilePasted) = PointerY
TileType(TilePasted) = 1
endif
return
SaveLevel:
if keystate(31) = 1
if file exist("TilePasted.dat") then delete file "TilePasted.dat"
open to write 1,"TilePasted.dat"
write file 1,TilePasted
close file 1
if File exist("NumberOfTile.array") then delete file "NumberOfTile.array"
save array "NumberOfTile.array",NumberOfTile(0)
if File exist("TilePositionX.array") then delete file "TilePositionX.array"
save array "TilePositionX.array",TilePositionX(0)
if File exist("TilePositionY.array") then delete file "TilePositionY.array"
save array "TilePositionY.array",TilePositionY(0)
if File exist("TileType.array") then delete file "TileType.array"
save array "TileType.array",TileType(0)
text 275,100,"File Saved"
endif
return
LoadLevel:
if keystate(38) = 1
cls
open to read 1,"TilePasted.dat"
read file 1,TilePasted
TP = TilePasted
close file 1
dim NumberOfTile(1000)
dim TilePositionX(1000)
dim TilePositionY(1000)
dim TileType(1000)
load array "NumberOfTile.array",NumberOfTile(0)
load array "TilePositionX.array",TilePositionX(0)
load array "TilePositionY.array",TilePositionY(0)
load array "TileType.array",TileType(0)
for a = 1 to TilePasted
if TileType(a) = 2
b = a + 1000
sprite b,TilePositionX(a),TilePositionY(a),NumberOfTile(a)
endif
next a
for b = 1 to TilePasted
if TileType(b) = 1 then paste image NumberOfTile(b),TilePositionX(b),TilePositionY(b)
next b
endif
return
And the DBC Codes for the Level Viewer
REM Project: SKS Tile Viewer
REM Created: 10/1/2004 10:57:29 AM
REM
REM ***** Main Source File *****
REM
set sprite 1000,1,0
hide mouse
load image "Tiles1.bmp",1001,1
load image "Tiles2.bmp",1002,1
load image "Tiles3.bmp",1003,1
load image "Tiles4.bmp",1004,1
load image "Tiles5.bmp",1005,1
load image "Tiles6.bmp",1006,1
load image "Tiles7.bmp",1007,1
load image "Tiles8.bmp",1008,1
load image "Tiles9.bmp",1009,1
load image "Tiles10.bmp",1010,1
load image "Tiles11.bmp",1011,1
load image "Tiles12.bmp",1012,1
load image "Tiles13.bmp",1013,1
load image "Tiles14.bmp",1014,1
load image "Tiles15.bmp",1015,1
load image "Tiles16.bmp",1016,1
load image "Tiles17.bmp",1017,1
load image "Tiles18.bmp",1018,1
load image "Tiles19.bmp",1019,1
load image "Tiles20.bmp",1020,1
load image "Tiles21.bmp",1021,1
load image "Tiles22.bmp",1022,1
load image "Tiles23.bmp",1023,1
load image "TilesBlank.bmp",1100,1
`load image "BackgroundBackground.bmp",30,1
`paste image 30,20,1
Load_Level:
open to read 1,"TilePasted.dat"
read file 1,TilePasted
close file 1
dim NumberOfTile(1000)
dim TilePositionX(1000)
dim TilePositionY(1000)
dim TileType(1000)
load array "NumberOfTile.array",NumberOfTile(0)
load array "TilePositionX.array",TilePositionX(0)
load array "TilePositionY.array",TilePositionY(0)
load array "TileType.array",TileType(0)
`text 25,1,STR$(NumberOfTile(1)) + " " + STR$(TilePositionX(1)) + " " + STR$(TilePositionY(1))
`text 25,15,STR$(NumberOfTile(10)) + " " + STR$(TilePositionX(10)) + " " + STR$(TilePositionY(10))
`text 25,30,STR$(NumberOfTile(20)) + " " + STR$(TilePositionX(20)) + " " + STR$(TilePositionY(20))
`for a = 1 to TilePasted
` b = a + 1000
` sprite b,TilePositionX(a),TilePositionY(a),NumberOfTile(a) + 1000
` paste image NumberOfTile(a) + 1000,TilePositionX(a),TilePositionY(a)
`next a
for a = 1 to TilePasted
if TileType(a) = 2
b = a + 1000
sprite b,TilePositionX(a),TilePositionY(a),NumberOfTile(a) + 1000
endif
next a
for b = 1 to TilePasted
if TileType(b) = 1 then paste image NumberOfTile(b) + 1000,TilePositionX(b),TilePositionY(b)
next b
wait key
Tell me if you like it or whatever.

http://www.angelfire.com/games5/db_games/