Hi all
I recently downloaded the MatEdit_6.exe from a link on one of the posts, from the looks of it, it is amazing, to create a landscape with relative ease.
I do however have a minor problem...
I started by making my matrix of a landscape, saving the .moa, then built a .dba, of which i opened in Darkbasic Pro, which produced a lot of code to build the matrix.
I tried to build an executable file but it said "#100011: Cound not understand command at line 139" which the line reads "Data 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0".
If I use the remstart and remend commands at the beginning of the "Matrix Texture Data" Section I can build an executable file, attempt to run it but then it says "Rutime error 7011: Matrix dimensions are illegal at line 38" of which the line reads
"Read UsersImage#".
I will put the source code here
Rem **************************************
Rem ** Matrix .DBA Code File Writer **
Rem ** Written By MatEdit V1.6a **
Rem ** Code Writing Engine Version 0.1a **
Rem **************************************
Dim FKey(10,1): Dim Info(2): Dim Tiles(500,500): Dim ColData(100): Dim ZoneData(100)
Set Display Mode 800,600,16
Sync On
Hide Mouse
Backdrop On
Color Backdrop 0
Set Camera Range 10.0,100000.0
Rem Read Matrix Header Data Statements...
Read MatWidth#
Read MatHeight#
Read TilesX
Read TilesZ
TilesizeX#=MatWidth#/TilesX
TilesizeZ#=MatHeight#/TilesZ
Info(0)=TilesizeX#: Info(1)=TilesizeZ#
Read TextureSize#
Read Foggy
Read FRed
Read FGreen
Read FBlue
Read FDist
If Foggy=1
Fog Color RGB(FRed,FGreen,FBlue)
Fog Distance FDist
Fog On
Else
Fog Off
Endif
Read Norm
Read UsedTex
Read UsersImage#
Make Matrix 1,MatWidth#,MatHeight#,TilesX,TilesZ
Rem Load Project Image...
Bmpname$="_.bmp"
Load Bitmap Bmpname$,1
Get Image 1,0,0,Int(UsersImage#*TextureSize#),Int(UsersImage#*TextureSize#)
Delete Bitmap 1
Rem Create texture tile set from project image...
Prepare Matrix Texture 1,1,Int(UsersImage#),Int(UsersImage#)
For N1=0 To TilesZ-1: Rem Read in texture values for each matrix tile
For N2=0 To TilesX-1
Read MatTex
Set Matrix Tile 1,N2,N1,MatTex
Tiles(N2,N1)=MatTex
Next N2
Next N1
For N1=0 To TilesZ: Rem Read in height values for each matrix tile
For N2=0 To TilesX
Read MatHt#: Rem Height
Set Matrix Height 1,N2,N1,MatHt#
Next N2
Next N1
If Norm=1
Gosub Normalise
Endif
Update Matrix 1: Rem Update the matrix with all the changes
Rem Load Collision Data
Info(1)=UsedTex
For N=1 To UsedTex
Read ColData(N): Rem <<< Collision Value (0 or 1) of textures used
Read ZoneData(N): Rem <<< Battle Area (0 - 9) of textures used
Next N
Rem Load Hotspot Data
For N=1 To 10
Read FKey(N,0): Rem X Pos
Read FKey(N,1): Rem Z Pos
Next N
CamX#=FKey(1,0)*TilesizeX#+(TilesizeX#/2)
CamZ#=FKey(1,1)*TilesizeZ#-(TilesizeZ#/2)
GH#=Get Ground Height(1,CamX#,CamZ#)+100.0
Position Camera CamX#,GH#,CamZ#
Do
CX#=Camera Angle X(): CY#=Camera Angle Y(): CZ#=Camera Angle Z()
CX#=Wrapvalue(CX#-mousemovey()): CY#=Wrapvalue(CY#+mousemovex())
Rotate Camera CX#,CY#,CZ#
Rem Use left mouse button to move forwards
If MouseClick()=1
GH#=Get Ground Height(1,Camera Position x(), Camera Position z() )
Move Camera 40
If camera position y()<GH#+150.0
Position Camera Camera Position X(),GH#+150.0,Camera Position z()
Endif
Endif
Rem Use right mouse button to move backwards
If MouseClick()=2
GH#=Get Ground Height(1,Camera Position x(), Camera Position z() )
Move Camera -40
If camera position y()<gh#+150.0
Position Camera Camera Position X(),gh#+150.0,Camera Position z()
Endif
Endif
Sync
Loop
End: Rem *** End Of Main Program ***
Rem ********************************************************
Rem * Normalise Matrix Subroutine *
Rem ********************************************************
Normalise:
Rem Following Routine by Lee Bamber from Dark Basic Example Code
For z=1 To TilesZ
For x=1 To TilesX
h8#=Get Matrix Height(1,x,z-1)
h4#=Get Matrix Height(1,x-1,z)
h#=Get Matrix Height(1,x,z)
h2#=Get Matrix Height(1,x,z)
x1#=(x-1)*25.0: y1#=h#
x2#=(x+0)*25.0: y2#=h4#
dx#=x2#-x1#: dy#=y2#-y1#
ax#=Atanfull(dx#,dy#)
ax#=Wrapvalue(90-ax#)
z1#=(z-1)*25.0: y1#=h2#
z2#=(z+0)*25.0: y2#=h8#
dz#=z2#-z1#: dy#=y2#-y1#
az#=Atanfull(dz#,dy#)
az#=Wrapvalue(90-az#)
nx#=Sin(ax#): ny#=Cos(ax#): nz#=Sin(az#)
Set Matrix Normal 1,x,z,nx#,ny#,nz#
Next x
Next z
Return
Rem *** Start Of Data Statements ***
Rem *** Matrix Infomation ***
Data 100000.0, 100000.0, 25, 25, 128.0, 0, 255, 255, 255, 20000, 1, 2, 2.0
Rem *** Matrix Texture Data ***
Data 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Data 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Data 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Data 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Data 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Data 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Data 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Data 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Data 0, 0, 0, 0, 0, 0, 0, 0, 0, 0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0, 0, 0, 0, 0, 0, 0, 0
Data 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Data 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Data 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Rem *** Matrix Height Data ***
Data 539.0, 129.0, 980.0, 1348.0, 1030.0, 562.0, 108.0, 1133.0, 1086.0, 1480.0, 1318.0, 500.0, 675.0
Data 1388.0, 836.0, 362.0, 5.0, 1335.0, 1251.0, 445.0, 175.0, 1278.0, 683.0, 914.0, 1064.0, 813.0
Data 833.0, 955.0, 838.0, 1148.0, 434.0, 201.0, 722.0, 1091.0, 418.0, 1431.0, 258.0, 1154.0, 1255.0
Data 321.0, 666.0, 529.0, 735.0, 1219.0, 235.0, 596.0, 973.0, 178.0, 1176.0, 493.0, 356.0, 1150.0
Data 1176.0, 455.0, 1489.0, 1476.0, 333.0, 1478.0, 929.0, 1021.0, 1235.0, 357.0, 1463.0, 1462.0, 879.0
Data 1441.0, 195.0, 133.0, 948.0, 3.0, 1102.0, 1053.0, 635.0, 119.0, 433.0, 1018.0, 945.0, 1397.0
Data 1416.0, 469.0, 525.0, 683.0, 1123.0, 539.0, 1155.0, 628.0, 1413.0, 532.0, 1125.0, 1053.0, 340.0
Data 1268.0, 1191.0, 1324.0, 674.0, 744.0, 614.0, 395.0, 256.0, 726.0, 1150.0, 665.0, 1281.0, 568.0
Dat
Data 591.0, 568.0, 73.0, 888.0, 670.0, 869.0, 309.0, 184.0, 316.0, 923.0, 1064.0, 1404.0, 361.0, 697.0
Data 1354.0, 1084.0, 886.0, 797.0, 1212.0, 964.0, 936.0, 1385.0, 290.0, 1.0, 203.0, 340.0
Data 1408.0, 1084.0, 720.0, 1488.0, 985.0, 932.0, 801.0, 722.0, 718.0, 1398.0, 59.0, 1480.0, 927.0, 820.0
Data 1325.0, 1242.0, 607.0, 1248.0, 1395.0, 946.0, 1289.0, 906.0, 219.0, 167.0, 388.0, 1114.0
Data 128.0, 1109.0, 1073.0, 1143.0, 594.0, 570.0, 1103.0, 825.0, 566.0, 1022.0, 866.0, 1246.0, 1125.0
Data 541.0, 76.0, 422.0, 807.0, 1029.0, 541.0, 697.0, 1104.0, 841.0, 389.0, 1260.0, 1307.0, 1430.0
Data 1137.0, 319.0, 294.0, 711.0, 9.0, 896.0, 881.0, 1478.0, 262.0, 521.0, 1353.0, 1059.0, 140.0, 1199.0
Data 374.0, 824.0, 114.0, 25.0, 1121.0, 1105.0, 716.0, 1037.0, 363.0, 114.0, 366.0, 145.0
Data 1233.0, 1446.0, 293.0, 369.0, 474.0, 997.0, 329.0, 576.0, 465.0, 1421.0, 46.0, 1229.0, 1064.0, 754.0
Data 667.0, 1470.0, 124.0, 308.0, 73.0, 758.0, 236.0, 707.0, 452.0, 283.0, 478.0, 1480.0
Data 880.0, 921.0, 149.0, 717.0, 1235.0, 965.0, 1476.0, 1359.0, 517.0, 650.0, 754.0, 1396.0, 1373.0
Data 396.0, 757.0, 458.0, 1120.0, 122.0, 1105.0, 101.0, 1038.0, 1227.0, 306.0, 1502.0, 184.0, 1206.0
Dat
Data 643.0, 251.0, 1171.0, 448.0, 969.0, 333.0, 1185.0, 37.0, 1446.0, 1129.0, 356.0, 910.0, 1296.0, 0.0
Data 1475.0, 943.0, 300.0, 145.0, 230.0, 943.0, 791.0, 566.0, 168.0, 1000.0, 651.0, 1424.0
Data 1148.0, 984.0, 345.0, 731.0, 1044.0, 1442.0, 541.0, 424.0, 421.0, 419.0, 1031.0, 477.0, 407.0, 82.0
Data 1396.0, 382.0, 1148.0, 1153.0, 179.0, 1368.0, 1414.0, 748.0, 692.0, 688.0, 917.0, 849.0
Data 314.0, 1061.0, 939.0, 269.0, 1371.0, 988.0, 388.0, 1460.0, 876.0, 821.0, 1496.0, 53.0, 146.0, 14.0
Data 512.0, 483.0, 317.0, 763.0, 669.0, 1364.0, 1111.0, 1489.0, 379.0, 332.0, 880.0, 1499.0
Data 742.0, 766.0, 887.0, 618.0, 1443.0, 651.0, 1263.0, 1300.0, 364.0, 1161.0, 251.0, 881.0, 39.0, 730.0
Data 1152.0, 1072.0, 1132.0, 932.0, 182.0, 170.0, 1211.0, 991.0, 19.0, 79.0, 308.0, 952.0
Data 485.0, 1178.0, 385.0, 73.0, 1204.0, 465.0, 726.0, 948.0, 1324.0, 1075.0, 843.0, 406.0, 1164.0, 783.0
Data 238.0, 102.0, 199.0, 37.0, 460.0, 398.0, 1095.0, 924.0, 300.0, 1063.0, 155.0, 838.0
Data 820.0, 193.0, 53.0, 919.0, 1441.0, 1119.0, 894.0, 1023.0, 1059.0, 1416.0, 59.0, 539.0, 901.0, 392.0
Data 682.0, 1347.0, 688.0, 563.0, 1243.0, 995.0, 1489.0, 1206.0, 519.0, 1266.0, 545.0, 1481.0
Data 1197.0, 1371.0, 209.0, 144.0, 1053.0, 754.0, 612.0, 1275.0, 361.0, 404.0, 991.0, 794.0, 114.0, 421.0
Data 730.0, 1353.0, 163.0, 463.0, 474.0, 1451.0, 1176.0, 1135.0, 7.0, 1090.0, 1345.0, 106.0
Data 1468.0, 1247.0, 1355.0, 549.0, 645.0, 1491.0, 1210.0, 1499.0, 1201.0, 1128.0, 698.0, 1019.0, 1477.0
Data 887.0, 690.0, 671.0, 96.0, 1187.0, 1193.0, 696.0, 1339.0, 838.0, 255.0, 1176.0, 488.0, 645.0
Data 238.0, 451.0, 1446.0, 295.0, 904.0, 1296.0, 124.0, 791.0, 1302.0, 880.0, 189.0, 278.0, 376.0, 429.0
Data 1449.0, 162.0, 1316.0, 1092.0, 683.0, 175.0, 270.0, 433.0, 647.0, 1140.0, 224.0, 346.0
Data 235.0, 778.0, 1154.0, 523.0, 790.0, 675.0, 1427.0, 151.0, 998.0, 114.0, 570.0, 322.0, 318.0, 522.0
Data 332.0, 475.0, 1036.0, 1323.0, 766.0, 1428.0, 855.0, 544.0, 560.0, 203.0, 86.0, 139.0
Data 1061.0, 58.0, 854.0, 1236.0, 1057.0, 336.0, 1408.0, 1064.0, 458.0, 601.0, 363.0, 26.0, 1463.0, 428.0
Data 869.0, 1251.0, 581.0, 1088.0, 1125.0, 380.0, 766.0, 349.0, 660.0, 926.0, 370.0, 1313.0
Data 183.0, 1363.0, 918.0, 1454.0, 620.0, 865.0, 609.0, 1362.0, 656.0, 228.0, 1023.0, 322.0, 1224.0
Data 1001.0, 1304.0, 948.0, 129.0, 1310.0, 601.0, 1242.0, 616.0, 1014.0, 877.0, 940.0, 319.0, 962.0
Dat
Data 894.0, 956.0, 1023.0, 857.0, 10.0, 940.0, 841.0, 1286.0, 308.0, 254.0, 136.0, 773.0, 704.0, 897.0
Data 1285.0, 124.0, 1317.0, 910.0, 643.0, 1365.0, 38.0, 274.0, 1117.0, 872.0, 909.0, 1452.0
Data 925.0, 21.0, 446.0, 1475.0, 1075.0, 171.0, 813.0, 1003.0, 25.0, 898.0, 1074.0, 768.0, 1097.0, 827.0
Data 508.0, 323.0, 535.0, 297.0, 131.0, 119.0, 184.0, 1105.0, 1479.0, 1503.0, 670.0, 835.0
Data 1142.0, 357.0, 676.0, 1235.0, 1393.0, 662.0, 478.0, 1004.0, 466.0, 1196.0, 187.0, 463.0, 589.0
Data 481.0, 160.0, 1218.0, 539.0, 863.0, 1382.0, 81.0, 240.0, 279.0, 203.0, 1339.0, 942.0, 1278.0
Data 634.0, 8.0, 1021.0, 1270.0, 311.0, 1177.0, 1120.0, 1495.0, 475.0, 170.0, 1459.0, 400.0, 387.0, 493.0
Data 296.0, 1344.0, 826.0, 629.0, 585.0, 875.0, 1485.0, 1510.0, 600.0, 351.0, 497.0, 1421.0
Rem *** Matrix Texture Collision & Zone Data ***
Data 0, 0, 0, 0
Rem *** Matrix Hotspot Data ***
Data -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
Rem *** End Of Data Statements ***
.
This is how it loaded into DarkBasic Pro from the .dba file a built using MatEdit_6.
Is there a compatability error or am I missing a stupidly easy thing to solve this problem?
Any help would be great, thanks
"Death is but an escape chosen by those who dare not live. I merely emancipate their souls." - Shadowblade, Master of Assassins.