CodeBase - 02_matrix
Return to the CodeBase listing
Category: Complete Applications
Version: 1.0
Information
Uploaded: 28th Feb 2005 17:44
Modified: 1st Jan 1970 01:00
Author: Anonymous Coder
Summary
` This code was downloaded from The Game Creators ` It is reproduced here with full permission ` http://www.thegamecreators.com Rem Project: MATRIX MASTER PRO Rem Created: 5/17/04 4:36:23 PM Rem ***** Main Source File ***** rem this program written by Richard Sardini Jr rem my e-mail:[email protected] rem my phone:814-504-6033 rem check end of program for code snippet to load matrix into your dark basic programs set display mode 800,600,16 create bitmap 1,65,161 rem texture 1 (green) ink RGB(128,128,0),0:for x=0 to 31:line x,0,x,32:next x ink RGB(0,128,0),0:for x=0 to 200:dot rnd(32)-1,rnd(32)-1:next x ink RGB(255,128,0),0:for x=0 to 50:dot rnd(32)-1,rnd(32)-1:next x ink RGB(128,128,255),0:for x=0 to 90:dot rnd(32)-1,rnd(32)-1:next x ink RGB(255,255,255),0:for x=0 to 20:dot rnd(32)-1,rnd(32)-1:next x rem texture 2 (medium grey) ink RGB(128,128,128),0:for x=31 to 64:line x,0,x,32:next x ink RGB(192,192,192),0:for x=0 to 200:dot rnd(32)+33,rnd(32)-1:next x ink RGB(60,81,66),0:for x=0 to 50:dot rnd(32)+33,rnd(32)-1:next x ink RGB(48,74,167),0:for x=0 to 90:dot rnd(32)+33,rnd(32)-1:next x ink RGB(255,255,255),0:for x=0 to 20:dot rnd(32)+33,rnd(32)-1:next x rem texture 3 (dark grey) ink RGB(82,82,82),0:for x=0 to 31:line x,32,x,65:next x ink RGB(0,0,0),0:for x=0 to 200:dot rnd(32)-1,rnd(32)+33:next x ink RGB(128,128,128),0:for x=0 to 50:dot rnd(32)-1,rnd(32)+33:next x ink RGB(57,36,159),0:for x=0 to 90:dot rnd(32)-1,rnd(32)+33:next x ink RGB(192,192,192),0:for x=0 to 20:dot rnd(32)-1,rnd(32)+33:next x rem texture 4 (light brown) ink RGB(194,160,114),0:for x=32 to 64:line x,32,x,65:next x ink RGB(255,209,164),0:for x=0 to 200:dot rnd(32)+33,rnd(32)+33:next x ink RGB(190,126,126),0:for x=0 to 50:dot rnd(32)+33,rnd(32)+33:next x ink RGB(255,230,204),0:for x=0 to 90:dot rnd(32)+33,rnd(32)+33:next x ink RGB(128,64,64),0:for x=0 to 20:dot rnd(32)+33,rnd(32)+33:next x rem texture 5 (medium brown) ink RGB(217,108,0),0:for x=0 to 31:line x,65,x,97:next x ink RGB(128,64,64),0:for x=0 to 200:dot rnd(32)-1,rnd(32)+65:next x ink RGB(185,92,0),0:for x=0 to 50:dot rnd(32)-1,rnd(32)+65:next x ink RGB(210,105,0),0:for x=0 to 90:dot rnd(32)-1,rnd(32)+65:next x ink RGB(255,197,138),0:for x=0 to 20:dot rnd(32)-1,rnd(32)+65:next x rem texture 6 (Black) ink RGB(0,0,0),0:for x=32 to 64:line x,65,x,98:next x rem texture 7 (Blue 1) ink RGB(0,0,255),0:for x=0 to 31:line x,97,x,130:next x ink RGB(0,128,255),0:for x=0 to 200:dot rnd(31)-1,rnd(32)+95:next x ink RGB(0,128,192),0:for x=0 to 50:dot rnd(31)-1,rnd(32)+95:next x ink RGB(255,255,255),0:for x=0 to 90:dot rnd(31)-1,rnd(32)+95:next x ink RGB(128,0,255),0:for x=0 to 20:dot rnd(31)-1,rnd(32)+95:next x rem texture 8 (Lt. Blue) ink RGB(0,255,255),0:for x=31 to 64:line x,96,x,130:next x ink RGB(128,255,255),0:for x=0 to 200:dot rnd(32)+33,rnd(31)+96:next x ink RGB(0,230,230),0:for x=0 to 50:dot rnd(32)+33,rnd(31)+96:next x ink RGB(151,255,255),0:for x=0 to 90:dot rnd(32)+33,rnd(31)+96:next x ink RGB(0,206,206),0:for x=0 to 20:dot rnd(32)+33,rnd(31)+96:next x rem texture 9 (White) ink rgb(255,255,255),0:for x=0 to 34:line x,127,x,161:next x ink RGB(218,218,218),0:for x=0 to 200:dot rnd(33)-1,rnd(31)+126:next x rem texture 10 (orange) ink RGB(255,128,0),0:for x=33 to 64:line x,128,x,161:next x ink RGB(255,128,64),0:for x=0 to 200:dot rnd(32)+33,rnd(31)+129:next x rem get matrix texture blur bitmap 1,3 get image 1,1,1,64,160 delete bitmap 1 create bitmap 1,50,50 ink RGB(0,0,255),0:for x=0 to 50:line x,0,x,50:next x ink rgb(0,255,255),0:for x=0 to 200:dot rnd(50),rnd(50):next x ink RGB(128,255,255),0:for x=0 to 70:dot rnd(50),rnd(50):next x ink RGB(255,255,255),0:for x=0 to 75:dot rnd(50),25+rnd(10):next x blur bitmap 1,3 get image 2,0,0,50,50 delete bitmap 1 hint=1:hints=36:hintdelay=750:hintspeed=0 dim hint$(40):hintc1=50:ghost=-1:ghost1=-1 hint$(1)="Press ' w ' to toggle wireframe on and off." hint$(2)="Press and hold mouse wheel button 3 and move mouse up and down to lower or raise selected markers respectively." hint$(3)="Or use keyboard less than ' < ' or greater than ' > ' to lower or raise selected markers respectively." hint$(4)="Press ' L ' to level the matrix back to zero." hint$(5)="Press Shift and 'L' to level select markers." hint$(6)="Press ' b ' to set maximum bottom sea depth. Use this to raise sea floor after smoothing lowers it too deep. Shift 5 to undo." hint$(7)="Press ' m ' to toggle wave flow off and back on." hint$(8)="Shift ' G ' to toggle ghost water on." hint$(9)="Press ' d ' to change the direction the waves are facing." hint$(10)="Press Shift and ' D ' to change the direction the waves are flowing." hint$(11)="Press ' n ' anytime in elevation mode to start a new matrix." hint$(12)="Press ' 5 ' to smooth matrix 1 time. Can be undone only 1 time. Thanks to ReD_eYe(and inspired by David89)." hint$(13)="Press Shift and ' 5 ' to undo smooth matrix once. Do this to save final smoothing for when your whole matrix is done." hint$(14)="Click on up and down arrows at the top right of the screen to set elevation change rate or wave settings." hint$(15)="Press ' q ' to raise the water level or ' a ' to lower the water level." hint$(16)="Press ' s ' to select all visible coordinate markers and ' u ' to un-select all visible markers." hint$(17)="Press ' v ' to slow down hints and shift + ' v ' to speed up hints." hint$(18)="Press ' t ' to toggle or invert all visible coordinate markers." hint$(19)="Press arrow keys to pan your view or press and hold mouse botton 2 and move mouse." hint$(20)="Press and hold both mouse buttons 1 and 2 and move mouse to rotate camera view." hint$(21)="Left click and drag mouse-(top left to bottom right)-and red box will appear to select markers in box." hint$(22)="Left click and drag mouse-(bottom right to top left)-and yellow box will appear to toggle or invert selected markers in box." hint$(23)="Press ' h ' to hide all unselected markers-this is handy to isolate work areas." hint$(24)="Press ' h ' again to show all hidden markers. Use this feature to hide and prevent selecting backround markers." hint$(25)="Green marker=unselected coordinate - Red marker=selected coordinate." hint$(26)="Press ' + ' or ' - ' to zoom in and out or turn the mouse wheel." hint$(27)="Set the cross hairs on your destination point and then zoom in." hint$(28)="Press ' z ' to zip to the next hint." hint$(29)="Press 'shift' and ' z ' to zip back one hint." hint$(30)="Left click on marker to toggle coordinate marker selection." hint$(31)="Press ' g ' to toggle ghost matrix on and off. This helps you see and avoid selecting markers behind hills." hint$(32)="Press ' o ' to toggle hints off and back on." hint$(33)="Press ' escape ' key anytime to exit MATRIX MASTER." hint$(34)="Hiding unnecessary markers increases program funtion and speed." hint$(35)="To hide more markers, select markers you want to keep in view and press ' h ' or hide twice." hint$(36)="Press ' i ' to apply an image to your matrix. This is nice to sculp terrain around your landscape drawings.Texture mode is disabled." hint$(37)="Your mouse functions are all the same as Elevation mode except raise elevation and wireframe." hint$(38)="Select tile markers and then click on the texture at the top right of the screen that you want to apply." hint$(39)="I had a hard time with the texture image for the matrix texture. If you can help,fix it and e-mail to:[email protected]." startover: set text size 16 set current bitmap 0 load=0:o=1 cls rgb(0,0,0):ink RGB(255,255,0),0 set cursor screen width()/2-24,0 print "MATRIX-MASTER Pro Matrix Editor v1.9" ink rgb(255,255,255),0 print redomatrix: input "Give your matrix a name and press enter>";matname$:sleep 200 if matname$="" then goto redomatrix redoinput: print "Is this matrix name ";:ink rgb(0,255,0),0:print matname$;:ink rgb(255,255,255),0:print " correct?(y/n)>" redoinkey: g$=inkey$() if g$<>"n" and g$<>"y" and g$<>"" then print "Please confirm your matrix name>":sleep 500:goto redoinput if g$="n" then goto redomatrix if g$="y" then goto redoxsize goto redoinkey print "Matrix name accepted":sleep 1000:cls rgb(0,0,0):ink RGB(255,255,0),0 set cursor screen width()/2-24,0 print "MATRIX-MASTER Pro Matrix Editor v1.9" ink rgb(255,255,255),0 print redoxsize: input "Input matrix size X and press enter>";matsizex if matsizex<10 or matsizex>100000 then print "Bad input-try again>":sleep 500:goto redoxsize matsizex=int(matsizex) redozsize: input "Input matrix size Z and press enter>";matsizez if matsizez<10 or matsizez>100000 then print "Bad input-try again>":sleep 500:goto redozsize matsizez=int(matsizez) redoxseg: input "Input matrix segment X and press enter>";matsegx if matsegx<2 or matsegx>250 then print "Bad input-try again>":sleep 500:goto redoxseg matsegx=int(matsegx) redozseg: input "Input matrix segment Z and press enter>";matsegz if matsegz<2 or matsegz>250 then print "Bad input-try again>":sleep 500:goto redozseg matsegz=int(matsegz) print "Matrix parameters accepted" print "Working..."; sleep 500 backdrop on dim height#((matsegx+1)*(matsegz+1)):dim heightold#((matsegx+1)*(matsegz+1)) dim xpos((matsegx+1)*(matsegz+1)):dim zpos((matsegz+1)*(matsegx+1)) dim tile((matsegx+1)*(matsegz+1)):for x=0 to ((matsegx+1)*(matsegz+1)):tile(x)=1:next x undo=0:wh=0:wl=0:wv=-1:wm=-1:wd=0:ms=0:wspeed=10:wc=0:numchng=0:numchng1=0 wd2=0 loaded: if matsizex>500 and matsizez>500 then size=6 else size=2 if matsizex>2000 and matsizez>2000 then size=10 if matsizex>5000 and matsizez>5000 then size=30 if matsizex>8000 and matsizez>8000 then size=40 if matsizex>9999 and matsizez>9999 then size=50 if matsizex>20000 and matsizez>20000 then size=75 if matsizex>50000 and matsizez>50000 then size=100 if matsizex>70000 and matsizez>70000 then size=200 dim objstat((matsegx+1)*(matsegz+1)) matsegx1=matsizex/matsegx:matsegz1=matsizez/matsegz banding=0:mx1=0:mx2=0:my1=0:my2=0:hide=-1:raiselower#=1 objnum=1 for z=0 to matsegz for x=0 to matsegx objstat(objnum)=-1 finalcount=objnum inc objnum next x next z if finalcount>2500 cls:backdrop off:ink rgb(0,255,0),0 print "!!WARNING!!" Print "Because of excessive markers, markers will be hidden. Navigate to the area you want" print "to work with, hit h to show all markers, then select markers in desired work area. Then hit" print "h again to hide unselected markers. Repeat this process when changing work areas." print "Doing this will speed up the editing process." print "Press any key to continue..." wait key print "Hang on, this could be a minute!!" sleep 500 backdrop on ink rgb(255,255,255),0 endif sync on autocam off make matrix 1,matsizex,matsizez,matsegx,matsegz position matrix 1,0,0,0 prepare matrix texture 1,1,2,5 update matrix 1 make object cube 70000,10:position object 70000,-10,0,-10:color object 70000,RGB(0,255,255) if load=1 for x=1 to finalcount read long 1,xpos(x) read long 1,zpos(x) read float 1,height#(x) read long 1,tile(x) next x close file 1 endif load=0 objnum=1 for z=0 to matsegz for x=0 to matsegx make object sphere objnum,size:color object objnum,rgb(0,255,0) position object objnum,x*matsegx1,height#(objnum),z*matsegz1 if finalcount>2500 hide object objnum endif set matrix height 1,x,z,height#(objnum) if x<matsegx and z<matsegz set matrix tile 1,x,z,tile(objnum) endif if load=1 then goto skipassign xpos(objnum)=x:zpos(objnum)=z skipassign: inc objnum next x next z if finalcount>2500 then hide=1 update matrix 1 set camera range 1,1000000 position camera 0,500,0 point camera 200,0,200 mousexold#=mousex():mouseyold#=mousey() gtx=0 wh=50:wd=1:wm=1 mainloop: do if inkey$()="i" backdrop off:sync off:cls redoimagename: print "Input image name to apply as matrix texture or type exit to abort.>";:input gtx$ if gtx$="exit" then sleep 200:backdrop on:sync on:goto aborttexture if file exist(gtx$)=0 print "File invalid. Make sure to include the file extension, e.g. .bmp. Try again or type exit.>":sleep 200 goto redoimagename endif load image gtx$,10 tile=1:gtx=1 prepare matrix texture 1,10,matsegx,matsegz for z=matsegz-1 to 0 step -1 for x=0 to matsegx-1 set matrix tile 1,x,z,tile inc tile next x next z update matrix 1 sync on:backdrop on sleep 200 endif aborttexture: dec hintdelay if hintdelay<0 then hintdelay=500+hintspeed:inc hint if hint>hints then hint=1 if inkey$()="v" then inc hintspeed,50 if inkey$()="V" then dec hintspeed,50 if hintspeed<-400 then hintspeed=-400 if inkey$()="z" inc hint if hint>hints then hint=1 hintdelay=1500 sleep 200 endif if inkey$()="Z" dec hint if hint<1 then hint=hints hintdelay=1500 sleep 200 endif if inkey$()<>"q" then htinc=0 if inkey$()="q" inc htinc if htinc>100 then htinc=100 if wv=1 inc wl,1+int(htinc/10) position matrix 2,0,wl,0 sleep 20 endif endif if inkey$()<>"a" then htdec=0 if inkey$()="a" inc htdec if htdec>100 then htdec=100 if wv=1 dec wl,1+int(htdec/10) position matrix 2,0,wl,0 sleep 20 endif endif if inkey$()="n" sync off:backdrop off:set matrix wireframe on 1 set cursor 0,0:cls rgb(0,0,0):ink RGB(255,255,255),0 print "Confirm! Do you want to start a new matrix?(y/n)" print "You may want to answer no and save this matrix first lest it be lost." sleep 500 getagain5: g$=inkey$() if g$<>"y" and g$<>"n" then goto getagain5 if g$="y" for x=1 to finalcount:delete object x:next x:delete object 70000 delete matrix 1 undim xpos(finalcount):undim zpos(finalcount) undim height(finalcount):undim objstat(finalcount) sleep 200 goto startover endif if g$="n" sync on:backdrop on endif sleep 500 set matrix wireframe off 1 endif if inkey$()="g" ghost=ghost*-1 if ghost=1 ghost matrix on 1 endif if ghost=-1 ghost matrix off 1 endif sleep 200 endif if inkey$()="G" ghost1=ghost1*-1 if ghost1=1 if matrix exist(2)=1 ghost matrix on 2 endif endif if ghost1=-1 if matrix exist(2)=1 ghost matrix off 2 endif endif sleep 200 endif if inkey$()="L" for x=1 to finalcount heightold#(x)=height#(x) next x:undo=1 for x=1 to finalcount if objstat(x)=1 height#(x)=0 set matrix height 1,xpos(x),zpos(x),height#(x) position object x,xpos(x)*matsegx1,height#(x),zpos(x)*matsegz1 endif next x update matrix 1 sleep 200 endif if inkey$()="l" sync off:backdrop off cls rgb(0,0,0):ink rgb(255,255,255),0 print "Are you sure you want to level your matrix back to zero?(y/n)" print "If you answer yes, you can press shift and ' 5 ' to undo level." sleep 200 getagain6: g$=inkey$() if g$<>"y" and g$<>"n" then goto getagain6 if g$="y" for x=1 to finalcount heightold#(x)=height#(x) next x:undo=1 for x=1 to finalcount height#(x)=0 set matrix height 1,xpos(x),zpos(x),height#(x) position object x,xpos(x)*matsegx1,height#(x),zpos(x)*matsegz1 objstat(x)=-1:color object x,rgb(0,255,0) next x update matrix 1 endif sync on:backdrop on endif if inkey$()="b" sync off:backdrop off:cls rgb(0,0,0) ink rgb(255,255,255),0:print "Please input value you want to set for maximum sea bottom depth(0=abort)?"; getbottom: input bot bot=int(bot):if bot=0 then sync on:backdrop on:goto donebot for x=1 to finalcount heightold#(x)=height#(x) next x:undo=1 if bot<0 then bot=bot*-1 for x=1 to finalcount if height#(x)<0-bot or height#(x)<wl height#(x)=((bot)*-1) set matrix height 1,xpos(x),zpos(x),height#(x) position object x,xpos(x)*matsegx1,height#(x),zpos(x)*matsegz1 endif next x update matrix 1 sync on:backdrop on endif donebot: rem watermatrix if inkey$()="6" wv=wv*-1 if wv=1 if matrix exist(2)=0 make matrix 2,matsizex,matsizez,matsegx,matsegz prepare matrix texture 2,2,1,1 position matrix 2,0,wl,0 if wh>0 if wd=1 flip=1 for z=0 to matsegz-1 step int(matsegz/10)+1 for x=0 to matsegx-1 if flip=1 set matrix height 2,x,z,int(matsegz/5)+1+wh endif if flip=-1 set matrix height 2,x,z,-int(matsegz/5)+1+wh endif next x flip=flip*-1 next z endif if wd=2 flip=1 for x=0 to matsegx-1 step int(matsegx/10)+1 for z=0 to matsegz-1 if flip=1 set matrix height 2,x,z,int(matsegz/5)+1+wh endif if flip=-1 set matrix height 2,x,z,-int(matsegz/5)+1+wh endif next z flip=flip*-1 next x endif for x=1 to matsegx-1 for z=1 to matsegz-1 a=get matrix height(2,x-1,z+1) b=get matrix height(2,x,z+1) c=get matrix height(2,x+1,z+1) d=get matrix height(2,x+1,z) e=get matrix height(2,x+1,z-1) f=get matrix height(2,x,z-1) g=get matrix height(2,x-1,z-1) h=get matrix height(2,x-1,z) total=a+b+c+d+e+f+g+h av#=total/8 set matrix height 2,x,z,av# next z next x for x=0 to matsegx set matrix height 2,x,0,get matrix height(2,x,1) next x for x=0 to matsegx set matrix height 2,x,tilez,get matrix height(2,x,matsegz-1) next x for z=0 to matsegz set matrix height 2,0,z,get matrix height(2,1,z) next z for z=0 to matsegz set matrix height 2,tilex,z,get matrix height(2,matsegx-1,z) next z endif update matrix 2 if ghost1=1 then ghost matrix on 2 endif endif if wv=-1 if matrix exist(2)=1 delete matrix 2 endif endif sleep 200 endif if inkey$()="d" if wd=1 then wd=2 else wd=1 dc=1 sleep 200 endif if inkey$()="D" if wd1=0 then wd1=1 else wd1=0 sleep 200 endif if inkey$()="m" wm=wm*-1 sleep 200 endif inc ms if ms>wspeed ms=0 if wm=1 if wv=1 if wd=1 if matrix exist(2)=1 if wd1=0 then shift matrix up 2 if wd1=1 then shift matrix down 2 update matrix 2 endif endif if wd=2 if matrix exist(2)=1 if wd1=0 then shift matrix right 2 if wd1=1 then shift matrix left 2 update matrix 2 endif endif endif endif endif if whc=1 and mousex()<screen width()-58 or dc=1 or wc=1 if whc=1 then whc=0 if dc=1 then dc=0 if wc=1 then wc=0 if matrix exist(2)=1 then delete matrix 2 make matrix 2,matsizex,matsizez,matsegx,matsegz prepare matrix texture 2,2,1,1 position matrix 2,0,wl,0 if wd=1 flip=1 for z=0 to matsegz-1 step int(matsegz/10)+1 for x=0 to matsegx-1 if flip=1 set matrix height 2,x,z,int(matsegz/5)+1+wh endif if flip=-1 set matrix height 2,x,z,-int(matsegz/5)+1+wh endif next x flip=flip*-1 next z endif if wd=2 flip=1 for x=0 to matsegx-1 step int(matsegx/10)+1 for z=0 to matsegz-1 if flip=1 set matrix height 2,x,z,int(matsegz/5)+1+wh endif if flip=-1 set matrix height 2,x,z,-int(matsegz/5)+1+wh endif next z flip=flip*-1 next x endif rem smooth water for x=1 to matsegx-1 for z=1 to matsegz-1 a=get matrix height(2,x-1,z+1) b=get matrix height(2,x,z+1) c=get matrix height(2,x+1,z+1) d=get matrix height(2,x+1,z) e=get matrix height(2,x+1,z-1) f=get matrix height(2,x,z-1) g=get matrix height(2,x-1,z-1) h=get matrix height(2,x-1,z) total=a+b+c+d+e+f+g+h av#=total/8 set matrix height 2,x,z,av# next z next x for x=0 to matsegx set matrix height 2,x,0,get matrix height(2,x,1) next x for x=0 to matsegx set matrix height 2,x,tilez,get matrix height(2,x,matsegz-1) next x for z=0 to matsegz set matrix height 2,0,z,get matrix height(2,1,z) next z for z=0 to matsegz set matrix height 2,tilex,z,get matrix height(2,matsegx-1,z) next z update matrix 2 if ghost1=1 then ghost matrix on 2 endif if inkey$()="1" then goto savematrix if inkey$()="2" then goto loadmatrix if gtx=1 then goto skiptexturemode if inkey$()="3" then gosub texture skiptexturemode: base=get ground height(1,0,0):position object 70000,-10,base,-10 mousexnew#=mousexold#-mousex():mouseynew#=mouseyold#-mousey() if upkey()=1 or mouseclick()=2 and mouseynew#>0 pitch camera down 2 endif if downkey()=1 or mouseclick()=2 and mouseynew#<0 pitch camera up 2 endif if leftkey()=1 or mouseclick()=2 and mousexnew#>0 turn camera left 2 endif if rightkey()=1 or mouseclick()=2 and mousexnew#<0 turn camera right 2 endif if mousezold<mousez() or inkey$()="+" move camera 10*size ghty=get ground height(1,camera position x(),camera position z()) ghty1=camera position y()-ghty if ghty1<10 then move camera -10*size endif if mousezold>mousez() or inkey$()="-" move camera -10*size ghty=get ground height(1,camera position x(),camera position z()) ghty1=camera position y()-ghty if ghty1<10 then move camera 10*size endif if banding=1 then goto skiptilt if mouseclick()=3 and mousexnew#>0 roll camera left 2 endif if mouseclick()=3 and mousexnew#<0 roll camera right 2 endif skiptilt: if banding=1 then goto skipfirst if mouseclick()=1 mx1=mousex():my1=mousey():banding=1 endif skipfirst: if banding=1 then mx2=mousex():my2=mousey() if mx1>mx2 and my1<my2 or mx1<mx2 and my1>my2 then banding=0 if mousex()>screen width()-58 and mousex()<screen width()-42 and mousey()<250 then banding=0 if banding=1 and mouseclick()=0 if mx1<mx2 for x=1 to finalcount if object visible(x)=1 ox=object screen x(x):oy=object screen y(x) if ox>mx1 and ox<mx2 and oy>my1 and oy<my2 objstat(x)=1:color object x,rgb(255,0,0) endif endif next x endif if mx1>mx2 for x=1 to finalcount if object visible(x)=1 ox=object screen x(x):oy=object screen y(x) if ox<mx1 and ox>mx2 and oy<my1 and oy>my2 objstat(x)=objstat(x)*-1 if objstat(x)=1 then color object x,rgb(255,0,0) if objstat(x)=-1 then color object x,rgb(0,255,0) endif endif next x endif banding=0 endif if banding=1 and mx1<>mx2 or my1<>my2 then goto skipselect if mousex()>screen width()-58 and mousex()<screen width()-42 and mousey()<250 then goto skipselect if mousexnew#=0 and mouseynew#=0 if mouseclick()=1 and mx1=mx2 and banding=1 and mx1=mx2 and my1=my2 for x=1 to finalcount if object visible(x)=1 if object in screen(x)=1 sx=object screen x(x):sy=object screen y(x) if mousex()>sx-5 and mousex()<sx+5 and mousey()>sy-5 and mousey()<sy+5 objstat(x)=objstat(x)*-1 if objstat(x)=1 then color object x,rgb(255,0,0) if objstat(x)=-1 then color object x,rgb(0,255,0) sleep 200 x=finalcount:banding=0 endif endif endif next x sleep 200 endif endif skipselect: if banding=1 then goto skipnumchng if mouseclick()=0 then numchng=0:numchng1=0 if mouseclick()=1 if mousex()>screen width()-58 and mousex()<screen width()-42 inc numchng if numchng>100 then numchg=100 oset=int(numchng/10) if numchng=100 then inc numchng1 if numchng1>20 then numchng1=20 if numchng1=20 then oset=oset*10 if mousey()>29 and mousey()<44 inc raiselower#,1+oset sleep 20 endif if mousey()>70 and mousey()<85 dec raiselower#,1+oset if raiselower#<1 then raiselower#=1 sleep 20 endif if mousey()>100 and mousey()<120 dec wspeed,1+oset if wspeed<0 then wspeed=0 endif if mousey()>135 and mousey()<155 inc wspeed,1+oset endif if mousey()>180 and mousey()<205 inc wh,1+oset whc=1 endif if mousey()>215 and mousey()<235 dec wh,1+oset if wh<0 then wh=0 whc=1 endif sleep 50 endif endif skipnumchng: if mouseclick()=4 and mouseynew#>0 or inkey$()="." for x=1 to finalcount if objstat(x)=1 gh#=get matrix height(1,xpos(x),zpos(x)) inc height#(x),raiselower# set matrix height 1,xpos(x),zpos(x),height#(x) position object x,xpos(x)*matsegx1,height#(x),zpos(x)*matsegz1 endif next x update matrix 1 endif if mouseclick()=4 and mouseynew#<0 or inkey$()="," for x=1 to finalcount if objstat(x)=1 dec height#(x),raiselower# set matrix height 1,xpos(x),zpos(x),height#(x) position object x,xpos(x)*matsegx1,height#(x),zpos(x)*matsegz1 endif next x update matrix 1 endif if inkey$()="u" for x=1 to finalcount if objstat(x)=1 objstat(x)=-1 color object x,rgb(0,255,0) endif next x endif if inkey$()="s" for x=1 to finalcount if object visible(x)=1 then objstat(x)=1:color object x,rgb(255,0,0) next x endif if inkey$()="t" for x=1 to finalcount if object visible(x)=1 objstat(x)=objstat(x)*-1 if objstat(x)=1 then color object x,rgb(255,0,0) if objstat(x)=-1 then color object x,rgb(0,255,0) endif next x sleep 200 endif if inkey$()="h" hide=hide*-1 if hide=1 for x=1 to finalcount if objstat(x)=-1 hide object x endif next x endif if hide=-1 for x=1 to finalcount if objstat(x)=-1 if object visible(x)=0 then show object x endif next x endif sleep 200 endif if inkey$()="o" then o=o*-1:sleep 200 if inkey$()="%" if undo=1 for x=1 to finalcount height#(x)=heightold#(x) set matrix height 1,xpos(x),zpos(x),height#(x) position object x,xpos(x)*matsegx1,height#(x),zpos(x)*matsegz1 next x update matrix 1 undo=0 sleep 200 endif endif Rem Smooth matrix if inkey$()="5" for x=1 to finalcount heightold#(x)=height#(x) next x undo=1 for x=1 to matsegx-1 for z=1 to matsegz-1 a=get matrix height(1,x-1,z+1) b=get matrix height(1,x,z+1) c=get matrix height(1,x+1,z+1) d=get matrix height(1,x+1,z) e=get matrix height(1,x+1,z-1) f=get matrix height(1,x,z-1) g=get matrix height(1,x-1,z-1) h=get matrix height(1,x-1,z) total=a+b+c+d+e+f+g+h av#=total/8 set matrix height 1,x,z,av# next z next x for x=0 to matsegx set matrix height 1,x,0,get matrix height(1,x,1) next x for x=0 to matsegx set matrix height 1,x,tilez,get matrix height(1,x,matsegz-1) next x for z=0 to matsegz set matrix height 1,0,z,get matrix height(1,1,z) next z for z=0 to matsegz set matrix height 1,tilex,z,get matrix height(1,matsegx-1,z) next z update matrix 1 for x=1 to finalcount height#(x)=get matrix height(1,xpos(x),zpos(x)) position object x,xpos(x)*matsegx1,height#(x),zpos(x)*matsegz1 next x sleep 500 endif mousexold#=mousex():mouseyold#=mousey():mousezold=mousez() if inkey$()="w" if matrix wireframe state(1)=1 then set matrix wireframe off 1 else set matrix wireframe on 1 sleep 200 endif ink RGB(0,255,255),0 set cursor 0,0:Print "Matrix properties" set cursor screen width()/2-124,0 print "MATRIX MASTER Pro v1.9 - by Richard Sardini" ink RGB(0,128,255),0 print "X-size->";matsizex;"->Z-size->";matsizez print "X-segment->";matsegx;"->Z-segment->";matsegz print "Water level->";wl set cursor screen width()/2-80,40 print "You are editing matix> ";:ink rgb(255,255,0),0:print matname$:ink rgb(255,255,255),0 set cursor screen width()/2-80,80:print "You are in Elevation mode.":ink rgb(255,255,255),0 print "Mousex->";mousex();" Mousey->";mousey() xl=screen width()/2:yl=screen height()/2 ink RGB(192,192,192),0 line xl,200,xl,screen height()-200 line 250,yl,screen width()-250,yl ink rgb(255,255,255),0 if banding=1 if mx1<mx2 then ink RGB(255,0,128),0 else ink RGB(255,255,0),0 line mx1,my1,mx2,my1:line mx1,my2,mx1,my1 line mx2,my1,mx2,my2:line mx1,my2,mx2,my2 ink rgb(255,255,255),0 endif cnt1=0 print "First 16 markers selected/height" for x=1 to finalcount if objstat(x)=1 print "X->";xpos(x);" Z->";zpos(x);" Height->";height#(x) inc cnt1 if cnt1>15 then x=finalcount endif next x if o=-1 then goto skiphints inc hintc1,8:if hintc1>255 then hintc1=100 hintcolor=rgb(0,hintc1,0) ink hintcolor,0 text 0,screen height()-75,hint$(hint) skiphints: set cursor screen width()/5,screen height()-50 ink rgb(255,255,255),0 print "Press: 1-Save, 2-Load, 3-Enter texture mode, Z-Zip to next hint, Shift Z-Zip back one hint." set cursor screen width()/5,screen height()-25 print "Press: 5-Smooth matrix one time, Shif 5-undo last smoothing, 6-Toggle water on and back off" set cursor screen width()-160,50 print "Elevation change->";raiselower# ink rgb(255,0,0),0 line screen width()-54,44,screen width()-46,44 line screen width()-54,44,screen width()-50,34 line screen width()-46,44,screen width()-50,34 line screen width()-54,70,screen width()-46,70 line screen width()-54,70,screen width()-50,80 line screen width()-46,70,screen width()-50,80 ink rgb(255,255,255),0 if wv=1 set cursor screen width()-140,120 print "Wave speed->";wspeed set cursor screen width()-150,200 print "Wave height->";wh ink rgb(255,0,0),0 line screen width()-54,114,screen width()-46,114 line screen width()-54,114,screen width()-50,104 line screen width()-46,114,screen width()-50,104 line screen width()-54,140,screen width()-46,140 line screen width()-54,140,screen width()-50,150 line screen width()-46,140,screen width()-50,150 line screen width()-54,194,screen width()-46,194 line screen width()-54,194,screen width()-50,184 line screen width()-46,194,screen width()-50,184 line screen width()-54,220,screen width()-46,220 line screen width()-54,220,screen width()-50,230 line screen width()-46,220,screen width()-50,230 endif ink RGB(236,237,173),0 line mousex()-9,mousey()-9,mousex()+10,mousey()+10 line mousex()-9,mousey()+9,mousex()+10,mousey()-10 ink rgb(255,255,255),0 sync loop savematrix: backdrop off sync off:cls rgb(0,0,0) ink rgb(255,255,255),0 savematrix1: if file exist(matname$)=1 sleep 500 print "File already exist - Would you like to overwrite this file or rename your matrix?" print "Press 2 to overwrite or 3 to rename this matrix" getagain: g$=inkey$() if g$<>"2" and g$<>"3" then sleep 200:goto getagain if g$="3" sleep 200 print "What is the new file name?";:input matname$ sleep 200 goto savematrix1 endif if g$="2" then delete file matname$:sleep 200 endif open to write 1,matname$ write long 1,matsizex:write long 1,matsizez:write long 1,matsegx:write long 1,matsegz write long 1,finalcount for x=1 to finalcount write long 1,xpos(x) write long 1,zpos(x) write float 1,height#(x) write long 1,tile(x) next x close file 1 print "File saved as:";:ink rgb(0,255,0),0:print matname$;:ink rgb(255,255,255),0:print ", Press any key to return to editor" sleep 500 wait key sleep 200 sync on backdrop on goto mainloop loadmatrix: if matrix exist(2)=1 then delete matrix 2 backdrop off sync off:cls rgb(0,0,0) ink rgb(255,255,255),0 print "Current matrix will be lost. Proceed(Y/N)?" getinput: g$=inkey$() if g$="n" or g$="N" then sync on:backdrop on:goto mainloop if g$<>"y" then goto getinput delete matrix 1 for x=1 to finalcount delete object x next x delete object 70000 undim xpos(finalcount):undim zpos(finalcount) undim height#(finalcount):undim objstat(finalcount) undim tile(finalcount):undim heightold#(finalcount) redomatrixname: input "File name to load?";matname$ print "If nothing happens, press enter again." if matname$="exit" then goto startover if file exist(matname$)=0 print "File does not exist: Try again or type exit" sleep 500 goto redomatrixname endif if file exist(matname$)=1 open to read 1,matname$ read long 1,matsizex:read long 1,matsizez read long 1,matsegx:read long 1,matsegz read long 1,finalcount dim height#(finalcount):dim xpos(finalcount):dim zpos(finalcount) dim tile(finalcount):dim heightold#(finalcount) load=1 endif sync on backdrop on goto loaded texture: objnum=1:wc=0 if matrix wireframe state(1)=1 then set matrix wireframe off 1 for z=0 to matsegz for x=0 to matsegx if object visible(objnum)=0 then show object objnum color object objnum,rgb(0,255,0):objstat(objnum)=-1 if xpos(objnum)=matsegx or zpos(objnum)=matsegz then hide object objnum height1=int(get ground height(1,(x*matsegx1)+(matsegx1/2),(z*matsegz1)+(matsegz1/2))) position object objnum,(x*matsegx1)+(matsegx1/2),height1,(z*matsegz1)+(matsegz1/2) inc objnum next x next z for x=1 to finalcount if xpos(x)=matsegx or zpos(x)=matsegz then hide object x next x rval=0 if matrix exist(2)=1 then delete matrix 2:rval=1 hint=36:hintdelay=1000 tile=1 do dec hintdelay if hintdelay<0 then hintdelay=500+hintspeed:inc hint if hint>39 then hint=16 if inkey$()="z" inc hint if hint>39 then hint=16 hintdelay=1500 sleep 200 endif if inkey$()="Z" dec hint if hint<16 then hint=39 hintdelay=1500 sleep 200 endif if inkey$()="v" then inc hintspeed,50 if inkey$()="V" then dec hintspeed,50 if hintspeed<-400 then hintspeed=-400 if mouseclick()=1 and banding=0 if mousex()>699 and mousey()<250 if mousex()<732 and mousey()<30 then tile=1 if mousex()>732 and mousey()<30 then tile=2 if mousex()<732 and mousey()>30 and mousey()<64 then tile=3 if mousex()>732 and mousey()>30 and mousey()<64 then tile=4 if mousex()<732 and mousey()>64 and mousey()<96 then tile=5 if mousex()>732 and mousey()>64 and mousey()<96 then tile=6 if mousex()<732 and mousey()>96 and mousey()<128 then tile=7 if mousex()>732 and mousey()>96 and mousey()<128 then tile=8 if mousex()<732 and mousey()>128 and mousey()<160 then tile=9 if mousex()>732 and mousey()>128 and mousey()<160 then tile=10 for x=1 to finalcount if objstat(x)=1 set matrix tile 1,xpos(x),zpos(x),tile tile(x)=tile endif next x update matrix 1 endif endif if inkey$()="4" for x=1 to finalcount position object x,xpos(x)*matsegx1,height#(x),zpos(x)*matsegz1 objstat(x)=-1:color object x,rgb(0,255,0) if object visible(x)=0 then show object x next x hint=1 if rval=1 wc=1 endif return endif base=get ground height(1,0,0):position object 70000,-10,base,-10 mousexnew#=mousexold#-mousex():mouseynew#=mouseyold#-mousey() if upkey()=1 or mouseclick()=2 and mouseynew#>0 pitch camera down 2 endif if downkey()=1 or mouseclick()=2 and mouseynew#<0 pitch camera up 2 endif if leftkey()=1 or mouseclick()=2 and mousexnew#>0 turn camera left 2 endif if rightkey()=1 or mouseclick()=2 and mousexnew#<0 turn camera right 2 endif if mousezold<mousez() or inkey$()="+" move camera 20*size ghty=get ground height(1,camera position x(0),camera position z(0)) ghty1=camera position y()-ghty if ghty1<50 then move camera -20*size endif if mousezold>mousez() or inkey$()="-" move camera -20*size ghty=get ground height(1,camera position x(0),camera position z(0)) ghty1=camera position y()-ghty if ghty1<50 then move camera 20*size endif if banding=1 then goto skiptilt2 if mouseclick()=3 and mousexnew#>0 roll camera left 2 endif if mouseclick()=3 and mousexnew#<0 roll camera right 2 endif skiptilt2: if banding=1 then goto skipfirst2 if mouseclick()=1 mx1=mousex():my1=mousey():banding=1 endif skipfirst2: if banding=1 then mx2=mousex():my2=mousey() if mx1>mx2 and my1<my2 or mx1<mx2 and my1>my2 then banding=0 if banding=1 and mouseclick()=0 if mx1<mx2 for x=1 to finalcount if object visible(x)=1 ox=object screen x(x):oy=object screen y(x) if ox>mx1 and ox<mx2 and oy>my1 and oy<my2 objstat(x)=1:color object x,rgb(255,0,0) endif endif next x endif if mx1>mx2 for x=1 to finalcount if object visible(x)=1 ox=object screen x(x):oy=object screen y(x) if ox<mx1 and ox>mx2 and oy<my1 and oy>my2 objstat(x)=objstat(x)*-1 if objstat(x)=1 then color object x,rgb(255,0,0) if objstat(x)=-1 then color object x,rgb(0,255,0) endif endif next x endif banding=0 endif if banding=1 and mx1<>mx2 and my1<>my2 then goto skipselect22 if mousexnew#=0 and mouseynew#=0 if mouseclick()=1 and mx1=mx2 and banding=1 and mx1=mx2 and my1=my2 for x=1 to finalcount if object visible(x)=1 if object in screen(x)=1 sx=object screen x(x):sy=object screen y(x) if mousex()>sx-5 and mousex()<sx+5 and mousey()>sy-5 and mousey()<sy+5 objstat(x)=objstat(x)*-1 if objstat(x)=1 then color object x,rgb(255,0,0) if objstat(x)=-1 then color object x,rgb(0,255,0) sleep 200 x=finalcount:banding=0 endif endif endif next x sleep 200 endif endif skipselect22: if inkey$()="u" for x=1 to finalcount if object visible(x)=1 if objstat(x)=1 objstat(x)=-1 color object x,rgb(0,255,0) endif endif next x endif if inkey$()="g" ghost=ghost*-1 if ghost=1 ghost matrix on 1 endif if ghost=-1 ghost matrix off 1 endif sleep 200 endif if inkey$()="s" for x=1 to finalcount if object visible(x)=1 then objstat(x)=1:color object x,rgb(255,0,0) next x endif if inkey$()="t" for x=1 to finalcount if object visible(x)=1 objstat(x)=objstat(x)*-1 if objstat(x)=1 then color object x,rgb(255,0,0) if objstat(x)=-1 then color object x,rgb(0,255,0) endif next x sleep 200 endif if inkey$()="h" hide=hide*-1 if hide=1 for x=1 to finalcount if objstat(x)=-1 and xpos(x)<matsegx and zpos(x)<matsegz hide object x endif next x endif if hide=-1 for x=1 to finalcount if objstat(x)=-1 and xpos(x)<matsegx and zpos(x)<matsegz if object visible(x)=0 then show object x endif next x endif sleep 200 endif if inkey$()="o" then o=o*-1:sleep 200 mousexold#=mousex():mouseyold#=mousey():mousezold=mousez() ink RGB(0,255,255),0 set cursor screen width()/2-120,0 print "MATRIX MASTER v1.9 - by Richard Sardini" ink RGB(0,128,255),0 print "X-size=";matsizex;"->Z-size=";matsizez print "X-segment=";matsegx;"->Z-segment=";matsegz set cursor screen width()/2-80,40 print "You are editing matix> ";:ink rgb(255,255,0),0:print matname$ set cursor screen width()/2-80,80:print "You are in Texture mode.":ink rgb(255,255,255),0 print "Mousex->";mousex();" Mousey->";mousey() xl=screen width()/2:yl=screen height()/2 ink RGB(192,192,192),0 line xl,200,xl,screen height()-200 line 250,yl,screen width()-250,yl ink rgb(255,255,255),0 if banding=1 if mx1<mx2 then ink RGB(255,0,128),0 else ink RGB(255,255,0),0 line mx1,my1,mx2,my1:line mx1,my2,mx1,my1 line mx2,my1,mx2,my2:line mx1,my2,mx2,my2 ink rgb(255,255,255),0 endif cnt1=0 print "First 16 markers selected/tile" for x=1 to finalcount if objstat(x)=1 print "X->";xpos(x);" Z->";zpos(x);" Tile->";tile(x) inc cnt1 if cnt1>15 then x=finalcount endif next x if o=-1 then goto skiphints1 inc hintc1,8:if hintc1>255 then hintc1=100 hintcolor=rgb(0,hintc1,0) ink hintcolor,0 text 0,screen height()-75,hint$(hint) skiphints1: set cursor screen width()/5,screen height()-50 ink RGB(236,237,173),0 line mousex()-9,mousey()-9,mousex()+10,mousey()+10 line mousex()-9,mousey()+9,mousex()+10,mousey()-10 ink rgb(255,255,255),0 print "Press: 4-Exit texture mode, Z-Zip to next hint, Shift Z-Zip back one hint." paste image 1,700,0 sync loop remstart This is the code snippet you will need to re-load your matrix into your DB programs open to read 1,<filenamehere> read long 1,matsizex:read long 1,matsizez read long 1,matsegx:read long 1,matsegz read long 1,finalcount dim height#(finalcount):dim xpos(finalcount):dim zpos(finalcount):dim tile(finalcount) for x=1 to finalcount read long 1,xpos(x) read long 1,zpos(x) read float 1,height#(x) read long 1,tile(x) next x close file 1 make matrix 1,matsizex,matsizez,matsegx,matsegz rem insert matrix texure here if tiling, otherwise delete marked line for x=1 to finalcount set matrix height 1,xpos(x),zpos(x),height#(x) if xpos(x)<matsegx and zpos(x)<matsegz `delete this line if not using texture set matrix tile 1,xpos(x),zpos(x),tile(x) `delete this line if not using texture endif `delete this line if not using texture next x update matrix 1 endrem
Full Description
` This code was downloaded from The Game Creators<br /> ` It is reproduced here with full permission<br /> ` http://www.thegamecreators.com<br /> <br /> Rem Project: MATRIX MASTER PRO<br /> Rem Created: 5/17/04 4:36:23 PM<br /> <br /> Rem ***** Main Source File *****<br /> rem this program written by Richard Sardini Jr<br /> rem my e-mail:[email protected]<br /> rem my phone:814-504-6033<br /> rem check end of program for code snippet to load matrix into your dark basic programs<br /> <br /> set display mode 800,600,16<br /> create bitmap 1,65,161<br /> rem texture 1 (green)<br /> ink RGB(128,128,0),0:for x=0 to 31:line x,0,x,32:next x<br /> ink RGB(0,128,0),0:for x=0 to 200:dot rnd(32)-1,rnd(32)-1:next x<br /> ink RGB(255,128,0),0:for x=0 to 50:dot rnd(32)-1,rnd(32)-1:next x<br /> ink RGB(128,128,255),0:for x=0 to 90:dot rnd(32)-1,rnd(32)-1:next x<br /> ink RGB(255,255,255),0:for x=0 to 20:dot rnd(32)-1,rnd(32)-1:next x<br /> rem texture 2 (medium grey)<br /> ink RGB(128,128,128),0:for x=31 to 64:line x,0,x,32:next x<br /> ink RGB(192,192,192),0:for x=0 to 200:dot rnd(32)+33,rnd(32)-1:next x<br /> ink RGB(60,81,66),0:for x=0 to 50:dot rnd(32)+33,rnd(32)-1:next x<br /> ink RGB(48,74,167),0:for x=0 to 90:dot rnd(32)+33,rnd(32)-1:next x<br /> ink RGB(255,255,255),0:for x=0 to 20:dot rnd(32)+33,rnd(32)-1:next x<br /> rem texture 3 (dark grey)<br /> ink RGB(82,82,82),0:for x=0 to 31:line x,32,x,65:next x<br /> ink RGB(0,0,0),0:for x=0 to 200:dot rnd(32)-1,rnd(32)+33:next x<br /> ink RGB(128,128,128),0:for x=0 to 50:dot rnd(32)-1,rnd(32)+33:next x<br /> ink RGB(57,36,159),0:for x=0 to 90:dot rnd(32)-1,rnd(32)+33:next x<br /> ink RGB(192,192,192),0:for x=0 to 20:dot rnd(32)-1,rnd(32)+33:next x<br /> rem texture 4 (light brown)<br /> ink RGB(194,160,114),0:for x=32 to 64:line x,32,x,65:next x<br /> ink RGB(255,209,164),0:for x=0 to 200:dot rnd(32)+33,rnd(32)+33:next x<br /> ink RGB(190,126,126),0:for x=0 to 50:dot rnd(32)+33,rnd(32)+33:next x<br /> ink RGB(255,230,204),0:for x=0 to 90:dot rnd(32)+33,rnd(32)+33:next x<br /> ink RGB(128,64,64),0:for x=0 to 20:dot rnd(32)+33,rnd(32)+33:next x<br /> rem texture 5 (medium brown)<br /> ink RGB(217,108,0),0:for x=0 to 31:line x,65,x,97:next x<br /> ink RGB(128,64,64),0:for x=0 to 200:dot rnd(32)-1,rnd(32)+65:next x<br /> ink RGB(185,92,0),0:for x=0 to 50:dot rnd(32)-1,rnd(32)+65:next x<br /> ink RGB(210,105,0),0:for x=0 to 90:dot rnd(32)-1,rnd(32)+65:next x<br /> ink RGB(255,197,138),0:for x=0 to 20:dot rnd(32)-1,rnd(32)+65:next x<br /> rem texture 6 (Black)<br /> ink RGB(0,0,0),0:for x=32 to 64:line x,65,x,98:next x<br /> rem texture 7 (Blue 1)<br /> ink RGB(0,0,255),0:for x=0 to 31:line x,97,x,130:next x<br /> ink RGB(0,128,255),0:for x=0 to 200:dot rnd(31)-1,rnd(32)+95:next x<br /> ink RGB(0,128,192),0:for x=0 to 50:dot rnd(31)-1,rnd(32)+95:next x<br /> ink RGB(255,255,255),0:for x=0 to 90:dot rnd(31)-1,rnd(32)+95:next x<br /> ink RGB(128,0,255),0:for x=0 to 20:dot rnd(31)-1,rnd(32)+95:next x<br /> rem texture 8 (Lt. Blue)<br /> ink RGB(0,255,255),0:for x=31 to 64:line x,96,x,130:next x<br /> ink RGB(128,255,255),0:for x=0 to 200:dot rnd(32)+33,rnd(31)+96:next x<br /> ink RGB(0,230,230),0:for x=0 to 50:dot rnd(32)+33,rnd(31)+96:next x<br /> ink RGB(151,255,255),0:for x=0 to 90:dot rnd(32)+33,rnd(31)+96:next x<br /> ink RGB(0,206,206),0:for x=0 to 20:dot rnd(32)+33,rnd(31)+96:next x<br /> rem texture 9 (White)<br /> ink rgb(255,255,255),0:for x=0 to 34:line x,127,x,161:next x<br /> ink RGB(218,218,218),0:for x=0 to 200:dot rnd(33)-1,rnd(31)+126:next x<br /> rem texture 10 (orange)<br /> ink RGB(255,128,0),0:for x=33 to 64:line x,128,x,161:next x<br /> ink RGB(255,128,64),0:for x=0 to 200:dot rnd(32)+33,rnd(31)+129:next x<br /> <br /> <br /> rem get matrix texture<br /> blur bitmap 1,3<br /> get image 1,1,1,64,160<br /> delete bitmap 1<br /> create bitmap 1,50,50<br /> ink RGB(0,0,255),0:for x=0 to 50:line x,0,x,50:next x<br /> ink rgb(0,255,255),0:for x=0 to 200:dot rnd(50),rnd(50):next x<br /> ink RGB(128,255,255),0:for x=0 to 70:dot rnd(50),rnd(50):next x<br /> ink RGB(255,255,255),0:for x=0 to 75:dot rnd(50),25+rnd(10):next x<br /> blur bitmap 1,3<br /> get image 2,0,0,50,50<br /> delete bitmap 1<br /> hint=1:hints=36:hintdelay=750:hintspeed=0<br /> dim hint$(40):hintc1=50:ghost=-1:ghost1=-1<br /> hint$(1)="Press ' w ' to toggle wireframe on and off."<br /> hint$(2)="Press and hold mouse wheel button 3 and move mouse up and down to lower or raise selected markers respectively."<br /> hint$(3)="Or use keyboard less than ' < ' or greater than ' > ' to lower or raise selected markers respectively."<br /> hint$(4)="Press ' L ' to level the matrix back to zero."<br /> hint$(5)="Press Shift and 'L' to level select markers."<br /> hint$(6)="Press ' b ' to set maximum bottom sea depth. Use this to raise sea floor after smoothing lowers it too deep. Shift 5 to undo."<br /> hint$(7)="Press ' m ' to toggle wave flow off and back on."<br /> hint$(8)="Shift ' G ' to toggle ghost water on."<br /> hint$(9)="Press ' d ' to change the direction the waves are facing."<br /> hint$(10)="Press Shift and ' D ' to change the direction the waves are flowing."<br /> hint$(11)="Press ' n ' anytime in elevation mode to start a new matrix."<br /> hint$(12)="Press ' 5 ' to smooth matrix 1 time. Can be undone only 1 time. Thanks to ReD_eYe(and inspired by David89)."<br /> hint$(13)="Press Shift and ' 5 ' to undo smooth matrix once. Do this to save final smoothing for when your whole matrix is done."<br /> hint$(14)="Click on up and down arrows at the top right of the screen to set elevation change rate or wave settings."<br /> hint$(15)="Press ' q ' to raise the water level or ' a ' to lower the water level."<br /> <br /> hint$(16)="Press ' s ' to select all visible coordinate markers and ' u ' to un-select all visible markers."<br /> hint$(17)="Press ' v ' to slow down hints and shift + ' v ' to speed up hints."<br /> hint$(18)="Press ' t ' to toggle or invert all visible coordinate markers."<br /> hint$(19)="Press arrow keys to pan your view or press and hold mouse botton 2 and move mouse."<br /> hint$(20)="Press and hold both mouse buttons 1 and 2 and move mouse to rotate camera view."<br /> hint$(21)="Left click and drag mouse-(top left to bottom right)-and red box will appear to select markers in box."<br /> hint$(22)="Left click and drag mouse-(bottom right to top left)-and yellow box will appear to toggle or invert selected markers in box."<br /> hint$(23)="Press ' h ' to hide all unselected markers-this is handy to isolate work areas."<br /> hint$(24)="Press ' h ' again to show all hidden markers. Use this feature to hide and prevent selecting backround markers."<br /> hint$(25)="Green marker=unselected coordinate - Red marker=selected coordinate."<br /> hint$(26)="Press ' + ' or ' - ' to zoom in and out or turn the mouse wheel."<br /> <br /> <br /> hint$(27)="Set the cross hairs on your destination point and then zoom in."<br /> hint$(28)="Press ' z ' to zip to the next hint."<br /> hint$(29)="Press 'shift' and ' z ' to zip back one hint."<br /> hint$(30)="Left click on marker to toggle coordinate marker selection."<br /> hint$(31)="Press ' g ' to toggle ghost matrix on and off. This helps you see and avoid selecting markers behind hills."<br /> hint$(32)="Press ' o ' to toggle hints off and back on."<br /> hint$(33)="Press ' escape ' key anytime to exit MATRIX MASTER."<br /> hint$(34)="Hiding unnecessary markers increases program funtion and speed."<br /> hint$(35)="To hide more markers, select markers you want to keep in view and press ' h ' or hide twice."<br /> <br /> hint$(36)="Press ' i ' to apply an image to your matrix. This is nice to sculp terrain around your landscape drawings.Texture mode is disabled."<br /> hint$(37)="Your mouse functions are all the same as Elevation mode except raise elevation and wireframe."<br /> hint$(38)="Select tile markers and then click on the texture at the top right of the screen that you want to apply."<br /> hint$(39)="I had a hard time with the texture image for the matrix texture. If you can help,fix it and e-mail to:[email protected]."<br /> startover:<br /> set text size 16<br /> set current bitmap 0<br /> load=0:o=1<br /> cls rgb(0,0,0):ink RGB(255,255,0),0<br /> set cursor screen width()/2-24,0<br /> print "MATRIX-MASTER Pro Matrix Editor v1.9"<br /> ink rgb(255,255,255),0<br /> <br /> print<br /> redomatrix:<br /> input "Give your matrix a name and press enter>";matname$:sleep 200<br /> if matname$="" then goto redomatrix<br /> redoinput:<br /> print "Is this matrix name ";:ink rgb(0,255,0),0:print matname$;:ink rgb(255,255,255),0:print " correct?(y/n)>"<br /> redoinkey:<br /> g$=inkey$()<br /> if g$<>"n" and g$<>"y" and g$<>"" then print "Please confirm your matrix name>":sleep 500:goto redoinput<br /> if g$="n" then goto redomatrix<br /> if g$="y" then goto redoxsize<br /> goto redoinkey<br /> <br /> print "Matrix name accepted":sleep 1000:cls rgb(0,0,0):ink RGB(255,255,0),0<br /> set cursor screen width()/2-24,0<br /> print "MATRIX-MASTER Pro Matrix Editor v1.9"<br /> ink rgb(255,255,255),0<br /> print<br /> redoxsize:<br /> input "Input matrix size X and press enter>";matsizex<br /> <br /> if matsizex<10 or matsizex>100000 then print "Bad input-try again>":sleep 500:goto redoxsize<br /> matsizex=int(matsizex)<br /> redozsize:<br /> input "Input matrix size Z and press enter>";matsizez<br /> if matsizez<10 or matsizez>100000 then print "Bad input-try again>":sleep 500:goto redozsize<br /> matsizez=int(matsizez)<br /> <br /> redoxseg:<br /> input "Input matrix segment X and press enter>";matsegx<br /> if matsegx<2 or matsegx>250 then print "Bad input-try again>":sleep 500:goto redoxseg<br /> matsegx=int(matsegx)<br /> redozseg:<br /> input "Input matrix segment Z and press enter>";matsegz<br /> if matsegz<2 or matsegz>250 then print "Bad input-try again>":sleep 500:goto redozseg<br /> matsegz=int(matsegz)<br /> <br /> print "Matrix parameters accepted"<br /> <br /> print "Working...";<br /> sleep 500<br /> backdrop on<br /> dim height#((matsegx+1)*(matsegz+1)):dim heightold#((matsegx+1)*(matsegz+1))<br /> dim xpos((matsegx+1)*(matsegz+1)):dim zpos((matsegz+1)*(matsegx+1))<br /> dim tile((matsegx+1)*(matsegz+1)):for x=0 to ((matsegx+1)*(matsegz+1)):tile(x)=1:next x<br /> undo=0:wh=0:wl=0:wv=-1:wm=-1:wd=0:ms=0:wspeed=10:wc=0:numchng=0:numchng1=0<br /> wd2=0<br /> loaded:<br /> <br /> if matsizex>500 and matsizez>500 then size=6 else size=2<br /> if matsizex>2000 and matsizez>2000 then size=10<br /> if matsizex>5000 and matsizez>5000 then size=30<br /> if matsizex>8000 and matsizez>8000 then size=40<br /> if matsizex>9999 and matsizez>9999 then size=50<br /> if matsizex>20000 and matsizez>20000 then size=75<br /> if matsizex>50000 and matsizez>50000 then size=100<br /> if matsizex>70000 and matsizez>70000 then size=200<br /> dim objstat((matsegx+1)*(matsegz+1))<br /> matsegx1=matsizex/matsegx:matsegz1=matsizez/matsegz<br /> banding=0:mx1=0:mx2=0:my1=0:my2=0:hide=-1:raiselower#=1<br /> <br /> objnum=1<br /> for z=0 to matsegz<br /> for x=0 to matsegx<br /> objstat(objnum)=-1<br /> finalcount=objnum<br /> inc objnum<br /> next x<br /> next z<br /> if finalcount>2500<br /> cls:backdrop off:ink rgb(0,255,0),0<br /> print "!!WARNING!!"<br /> Print "Because of excessive markers, markers will be hidden. Navigate to the area you want"<br /> print "to work with, hit h to show all markers, then select markers in desired work area. Then hit"<br /> print "h again to hide unselected markers. Repeat this process when changing work areas."<br /> print "Doing this will speed up the editing process."<br /> print "Press any key to continue..."<br /> wait key<br /> print "Hang on, this could be a minute!!"<br /> sleep 500<br /> backdrop on<br /> ink rgb(255,255,255),0<br /> endif<br /> <br /> sync on<br /> autocam off<br /> make matrix 1,matsizex,matsizez,matsegx,matsegz<br /> position matrix 1,0,0,0<br /> prepare matrix texture 1,1,2,5<br /> update matrix 1<br /> make object cube 70000,10:position object 70000,-10,0,-10:color object 70000,RGB(0,255,255)<br /> <br /> if load=1<br /> for x=1 to finalcount<br /> read long 1,xpos(x)<br /> read long 1,zpos(x)<br /> read float 1,height#(x)<br /> read long 1,tile(x)<br /> next x<br /> close file 1<br /> endif<br /> load=0<br /> <br /> objnum=1<br /> for z=0 to matsegz<br /> for x=0 to matsegx<br /> make object sphere objnum,size:color object objnum,rgb(0,255,0)<br /> position object objnum,x*matsegx1,height#(objnum),z*matsegz1<br /> if finalcount>2500<br /> hide object objnum<br /> endif<br /> set matrix height 1,x,z,height#(objnum)<br /> if x<matsegx and z<matsegz<br /> set matrix tile 1,x,z,tile(objnum)<br /> endif<br /> if load=1 then goto skipassign<br /> xpos(objnum)=x:zpos(objnum)=z<br /> skipassign:<br /> inc objnum<br /> next x<br /> next z<br /> if finalcount>2500 then hide=1<br /> update matrix 1<br /> <br /> set camera range 1,1000000<br /> position camera 0,500,0<br /> point camera 200,0,200<br /> <br /> mousexold#=mousex():mouseyold#=mousey()<br /> <br /> <br /> gtx=0<br /> wh=50:wd=1:wm=1<br /> mainloop:<br /> do<br /> <br /> if inkey$()="i"<br /> backdrop off:sync off:cls<br /> redoimagename:<br /> print "Input image name to apply as matrix texture or type exit to abort.>";:input gtx$<br /> if gtx$="exit" then sleep 200:backdrop on:sync on:goto aborttexture<br /> if file exist(gtx$)=0<br /> print "File invalid. Make sure to include the file extension, e.g. .bmp. Try again or type exit.>":sleep 200<br /> goto redoimagename<br /> endif<br /> load image gtx$,10<br /> tile=1:gtx=1<br /> prepare matrix texture 1,10,matsegx,matsegz<br /> for z=matsegz-1 to 0 step -1<br /> for x=0 to matsegx-1<br /> set matrix tile 1,x,z,tile<br /> inc tile<br /> next x<br /> next z<br /> update matrix 1<br /> sync on:backdrop on<br /> sleep 200<br /> endif<br /> aborttexture:<br /> <br /> <br /> <br /> <br /> <br /> dec hintdelay<br /> if hintdelay<0 then hintdelay=500+hintspeed:inc hint<br /> if hint>hints then hint=1<br /> if inkey$()="v" then inc hintspeed,50<br /> if inkey$()="V" then dec hintspeed,50<br /> if hintspeed<-400 then hintspeed=-400<br /> <br /> <br /> if inkey$()="z"<br /> inc hint<br /> if hint>hints then hint=1<br /> hintdelay=1500<br /> sleep 200<br /> endif<br /> if inkey$()="Z"<br /> dec hint<br /> if hint<1 then hint=hints<br /> hintdelay=1500<br /> sleep 200<br /> endif<br /> <br /> if inkey$()<>"q" then htinc=0<br /> if inkey$()="q"<br /> inc htinc<br /> if htinc>100 then htinc=100<br /> <br /> if wv=1<br /> inc wl,1+int(htinc/10)<br /> position matrix 2,0,wl,0<br /> sleep 20<br /> endif<br /> endif<br /> <br /> if inkey$()<>"a" then htdec=0<br /> if inkey$()="a"<br /> inc htdec<br /> if htdec>100 then htdec=100<br /> if wv=1<br /> dec wl,1+int(htdec/10)<br /> position matrix 2,0,wl,0<br /> sleep 20<br /> endif<br /> endif<br /> <br /> <br /> if inkey$()="n"<br /> sync off:backdrop off:set matrix wireframe on 1<br /> set cursor 0,0:cls rgb(0,0,0):ink RGB(255,255,255),0<br /> print "Confirm! Do you want to start a new matrix?(y/n)"<br /> print "You may want to answer no and save this matrix first lest it be lost."<br /> sleep 500<br /> getagain5:<br /> g$=inkey$()<br /> if g$<>"y" and g$<>"n" then goto getagain5<br /> if g$="y"<br /> for x=1 to finalcount:delete object x:next x:delete object 70000<br /> delete matrix 1<br /> undim xpos(finalcount):undim zpos(finalcount)<br /> undim height(finalcount):undim objstat(finalcount)<br /> sleep 200<br /> goto startover<br /> endif<br /> if g$="n"<br /> sync on:backdrop on<br /> endif<br /> sleep 500<br /> set matrix wireframe off 1<br /> endif<br /> <br /> if inkey$()="g"<br /> ghost=ghost*-1<br /> if ghost=1<br /> ghost matrix on 1<br /> endif<br /> if ghost=-1<br /> ghost matrix off 1<br /> endif<br /> sleep 200<br /> endif<br /> <br /> <br /> if inkey$()="G"<br /> ghost1=ghost1*-1<br /> if ghost1=1<br /> if matrix exist(2)=1<br /> ghost matrix on 2<br /> endif<br /> endif<br /> if ghost1=-1<br /> if matrix exist(2)=1<br /> ghost matrix off 2<br /> endif<br /> endif<br /> sleep 200<br /> endif<br /> <br /> <br /> if inkey$()="L"<br /> for x=1 to finalcount<br /> heightold#(x)=height#(x)<br /> next x:undo=1<br /> for x=1 to finalcount<br /> if objstat(x)=1<br /> height#(x)=0<br /> set matrix height 1,xpos(x),zpos(x),height#(x)<br /> position object x,xpos(x)*matsegx1,height#(x),zpos(x)*matsegz1<br /> endif<br /> next x<br /> update matrix 1<br /> sleep 200<br /> endif<br /> <br /> if inkey$()="l"<br /> sync off:backdrop off<br /> cls rgb(0,0,0):ink rgb(255,255,255),0<br /> print "Are you sure you want to level your matrix back to zero?(y/n)"<br /> print "If you answer yes, you can press shift and ' 5 ' to undo level."<br /> sleep 200<br /> getagain6:<br /> g$=inkey$()<br /> if g$<>"y" and g$<>"n" then goto getagain6<br /> if g$="y"<br /> for x=1 to finalcount<br /> heightold#(x)=height#(x)<br /> next x:undo=1<br /> for x=1 to finalcount<br /> height#(x)=0<br /> set matrix height 1,xpos(x),zpos(x),height#(x)<br /> position object x,xpos(x)*matsegx1,height#(x),zpos(x)*matsegz1<br /> objstat(x)=-1:color object x,rgb(0,255,0)<br /> next x<br /> update matrix 1<br /> endif<br /> sync on:backdrop on<br /> endif<br /> <br /> if inkey$()="b"<br /> sync off:backdrop off:cls rgb(0,0,0)<br /> ink rgb(255,255,255),0:print "Please input value you want to set for maximum sea bottom depth(0=abort)?";<br /> getbottom:<br /> input bot<br /> bot=int(bot):if bot=0 then sync on:backdrop on:goto donebot<br /> for x=1 to finalcount<br /> heightold#(x)=height#(x)<br /> next x:undo=1<br /> if bot<0 then bot=bot*-1<br /> for x=1 to finalcount<br /> if height#(x)<0-bot or height#(x)<wl<br /> height#(x)=((bot)*-1)<br /> set matrix height 1,xpos(x),zpos(x),height#(x)<br /> position object x,xpos(x)*matsegx1,height#(x),zpos(x)*matsegz1<br /> endif<br /> next x<br /> update matrix 1<br /> sync on:backdrop on<br /> endif<br /> <br /> <br /> <br /> donebot:<br /> rem watermatrix<br /> <br /> if inkey$()="6"<br /> wv=wv*-1<br /> if wv=1<br /> if matrix exist(2)=0<br /> make matrix 2,matsizex,matsizez,matsegx,matsegz<br /> prepare matrix texture 2,2,1,1<br /> position matrix 2,0,wl,0<br /> if wh>0<br /> if wd=1<br /> flip=1<br /> for z=0 to matsegz-1 step int(matsegz/10)+1<br /> for x=0 to matsegx-1<br /> if flip=1<br /> set matrix height 2,x,z,int(matsegz/5)+1+wh<br /> endif<br /> if flip=-1<br /> set matrix height 2,x,z,-int(matsegz/5)+1+wh<br /> endif<br /> next x<br /> flip=flip*-1<br /> next z<br /> endif<br /> if wd=2<br /> flip=1<br /> for x=0 to matsegx-1 step int(matsegx/10)+1<br /> for z=0 to matsegz-1<br /> if flip=1<br /> set matrix height 2,x,z,int(matsegz/5)+1+wh<br /> endif<br /> if flip=-1<br /> set matrix height 2,x,z,-int(matsegz/5)+1+wh<br /> endif<br /> next z<br /> flip=flip*-1<br /> next x<br /> endif<br /> for x=1 to matsegx-1<br /> for z=1 to matsegz-1<br /> a=get matrix height(2,x-1,z+1)<br /> b=get matrix height(2,x,z+1)<br /> c=get matrix height(2,x+1,z+1)<br /> d=get matrix height(2,x+1,z)<br /> e=get matrix height(2,x+1,z-1)<br /> f=get matrix height(2,x,z-1)<br /> g=get matrix height(2,x-1,z-1)<br /> h=get matrix height(2,x-1,z)<br /> total=a+b+c+d+e+f+g+h<br /> av#=total/8<br /> set matrix height 2,x,z,av#<br /> next z<br /> next x<br /> for x=0 to matsegx<br /> set matrix height 2,x,0,get matrix height(2,x,1)<br /> next x<br /> <br /> for x=0 to matsegx<br /> set matrix height 2,x,tilez,get matrix height(2,x,matsegz-1)<br /> next x<br /> <br /> for z=0 to matsegz<br /> set matrix height 2,0,z,get matrix height(2,1,z)<br /> next z<br /> <br /> for z=0 to matsegz<br /> set matrix height 2,tilex,z,get matrix height(2,matsegx-1,z)<br /> next z<br /> <br /> endif<br /> update matrix 2<br /> if ghost1=1 then ghost matrix on 2<br /> endif<br /> endif<br /> if wv=-1<br /> if matrix exist(2)=1<br /> delete matrix 2<br /> endif<br /> endif<br /> sleep 200<br /> endif<br /> <br /> if inkey$()="d"<br /> if wd=1 then wd=2 else wd=1<br /> dc=1<br /> sleep 200<br /> endif<br /> if inkey$()="D"<br /> if wd1=0 then wd1=1 else wd1=0<br /> sleep 200<br /> endif<br /> <br /> <br /> if inkey$()="m"<br /> wm=wm*-1<br /> sleep 200<br /> endif<br /> <br /> inc ms<br /> if ms>wspeed<br /> ms=0<br /> if wm=1<br /> if wv=1<br /> if wd=1<br /> if matrix exist(2)=1<br /> if wd1=0 then shift matrix up 2<br /> if wd1=1 then shift matrix down 2<br /> update matrix 2<br /> endif<br /> endif<br /> if wd=2<br /> if matrix exist(2)=1<br /> if wd1=0 then shift matrix right 2<br /> if wd1=1 then shift matrix left 2<br /> update matrix 2<br /> endif<br /> endif<br /> endif<br /> endif<br /> endif<br /> <br /> if whc=1 and mousex()<screen width()-58 or dc=1 or wc=1<br /> if whc=1 then whc=0<br /> if dc=1 then dc=0<br /> if wc=1 then wc=0<br /> if matrix exist(2)=1 then delete matrix 2<br /> make matrix 2,matsizex,matsizez,matsegx,matsegz<br /> prepare matrix texture 2,2,1,1<br /> position matrix 2,0,wl,0<br /> <br /> if wd=1<br /> flip=1<br /> for z=0 to matsegz-1 step int(matsegz/10)+1<br /> for x=0 to matsegx-1<br /> if flip=1<br /> set matrix height 2,x,z,int(matsegz/5)+1+wh<br /> endif<br /> if flip=-1<br /> set matrix height 2,x,z,-int(matsegz/5)+1+wh<br /> endif<br /> next x<br /> flip=flip*-1<br /> next z<br /> endif<br /> if wd=2<br /> flip=1<br /> for x=0 to matsegx-1 step int(matsegx/10)+1<br /> for z=0 to matsegz-1<br /> if flip=1<br /> set matrix height 2,x,z,int(matsegz/5)+1+wh<br /> endif<br /> if flip=-1<br /> set matrix height 2,x,z,-int(matsegz/5)+1+wh<br /> endif<br /> next z<br /> flip=flip*-1<br /> next x<br /> endif<br /> rem smooth water<br /> for x=1 to matsegx-1<br /> for z=1 to matsegz-1<br /> a=get matrix height(2,x-1,z+1)<br /> b=get matrix height(2,x,z+1)<br /> c=get matrix height(2,x+1,z+1)<br /> d=get matrix height(2,x+1,z)<br /> e=get matrix height(2,x+1,z-1)<br /> f=get matrix height(2,x,z-1)<br /> g=get matrix height(2,x-1,z-1)<br /> h=get matrix height(2,x-1,z)<br /> total=a+b+c+d+e+f+g+h<br /> av#=total/8<br /> set matrix height 2,x,z,av#<br /> next z<br /> next x<br /> for x=0 to matsegx<br /> set matrix height 2,x,0,get matrix height(2,x,1)<br /> next x<br /> <br /> for x=0 to matsegx<br /> set matrix height 2,x,tilez,get matrix height(2,x,matsegz-1)<br /> next x<br /> <br /> for z=0 to matsegz<br /> set matrix height 2,0,z,get matrix height(2,1,z)<br /> next z<br /> <br /> for z=0 to matsegz<br /> set matrix height 2,tilex,z,get matrix height(2,matsegx-1,z)<br /> next z<br /> update matrix 2<br /> if ghost1=1 then ghost matrix on 2<br /> <br /> endif<br /> <br /> if inkey$()="1" then goto savematrix<br /> if inkey$()="2" then goto loadmatrix<br /> if gtx=1 then goto skiptexturemode<br /> if inkey$()="3" then gosub texture<br /> skiptexturemode:<br /> base=get ground height(1,0,0):position object 70000,-10,base,-10<br /> mousexnew#=mousexold#-mousex():mouseynew#=mouseyold#-mousey()<br /> <br /> if upkey()=1 or mouseclick()=2 and mouseynew#>0<br /> pitch camera down 2<br /> endif<br /> <br /> if downkey()=1 or mouseclick()=2 and mouseynew#<0<br /> pitch camera up 2<br /> endif<br /> <br /> if leftkey()=1 or mouseclick()=2 and mousexnew#>0<br /> turn camera left 2<br /> endif<br /> <br /> if rightkey()=1 or mouseclick()=2 and mousexnew#<0<br /> turn camera right 2<br /> endif<br /> if mousezold<mousez() or inkey$()="+"<br /> move camera 10*size<br /> ghty=get ground height(1,camera position x(),camera position z())<br /> ghty1=camera position y()-ghty<br /> if ghty1<10 then move camera -10*size<br /> endif<br /> if mousezold>mousez() or inkey$()="-"<br /> move camera -10*size<br /> ghty=get ground height(1,camera position x(),camera position z())<br /> ghty1=camera position y()-ghty<br /> if ghty1<10 then move camera 10*size<br /> endif<br /> <br /> if banding=1 then goto skiptilt<br /> if mouseclick()=3 and mousexnew#>0<br /> roll camera left 2<br /> endif<br /> if mouseclick()=3 and mousexnew#<0<br /> roll camera right 2<br /> endif<br /> <br /> skiptilt:<br /> <br /> if banding=1 then goto skipfirst<br /> if mouseclick()=1<br /> mx1=mousex():my1=mousey():banding=1<br /> endif<br /> <br /> skipfirst:<br /> <br /> if banding=1 then mx2=mousex():my2=mousey()<br /> if mx1>mx2 and my1<my2 or mx1<mx2 and my1>my2 then banding=0<br /> if mousex()>screen width()-58 and mousex()<screen width()-42 and mousey()<250 then banding=0<br /> if banding=1 and mouseclick()=0<br /> if mx1<mx2<br /> for x=1 to finalcount<br /> <br /> if object visible(x)=1<br /> ox=object screen x(x):oy=object screen y(x)<br /> if ox>mx1 and ox<mx2 and oy>my1 and oy<my2<br /> objstat(x)=1:color object x,rgb(255,0,0)<br /> endif<br /> endif<br /> next x<br /> endif<br /> if mx1>mx2<br /> for x=1 to finalcount<br /> <br /> if object visible(x)=1<br /> ox=object screen x(x):oy=object screen y(x)<br /> if ox<mx1 and ox>mx2 and oy<my1 and oy>my2<br /> objstat(x)=objstat(x)*-1<br /> if objstat(x)=1 then color object x,rgb(255,0,0)<br /> if objstat(x)=-1 then color object x,rgb(0,255,0)<br /> endif<br /> endif<br /> next x<br /> endif<br /> banding=0<br /> endif<br /> <br /> if banding=1 and mx1<>mx2 or my1<>my2 then goto skipselect<br /> if mousex()>screen width()-58 and mousex()<screen width()-42 and mousey()<250 then goto skipselect<br /> if mousexnew#=0 and mouseynew#=0<br /> if mouseclick()=1 and mx1=mx2 and banding=1 and mx1=mx2 and my1=my2<br /> for x=1 to finalcount<br /> if object visible(x)=1<br /> if object in screen(x)=1<br /> sx=object screen x(x):sy=object screen y(x)<br /> if mousex()>sx-5 and mousex()<sx+5 and mousey()>sy-5 and mousey()<sy+5<br /> objstat(x)=objstat(x)*-1<br /> if objstat(x)=1 then color object x,rgb(255,0,0)<br /> if objstat(x)=-1 then color object x,rgb(0,255,0)<br /> sleep 200<br /> x=finalcount:banding=0<br /> endif<br /> endif<br /> endif<br /> next x<br /> sleep 200<br /> endif<br /> endif<br /> skipselect:<br /> <br /> <br /> if banding=1 then goto skipnumchng<br /> if mouseclick()=0 then numchng=0:numchng1=0<br /> <br /> if mouseclick()=1<br /> if mousex()>screen width()-58 and mousex()<screen width()-42<br /> inc numchng<br /> if numchng>100 then numchg=100<br /> oset=int(numchng/10)<br /> if numchng=100 then inc numchng1<br /> if numchng1>20 then numchng1=20<br /> if numchng1=20 then oset=oset*10<br /> if mousey()>29 and mousey()<44<br /> inc raiselower#,1+oset<br /> sleep 20<br /> endif<br /> if mousey()>70 and mousey()<85<br /> dec raiselower#,1+oset<br /> if raiselower#<1 then raiselower#=1<br /> sleep 20<br /> endif<br /> if mousey()>100 and mousey()<120<br /> dec wspeed,1+oset<br /> if wspeed<0 then wspeed=0<br /> endif<br /> if mousey()>135 and mousey()<155<br /> inc wspeed,1+oset<br /> endif<br /> if mousey()>180 and mousey()<205<br /> inc wh,1+oset<br /> whc=1<br /> endif<br /> if mousey()>215 and mousey()<235<br /> dec wh,1+oset<br /> if wh<0 then wh=0<br /> whc=1<br /> endif<br /> sleep 50<br /> endif<br /> endif<br /> <br /> skipnumchng:<br /> <br /> if mouseclick()=4 and mouseynew#>0 or inkey$()="."<br /> for x=1 to finalcount<br /> if objstat(x)=1<br /> gh#=get matrix height(1,xpos(x),zpos(x))<br /> inc height#(x),raiselower#<br /> set matrix height 1,xpos(x),zpos(x),height#(x)<br /> position object x,xpos(x)*matsegx1,height#(x),zpos(x)*matsegz1<br /> endif<br /> next x<br /> update matrix 1<br /> endif<br /> <br /> if mouseclick()=4 and mouseynew#<0 or inkey$()=","<br /> for x=1 to finalcount<br /> if objstat(x)=1<br /> dec height#(x),raiselower#<br /> set matrix height 1,xpos(x),zpos(x),height#(x)<br /> position object x,xpos(x)*matsegx1,height#(x),zpos(x)*matsegz1<br /> endif<br /> next x<br /> update matrix 1<br /> endif<br /> if inkey$()="u"<br /> for x=1 to finalcount<br /> if objstat(x)=1<br /> objstat(x)=-1<br /> color object x,rgb(0,255,0)<br /> endif<br /> next x<br /> endif<br /> <br /> if inkey$()="s"<br /> for x=1 to finalcount<br /> if object visible(x)=1 then objstat(x)=1:color object x,rgb(255,0,0)<br /> next x<br /> endif<br /> <br /> if inkey$()="t"<br /> for x=1 to finalcount<br /> if object visible(x)=1<br /> objstat(x)=objstat(x)*-1<br /> if objstat(x)=1 then color object x,rgb(255,0,0)<br /> if objstat(x)=-1 then color object x,rgb(0,255,0)<br /> endif<br /> next x<br /> sleep 200<br /> endif<br /> if inkey$()="h"<br /> hide=hide*-1<br /> if hide=1<br /> for x=1 to finalcount<br /> if objstat(x)=-1<br /> hide object x<br /> endif<br /> next x<br /> endif<br /> if hide=-1<br /> for x=1 to finalcount<br /> if objstat(x)=-1<br /> if object visible(x)=0 then show object x<br /> endif<br /> next x<br /> endif<br /> sleep 200<br /> endif<br /> <br /> <br /> if inkey$()="o" then o=o*-1:sleep 200<br /> <br /> if inkey$()="%"<br /> if undo=1<br /> for x=1 to finalcount<br /> height#(x)=heightold#(x)<br /> set matrix height 1,xpos(x),zpos(x),height#(x)<br /> position object x,xpos(x)*matsegx1,height#(x),zpos(x)*matsegz1<br /> next x<br /> update matrix 1<br /> undo=0<br /> sleep 200<br /> endif<br /> endif<br /> <br /> <br /> <br /> <br /> Rem Smooth matrix<br /> if inkey$()="5"<br /> for x=1 to finalcount<br /> heightold#(x)=height#(x)<br /> next x<br /> undo=1<br /> for x=1 to matsegx-1<br /> for z=1 to matsegz-1<br /> a=get matrix height(1,x-1,z+1)<br /> b=get matrix height(1,x,z+1)<br /> c=get matrix height(1,x+1,z+1)<br /> d=get matrix height(1,x+1,z)<br /> e=get matrix height(1,x+1,z-1)<br /> f=get matrix height(1,x,z-1)<br /> g=get matrix height(1,x-1,z-1)<br /> h=get matrix height(1,x-1,z)<br /> total=a+b+c+d+e+f+g+h<br /> av#=total/8<br /> set matrix height 1,x,z,av#<br /> next z<br /> next x<br /> for x=0 to matsegx<br /> set matrix height 1,x,0,get matrix height(1,x,1)<br /> next x<br /> <br /> for x=0 to matsegx<br /> set matrix height 1,x,tilez,get matrix height(1,x,matsegz-1)<br /> next x<br /> <br /> for z=0 to matsegz<br /> set matrix height 1,0,z,get matrix height(1,1,z)<br /> next z<br /> <br /> for z=0 to matsegz<br /> set matrix height 1,tilex,z,get matrix height(1,matsegx-1,z)<br /> next z<br /> <br /> update matrix 1<br /> for x=1 to finalcount<br /> height#(x)=get matrix height(1,xpos(x),zpos(x))<br /> position object x,xpos(x)*matsegx1,height#(x),zpos(x)*matsegz1<br /> next x<br /> sleep 500<br /> endif<br /> <br /> <br /> mousexold#=mousex():mouseyold#=mousey():mousezold=mousez()<br /> <br /> if inkey$()="w"<br /> if matrix wireframe state(1)=1 then set matrix wireframe off 1 else set matrix wireframe on 1<br /> sleep 200<br /> endif<br /> ink RGB(0,255,255),0<br /> set cursor 0,0:Print "Matrix properties"<br /> set cursor screen width()/2-124,0<br /> print "MATRIX MASTER Pro v1.9 - by Richard Sardini"<br /> ink RGB(0,128,255),0<br /> print "X-size->";matsizex;"->Z-size->";matsizez<br /> print "X-segment->";matsegx;"->Z-segment->";matsegz<br /> print "Water level->";wl<br /> set cursor screen width()/2-80,40<br /> print "You are editing matix> ";:ink rgb(255,255,0),0:print matname$:ink rgb(255,255,255),0<br /> set cursor screen width()/2-80,80:print "You are in Elevation mode.":ink rgb(255,255,255),0<br /> print "Mousex->";mousex();" Mousey->";mousey()<br /> xl=screen width()/2:yl=screen height()/2<br /> ink RGB(192,192,192),0<br /> line xl,200,xl,screen height()-200<br /> line 250,yl,screen width()-250,yl<br /> ink rgb(255,255,255),0<br /> if banding=1<br /> if mx1<mx2 then ink RGB(255,0,128),0 else ink RGB(255,255,0),0<br /> line mx1,my1,mx2,my1:line mx1,my2,mx1,my1<br /> line mx2,my1,mx2,my2:line mx1,my2,mx2,my2<br /> ink rgb(255,255,255),0<br /> endif<br /> cnt1=0<br /> print "First 16 markers selected/height"<br /> for x=1 to finalcount<br /> if objstat(x)=1<br /> print "X->";xpos(x);" Z->";zpos(x);" Height->";height#(x)<br /> inc cnt1<br /> if cnt1>15 then x=finalcount<br /> endif<br /> next x<br /> <br /> if o=-1 then goto skiphints<br /> inc hintc1,8:if hintc1>255 then hintc1=100<br /> hintcolor=rgb(0,hintc1,0)<br /> ink hintcolor,0<br /> text 0,screen height()-75,hint$(hint)<br /> skiphints:<br /> set cursor screen width()/5,screen height()-50<br /> ink rgb(255,255,255),0<br /> print "Press: 1-Save, 2-Load, 3-Enter texture mode, Z-Zip to next hint, Shift Z-Zip back one hint."<br /> set cursor screen width()/5,screen height()-25<br /> print "Press: 5-Smooth matrix one time, Shif 5-undo last smoothing, 6-Toggle water on and back off"<br /> set cursor screen width()-160,50<br /> print "Elevation change->";raiselower#<br /> ink rgb(255,0,0),0<br /> line screen width()-54,44,screen width()-46,44<br /> line screen width()-54,44,screen width()-50,34<br /> line screen width()-46,44,screen width()-50,34<br /> <br /> line screen width()-54,70,screen width()-46,70<br /> line screen width()-54,70,screen width()-50,80<br /> line screen width()-46,70,screen width()-50,80<br /> ink rgb(255,255,255),0<br /> <br /> if wv=1<br /> set cursor screen width()-140,120<br /> print "Wave speed->";wspeed<br /> set cursor screen width()-150,200<br /> print "Wave height->";wh<br /> ink rgb(255,0,0),0<br /> line screen width()-54,114,screen width()-46,114<br /> line screen width()-54,114,screen width()-50,104<br /> line screen width()-46,114,screen width()-50,104<br /> <br /> line screen width()-54,140,screen width()-46,140<br /> line screen width()-54,140,screen width()-50,150<br /> line screen width()-46,140,screen width()-50,150<br /> <br /> line screen width()-54,194,screen width()-46,194<br /> line screen width()-54,194,screen width()-50,184<br /> line screen width()-46,194,screen width()-50,184<br /> <br /> line screen width()-54,220,screen width()-46,220<br /> line screen width()-54,220,screen width()-50,230<br /> line screen width()-46,220,screen width()-50,230<br /> endif<br /> ink RGB(236,237,173),0<br /> line mousex()-9,mousey()-9,mousex()+10,mousey()+10<br /> line mousex()-9,mousey()+9,mousex()+10,mousey()-10<br /> <br /> <br /> ink rgb(255,255,255),0<br /> sync<br /> loop<br /> <br /> savematrix:<br /> backdrop off<br /> sync off:cls rgb(0,0,0)<br /> ink rgb(255,255,255),0<br /> <br /> <br /> savematrix1:<br /> if file exist(matname$)=1<br /> sleep 500<br /> print "File already exist - Would you like to overwrite this file or rename your matrix?"<br /> <br /> print "Press 2 to overwrite or 3 to rename this matrix"<br /> getagain:<br /> g$=inkey$()<br /> if g$<>"2" and g$<>"3" then sleep 200:goto getagain<br /> if g$="3"<br /> sleep 200<br /> print "What is the new file name?";:input matname$<br /> sleep 200<br /> goto savematrix1<br /> endif<br /> if g$="2" then delete file matname$:sleep 200<br /> endif<br /> open to write 1,matname$<br /> write long 1,matsizex:write long 1,matsizez:write long 1,matsegx:write long 1,matsegz<br /> write long 1,finalcount<br /> for x=1 to finalcount<br /> write long 1,xpos(x)<br /> write long 1,zpos(x)<br /> write float 1,height#(x)<br /> write long 1,tile(x)<br /> next x<br /> close file 1<br /> print "File saved as:";:ink rgb(0,255,0),0:print matname$;:ink rgb(255,255,255),0:print ", Press any key to return to editor"<br /> sleep 500<br /> wait key<br /> sleep 200<br /> sync on<br /> backdrop on<br /> goto mainloop<br /> <br /> <br /> <br /> loadmatrix:<br /> if matrix exist(2)=1 then delete matrix 2<br /> backdrop off<br /> sync off:cls rgb(0,0,0)<br /> ink rgb(255,255,255),0<br /> <br /> print "Current matrix will be lost. Proceed(Y/N)?"<br /> getinput:<br /> g$=inkey$()<br /> if g$="n" or g$="N" then sync on:backdrop on:goto mainloop<br /> if g$<>"y" then goto getinput<br /> delete matrix 1<br /> for x=1 to finalcount<br /> delete object x<br /> next x<br /> delete object 70000<br /> <br /> undim xpos(finalcount):undim zpos(finalcount)<br /> undim height#(finalcount):undim objstat(finalcount)<br /> undim tile(finalcount):undim heightold#(finalcount)<br /> redomatrixname:<br /> input "File name to load?";matname$<br /> print "If nothing happens, press enter again."<br /> if matname$="exit" then goto startover<br /> if file exist(matname$)=0<br /> print "File does not exist: Try again or type exit"<br /> sleep 500<br /> goto redomatrixname<br /> endif<br /> if file exist(matname$)=1<br /> open to read 1,matname$<br /> read long 1,matsizex:read long 1,matsizez<br /> read long 1,matsegx:read long 1,matsegz<br /> read long 1,finalcount<br /> dim height#(finalcount):dim xpos(finalcount):dim zpos(finalcount)<br /> dim tile(finalcount):dim heightold#(finalcount)<br /> load=1<br /> endif<br /> sync on<br /> backdrop on<br /> goto loaded<br /> <br /> <br /> <br /> texture:<br /> objnum=1:wc=0<br /> if matrix wireframe state(1)=1 then set matrix wireframe off 1<br /> for z=0 to matsegz<br /> for x=0 to matsegx<br /> if object visible(objnum)=0 then show object objnum<br /> color object objnum,rgb(0,255,0):objstat(objnum)=-1<br /> if xpos(objnum)=matsegx or zpos(objnum)=matsegz then hide object objnum<br /> height1=int(get ground height(1,(x*matsegx1)+(matsegx1/2),(z*matsegz1)+(matsegz1/2)))<br /> position object objnum,(x*matsegx1)+(matsegx1/2),height1,(z*matsegz1)+(matsegz1/2)<br /> <br /> inc objnum<br /> next x<br /> next z<br /> for x=1 to finalcount<br /> if xpos(x)=matsegx or zpos(x)=matsegz then hide object x<br /> next x<br /> rval=0<br /> if matrix exist(2)=1 then delete matrix 2:rval=1<br /> hint=36:hintdelay=1000<br /> tile=1<br /> <br /> <br /> <br /> <br /> <br /> <br /> do<br /> <br /> dec hintdelay<br /> if hintdelay<0 then hintdelay=500+hintspeed:inc hint<br /> if hint>39 then hint=16<br /> if inkey$()="z"<br /> inc hint<br /> if hint>39 then hint=16<br /> hintdelay=1500<br /> sleep 200<br /> endif<br /> if inkey$()="Z"<br /> dec hint<br /> if hint<16 then hint=39<br /> hintdelay=1500<br /> sleep 200<br /> endif<br /> if inkey$()="v" then inc hintspeed,50<br /> if inkey$()="V" then dec hintspeed,50<br /> if hintspeed<-400 then hintspeed=-400<br /> <br /> if mouseclick()=1 and banding=0<br /> if mousex()>699 and mousey()<250<br /> if mousex()<732 and mousey()<30 then tile=1<br /> if mousex()>732 and mousey()<30 then tile=2<br /> if mousex()<732 and mousey()>30 and mousey()<64 then tile=3<br /> if mousex()>732 and mousey()>30 and mousey()<64 then tile=4<br /> if mousex()<732 and mousey()>64 and mousey()<96 then tile=5<br /> if mousex()>732 and mousey()>64 and mousey()<96 then tile=6<br /> if mousex()<732 and mousey()>96 and mousey()<128 then tile=7<br /> if mousex()>732 and mousey()>96 and mousey()<128 then tile=8<br /> if mousex()<732 and mousey()>128 and mousey()<160 then tile=9<br /> if mousex()>732 and mousey()>128 and mousey()<160 then tile=10<br /> for x=1 to finalcount<br /> if objstat(x)=1<br /> set matrix tile 1,xpos(x),zpos(x),tile<br /> tile(x)=tile<br /> endif<br /> next x<br /> update matrix 1<br /> endif<br /> endif<br /> if inkey$()="4"<br /> for x=1 to finalcount<br /> position object x,xpos(x)*matsegx1,height#(x),zpos(x)*matsegz1<br /> objstat(x)=-1:color object x,rgb(0,255,0)<br /> if object visible(x)=0 then show object x<br /> next x<br /> hint=1<br /> if rval=1<br /> wc=1<br /> endif<br /> return<br /> endif<br /> <br /> <br /> <br /> <br /> base=get ground height(1,0,0):position object 70000,-10,base,-10<br /> mousexnew#=mousexold#-mousex():mouseynew#=mouseyold#-mousey()<br /> <br /> if upkey()=1 or mouseclick()=2 and mouseynew#>0<br /> pitch camera down 2<br /> endif<br /> <br /> if downkey()=1 or mouseclick()=2 and mouseynew#<0<br /> pitch camera up 2<br /> endif<br /> <br /> if leftkey()=1 or mouseclick()=2 and mousexnew#>0<br /> turn camera left 2<br /> endif<br /> <br /> if rightkey()=1 or mouseclick()=2 and mousexnew#<0<br /> turn camera right 2<br /> endif<br /> if mousezold<mousez() or inkey$()="+"<br /> move camera 20*size<br /> ghty=get ground height(1,camera position x(0),camera position z(0))<br /> ghty1=camera position y()-ghty<br /> if ghty1<50 then move camera -20*size<br /> endif<br /> if mousezold>mousez() or inkey$()="-"<br /> move camera -20*size<br /> ghty=get ground height(1,camera position x(0),camera position z(0))<br /> ghty1=camera position y()-ghty<br /> if ghty1<50 then move camera 20*size<br /> endif<br /> <br /> if banding=1 then goto skiptilt2<br /> if mouseclick()=3 and mousexnew#>0<br /> roll camera left 2<br /> endif<br /> if mouseclick()=3 and mousexnew#<0<br /> roll camera right 2<br /> endif<br /> <br /> skiptilt2:<br /> <br /> if banding=1 then goto skipfirst2<br /> if mouseclick()=1<br /> mx1=mousex():my1=mousey():banding=1<br /> endif<br /> <br /> skipfirst2:<br /> <br /> if banding=1 then mx2=mousex():my2=mousey()<br /> if mx1>mx2 and my1<my2 or mx1<mx2 and my1>my2 then banding=0<br /> <br /> if banding=1 and mouseclick()=0<br /> if mx1<mx2<br /> for x=1 to finalcount<br /> if object visible(x)=1<br /> ox=object screen x(x):oy=object screen y(x)<br /> if ox>mx1 and ox<mx2 and oy>my1 and oy<my2<br /> objstat(x)=1:color object x,rgb(255,0,0)<br /> endif<br /> endif<br /> next x<br /> endif<br /> if mx1>mx2<br /> for x=1 to finalcount<br /> if object visible(x)=1<br /> ox=object screen x(x):oy=object screen y(x)<br /> if ox<mx1 and ox>mx2 and oy<my1 and oy>my2<br /> objstat(x)=objstat(x)*-1<br /> if objstat(x)=1 then color object x,rgb(255,0,0)<br /> if objstat(x)=-1 then color object x,rgb(0,255,0)<br /> endif<br /> endif<br /> next x<br /> endif<br /> banding=0<br /> endif<br /> <br /> if banding=1 and mx1<>mx2 and my1<>my2 then goto skipselect22<br /> <br /> if mousexnew#=0 and mouseynew#=0<br /> if mouseclick()=1 and mx1=mx2 and banding=1 and mx1=mx2 and my1=my2<br /> for x=1 to finalcount<br /> if object visible(x)=1<br /> if object in screen(x)=1<br /> sx=object screen x(x):sy=object screen y(x)<br /> if mousex()>sx-5 and mousex()<sx+5 and mousey()>sy-5 and mousey()<sy+5<br /> objstat(x)=objstat(x)*-1<br /> if objstat(x)=1 then color object x,rgb(255,0,0)<br /> if objstat(x)=-1 then color object x,rgb(0,255,0)<br /> sleep 200<br /> x=finalcount:banding=0<br /> endif<br /> endif<br /> endif<br /> next x<br /> sleep 200<br /> endif<br /> endif<br /> skipselect22:<br /> if inkey$()="u"<br /> for x=1 to finalcount<br /> if object visible(x)=1<br /> if objstat(x)=1<br /> objstat(x)=-1<br /> color object x,rgb(0,255,0)<br /> endif<br /> endif<br /> next x<br /> endif<br /> <br /> if inkey$()="g"<br /> ghost=ghost*-1<br /> if ghost=1<br /> ghost matrix on 1<br /> endif<br /> if ghost=-1<br /> ghost matrix off 1<br /> endif<br /> sleep 200<br /> endif<br /> <br /> if inkey$()="s"<br /> for x=1 to finalcount<br /> if object visible(x)=1 then objstat(x)=1:color object x,rgb(255,0,0)<br /> next x<br /> endif<br /> <br /> if inkey$()="t"<br /> for x=1 to finalcount<br /> if object visible(x)=1<br /> objstat(x)=objstat(x)*-1<br /> if objstat(x)=1 then color object x,rgb(255,0,0)<br /> if objstat(x)=-1 then color object x,rgb(0,255,0)<br /> endif<br /> next x<br /> sleep 200<br /> endif<br /> <br /> if inkey$()="h"<br /> hide=hide*-1<br /> if hide=1<br /> for x=1 to finalcount<br /> if objstat(x)=-1 and xpos(x)<matsegx and zpos(x)<matsegz<br /> hide object x<br /> endif<br /> next x<br /> endif<br /> if hide=-1<br /> for x=1 to finalcount<br /> if objstat(x)=-1 and xpos(x)<matsegx and zpos(x)<matsegz<br /> if object visible(x)=0 then show object x<br /> endif<br /> next x<br /> endif<br /> sleep 200<br /> endif<br /> <br /> if inkey$()="o" then o=o*-1:sleep 200<br /> <br /> <br /> mousexold#=mousex():mouseyold#=mousey():mousezold=mousez()<br /> <br /> <br /> ink RGB(0,255,255),0<br /> set cursor screen width()/2-120,0<br /> print "MATRIX MASTER v1.9 - by Richard Sardini"<br /> ink RGB(0,128,255),0<br /> print "X-size=";matsizex;"->Z-size=";matsizez<br /> print "X-segment=";matsegx;"->Z-segment=";matsegz<br /> set cursor screen width()/2-80,40<br /> print "You are editing matix> ";:ink rgb(255,255,0),0:print matname$<br /> set cursor screen width()/2-80,80:print "You are in Texture mode.":ink rgb(255,255,255),0<br /> print "Mousex->";mousex();" Mousey->";mousey()<br /> xl=screen width()/2:yl=screen height()/2<br /> ink RGB(192,192,192),0<br /> line xl,200,xl,screen height()-200<br /> line 250,yl,screen width()-250,yl<br /> ink rgb(255,255,255),0<br /> if banding=1<br /> if mx1<mx2 then ink RGB(255,0,128),0 else ink RGB(255,255,0),0<br /> line mx1,my1,mx2,my1:line mx1,my2,mx1,my1<br /> line mx2,my1,mx2,my2:line mx1,my2,mx2,my2<br /> ink rgb(255,255,255),0<br /> endif<br /> cnt1=0<br /> print "First 16 markers selected/tile"<br /> for x=1 to finalcount<br /> if objstat(x)=1<br /> print "X->";xpos(x);" Z->";zpos(x);" Tile->";tile(x)<br /> inc cnt1<br /> if cnt1>15 then x=finalcount<br /> endif<br /> next x<br /> <br /> if o=-1 then goto skiphints1<br /> inc hintc1,8:if hintc1>255 then hintc1=100<br /> hintcolor=rgb(0,hintc1,0)<br /> ink hintcolor,0<br /> text 0,screen height()-75,hint$(hint)<br /> skiphints1:<br /> <br /> set cursor screen width()/5,screen height()-50<br /> <br /> ink RGB(236,237,173),0<br /> line mousex()-9,mousey()-9,mousex()+10,mousey()+10<br /> line mousex()-9,mousey()+9,mousex()+10,mousey()-10<br /> <br /> ink rgb(255,255,255),0<br /> print "Press: 4-Exit texture mode, Z-Zip to next hint, Shift Z-Zip back one hint."<br /> paste image 1,700,0<br /> sync<br /> loop<br /> <br /> <br /> <br /> <br /> remstart<br /> <br /> This is the code snippet you will need to re-load your matrix into your DB programs<br /> <br /> open to read 1,<filenamehere><br /> read long 1,matsizex:read long 1,matsizez<br /> read long 1,matsegx:read long 1,matsegz<br /> read long 1,finalcount<br /> dim height#(finalcount):dim xpos(finalcount):dim zpos(finalcount):dim tile(finalcount)<br /> for x=1 to finalcount<br /> read long 1,xpos(x)<br /> read long 1,zpos(x)<br /> read float 1,height#(x)<br /> read long 1,tile(x)<br /> next x<br /> close file 1<br /> make matrix 1,matsizex,matsizez,matsegx,matsegz<br /> rem insert matrix texure here if tiling, otherwise delete marked line<br /> for x=1 to finalcount<br /> set matrix height 1,xpos(x),zpos(x),height#(x)<br /> if xpos(x)<matsegx and zpos(x)<matsegz `delete this line if not using texture<br /> set matrix tile 1,xpos(x),zpos(x),tile(x) `delete this line if not using texture<br /> endif `delete this line if not using texture<br /> next x<br /> update matrix 1<br /> <br /> endrem
Comments
No comments yet.