Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / This is HARD!

Author
Message
Freezer
22
Years of Service
User Offline
Joined: 12th Nov 2002
Location:
Posted: 25th Mar 2003 19:07
I have used some code from another matrix! And that is who to get water and stuff with! But what i have problem with is how to texturise the water! here is the code:
rem Game settings
hide mouse
color backdrop rgb(0,0,0)
autocam off
set camera range 1,1000000
sync on
set mipmap mode 500

rem Arrays and variables
dim playergrav(50)
dim player_object(50)
player_object(1)=1

rem Change mode
set display mode 1024,768,16

rem Load bitmaps
load bitmap "tiles.bmp",1
get image 1,0,0,256,256
delete bitmap 1

rem Make a matrix
make matrix 1,10000,20000,70,70
prepare matrix texture 1,1,2,2
position matrix 1,0,0,0
randomize matrix 1,(50-20)
set matrix texture 1,1,1

make matrix 3,10000,20000,70,70
position matrix 3,0,0,20000
randomize matrix 3,(50-20)
set matrix texture 3,1,1

rem Make stairs
for t=2 to 20
make object box t,1000,t*20,50 : position object t,5000,t*10,t*50+4900
next t

rem Make mountains
set matrix height 1,0,0,870
set matrix height 1,0,1,870
set matrix height 1,0,2,880
set matrix height 1,0,3,950
set matrix height 1,0,4,930
set matrix height 1,0,5,910
set matrix height 1,0,6,890
set matrix height 1,0,7,850
set matrix height 1,0,8,880
set matrix height 1,0,9,910
set matrix height 1,0,10,980
set matrix height 1,0,11,940
set matrix height 1,0,12,910
set matrix height 1,0,13,950

set matrix height 1,1,0,870
set matrix height 1,1,1,870
set matrix height 1,1,2,880
set matrix height 1,1,3,950
set matrix height 1,1,4,930
set matrix height 1,1,5,910
set matrix height 1,1,6,890
set matrix height 1,1,7,850
set matrix height 1,1,8,880
set matrix height 1,1,9,910
set matrix height 1,1,10,980
set matrix height 1,1,11,940
set matrix height 1,1,12,910

set matrix height 1,2,0,870
set matrix height 1,2,1,870
set matrix height 1,2,2,880
set matrix height 1,2,3,950
set matrix height 1,2,4,930
set matrix height 1,2,5,910
set matrix height 1,2,6,890
set matrix height 1,2,7,850
set matrix height 1,2,8,880
set matrix height 1,2,9,910
set matrix height 1,2,10,980
set matrix height 1,2,11,940

set matrix height 1,3,0,870
set matrix height 1,3,1,870
set matrix height 1,3,2,880
set matrix height 1,3,3,950
set matrix height 1,3,4,930
set matrix height 1,3,5,910
set matrix height 1,3,6,890
set matrix height 1,3,7,850
set matrix height 1,3,8,880
set matrix height 1,3,9,910
set matrix height 1,3,10,980

set matrix height 1,4,0,870
set matrix height 1,4,1,870
set matrix height 1,4,2,880
set matrix height 1,4,3,950
set matrix height 1,4,4,930
set matrix height 1,4,5,910
set matrix height 1,4,6,890
set matrix height 1,4,7,850
set matrix height 1,4,8,880
set matrix height 1,4,9,910

set matrix height 1,5,0,870
set matrix height 1,5,1,870
set matrix height 1,5,2,880
set matrix height 1,5,3,950
set matrix height 1,5,4,930
set matrix height 1,5,5,910
set matrix height 1,5,6,890
set matrix height 1,5,7,850
set matrix height 1,5,8,880

set matrix height 1,6,0,870
set matrix height 1,6,1,870
set matrix height 1,6,2,880
set matrix height 1,6,3,950
set matrix height 1,6,4,930
set matrix height 1,6,5,910
set matrix height 1,6,6,890
set matrix height 1,6,7,850

set matrix height 1,7,0,870
set matrix height 1,7,1,870
set matrix height 1,7,2,880
set matrix height 1,7,3,950
set matrix height 1,7,4,930
set matrix height 1,7,5,910
set matrix height 1,7,6,890

set matrix height 1,8,0,870
set matrix height 1,8,1,870
set matrix height 1,8,2,880
set matrix height 1,8,3,950
set matrix height 1,8,4,930
set matrix height 1,8,5,910

set matrix height 1,9,0,870
set matrix height 1,9,1,870
set matrix height 1,9,2,880
set matrix height 1,9,3,950
set matrix height 1,9,4,930
set matrix height 1,9,5,910

set matrix height 1,10,0,870
set matrix height 1,10,1,870
set matrix height 1,10,2,880
set matrix height 1,10,3,950
set matrix height 1,10,4,930
set matrix height 1,10,5,910

set matrix height 1,11,0,870
set matrix height 1,11,1,870
set matrix height 1,11,2,880
set matrix height 1,11,3,950
set matrix height 1,11,4,930
set matrix height 1,11,5,910

set matrix height 1,12,0,870
set matrix height 1,12,1,870
set matrix height 1,12,2,880
set matrix height 1,12,3,950
set matrix height 1,12,4,930
set matrix height 1,12,5,910

set matrix height 1,13,0,870
set matrix height 1,13,1,870
set matrix height 1,13,2,880
set matrix height 1,13,3,950
set matrix height 1,13,4,930
set matrix height 1,13,5,910

set matrix height 1,14,0,870
set matrix height 1,14,1,870
set matrix height 1,14,2,880
set matrix height 1,14,3,950
set matrix height 1,14,4,930
set matrix height 1,14,5,910

set matrix height 1,15,0,870
set matrix height 1,15,1,870
set matrix height 1,15,2,880
set matrix height 1,15,3,950
set matrix height 1,15,4,930
set matrix height 1,15,5,910

set matrix height 1,16,0,870
set matrix height 1,16,1,870
set matrix height 1,16,2,880
set matrix height 1,16,3,950
set matrix height 1,16,4,930

set matrix height 1,17,0,870
set matrix height 1,17,1,870
set matrix height 1,17,2,880
set matrix height 1,17,3,950

set matrix height 1,18,0,870
set matrix height 1,18,1,870
set matrix height 1,18,2,880

set matrix height 1,19,0,870
set matrix height 1,19,1,880

set matrix height 1,18,0,870
set matrix height 1,18,1,880

set matrix height 1,19,0,870
set matrix height 1,19,1,880

set matrix height 1,20,0,910
set matrix height 1,20,1,920
set matrix height 1,20,2,930

set matrix height 1,21,0,930
set matrix height 1,21,1,920
set matrix height 1,21,2,910

set matrix height 1,22,0,900
set matrix height 1,22,1,920
set matrix height 1,22,2,910

set matrix height 1,23,0,880
set matrix height 1,23,1,960
set matrix height 1,23,2,940

set matrix height 1,24,0,870
set matrix height 1,24,1,880
set matrix height 1,24,2,890

set matrix height 1,25,0,910
set matrix height 1,25,1,890
set matrix height 1,25,2,900

set matrix height 1,26,0,930
set matrix height 1,26,1,920
set matrix height 1,26,2,910
set matrix height 1,26,3,920

set matrix height 1,27,0,910
set matrix height 1,27,1,890
set matrix height 1,27,2,900

set matrix height 1,28,0,900
set matrix height 1,28,1,910
set matrix height 1,28,2,930
set matrix height 1,28,3,850

set matrix height 1,29,0,930
set matrix height 1,29,1,900
set matrix height 1,29,2,890

set matrix height 1,30,0,910
set matrix height 1,30,1,900
set matrix height 1,30,2,890
set matrix height 1,30,3,900

set matrix height 1,31,0,870
set matrix height 1,31,1,920
set matrix height 1,31,2,910

set matrix height 1,32,0,910
set matrix height 1,32,1,920

set matrix height 1,33,0,920
set matrix height 1,33,1,880

set matrix height 1,34,0,960

set matrix height 1,35,0,900

set matrix height 1,36,0,960

set matrix height 1,37,0,920
set matrix height 1,37,1,880

set matrix height 1,38,0,910
set matrix height 1,38,1,920

set matrix height 1,39,0,870
set matrix height 1,39,1,920
set matrix height 1,39,2,910

set matrix height 1,40,0,910
set matrix height 1,40,1,900
set matrix height 1,40,2,890
set matrix height 1,40,3,900

set matrix height 1,41,0,930
set matrix height 1,41,1,900
set matrix height 1,41,2,890

set matrix height 1,42,0,900
set matrix height 1,42,1,910
set matrix height 1,42,2,930
set matrix height 1,42,3,850

set matrix height 1,43,0,910
set matrix height 1,43,1,890
set matrix height 1,43,2,900

set matrix height 1,44,0,930
set matrix height 1,44,1,920
set matrix height 1,44,2,910
set matrix height 1,44,3,920

set matrix height 1,45,0,910
set matrix height 1,45,1,890
set matrix height 1,45,2,900

set matrix height 1,46,0,870
set matrix height 1,46,1,880
set matrix height 1,46,2,890

set matrix height 1,47,0,880
set matrix height 1,47,1,960
set matrix height 1,47,2,940

set matrix height 1,48,0,900
set matrix height 1,48,1,920
set matrix height 1,48,2,910

set matrix height 1,49,0,930
set matrix height 1,49,1,920
set matrix height 1,49,2,910

set matrix height 1,50,0,910
set matrix height 1,50,1,920
set matrix height 1,50,2,930

set matrix height 1,51,0,870
set matrix height 1,51,1,880

set matrix height 1,52,0,870
set matrix height 1,52,1,870
set matrix height 1,52,2,880

set matrix height 1,53,0,870
set matrix height 1,53,1,870
set matrix height 1,53,2,880

set matrix height 1,54,0,870
set matrix height 1,54,1,870
set matrix height 1,54,2,880
set matrix height 1,54,3,950
set matrix height 1,54,4,930

set matrix height 1,55,0,870
set matrix height 1,55,1,870
set matrix height 1,55,2,880
set matrix height 1,55,3,950
set matrix height 1,55,4,930
set matrix height 1,55,5,910

set matrix height 1,56,0,870
set matrix height 1,56,1,870
set matrix height 1,56,2,880
set matrix height 1,56,3,950
set matrix height 1,56,4,930
set matrix height 1,56,5,910

set matrix height 1,57,0,870
set matrix height 1,57,1,870
set matrix height 1,57,2,880
set matrix height 1,57,3,950
set matrix height 1,57,4,930
set matrix height 1,57,5,910

set matrix height 1,58,0,870
set matrix height 1,58,1,870
set matrix height 1,58,2,880
set matrix height 1,58,3,950
set matrix height 1,58,4,930
set matrix height 1,58,5,910

set matrix height 1,59,0,870
set matrix height 1,59,1,870
set matrix height 1,59,2,880
set matrix height 1,59,3,950
set matrix height 1,59,4,930
set matrix height 1,59,5,910

set matrix height 1,60,0,870
set matrix height 1,60,1,870
set matrix height 1,60,2,880
set matrix height 1,60,3,950
set matrix height 1,60,4,930
set matrix height 1,60,5,910

set matrix height 1,61,0,870
set matrix height 1,61,1,870
set matrix height 1,61,2,880
set matrix height 1,61,3,950
set matrix height 1,61,4,930
set matrix height 1,61,5,910

set matrix height 1,62,0,870
set matrix height 1,62,1,870
set matrix height 1,62,2,880
set matrix height 1,62,3,950
set matrix height 1,62,4,930
set matrix height 1,62,5,910

set matrix height 1,63,0,870
set matrix height 1,63,1,870
set matrix height 1,63,2,880
set matrix height 1,63,3,950
set matrix height 1,63,4,930
set matrix height 1,63,5,910
set matrix height 1,63,6,890

set matrix height 1,64,0,870
set matrix height 1,64,1,870
set matrix height 1,64,2,880
set matrix height 1,64,3,950
set matrix height 1,64,4,930
set matrix height 1,64,5,910
set matrix height 1,64,6,890
set matrix height 1,64,7,850

set matrix height 1,65,0,870
set matrix height 1,65,1,870
set matrix height 1,65,2,880
set matrix height 1,65,3,950
set matrix height 1,65,4,930
set matrix height 1,65,5,910
set matrix height 1,65,6,890
set matrix height 1,65,7,850
set matrix height 1,65,8,880

set matrix height 1,66,0,870
set matrix height 1,66,1,870
set matrix height 1,66,2,880
set matrix height 1,66,3,950
set matrix height 1,66,4,930
set matrix height 1,66,5,910
set matrix height 1,66,6,890
set matrix height 1,66,7,850
set matrix height 1,66,8,880
set matrix height 1,66,9,910

set matrix height 1,67,0,870
set matrix height 1,67,1,870
set matrix height 1,67,2,880
set matrix height 1,67,3,950
set matrix height 1,67,4,930
set matrix height 1,67,5,910
set matrix height 1,67,6,890
set matrix height 1,67,7,850
set matrix height 1,67,8,880
set matrix height 1,67,9,910
set matrix height 1,67,10,980

set matrix height 1,68,0,870
set matrix height 1,68,1,870
set matrix height 1,68,2,880
set matrix height 1,68,3,950
set matrix height 1,68,4,930
set matrix height 1,68,5,910
set matrix height 1,68,6,890
set matrix height 1,68,7,850
set matrix height 1,68,8,880
set matrix height 1,68,9,910
set matrix height 1,68,10,980
set matrix height 1,68,11,940

set matrix height 1,69,0,870
set matrix height 1,69,1,870
set matrix height 1,69,2,880
set matrix height 1,69,3,950
set matrix height 1,69,4,930
set matrix height 1,69,5,910
set matrix height 1,69,6,890
set matrix height 1,69,7,850
set matrix height 1,69,8,880
set matrix height 1,69,9,910
set matrix height 1,69,10,980
set matrix height 1,69,11,940
set matrix height 1,69,12,910

set matrix height 1,70,0,870
set matrix height 1,70,1,870
set matrix height 1,70,2,880
set matrix height 1,70,3,950
set matrix height 1,70,4,930
set matrix height 1,70,5,910
set matrix height 1,70,6,890
set matrix height 1,70,7,850
set matrix height 1,70,8,880
set matrix height 1,70,9,910
set matrix height 1,70,10,980
set matrix height 1,70,11,940
set matrix height 1,70,12,910
set matrix height 1,70,13,950

rem Side mountains
for t=13 to 70
xm#=rnd(6)
if xm#=0
set matrix height 1,xm#,t,rnd(100)+800
endif
if xm#=1
set matrix height 1,xm#,t,rnd(100)+800
set matrix height 1,xm#-1,t,rnd(100)+800
endif
if xm#=2
set matrix height 1,xm#,t,rnd(100)+800
set matrix height 1,xm#-1,t,rnd(100)+800
set matrix height 1,xm#-2,t,rnd(100)+800
endif
if xm#=3
set matrix height 1,xm#,t,rnd(100)+800
set matrix height 1,xm#-1,t,rnd(100)+800
set matrix height 1,xm#-2,t,rnd(100)+800
set matrix height 1,xm#-3,t,rnd(100)+800
endif
if xm#=4
set matrix height 1,xm#,t,rnd(100)+800
set matrix height 1,xm#-1,t,rnd(100)+800
set matrix height 1,xm#-2,t,rnd(100)+800
set matrix height 1,xm#-3,t,rnd(100)+800
set matrix height 1,xm#-4,t,rnd(100)+800
endif
if xm#=5
set matrix height 1,xm#,t,rnd(100)+800
set matrix height 1,xm#-1,t,rnd(100)+800
set matrix height 1,xm#-2,t,rnd(100)+800
set matrix height 1,xm#-3,t,rnd(100)+800
set matrix height 1,xm#-4,t,rnd(100)+800
set matrix height 1,xm#-5,t,rnd(100)+800
endif
if xm#=6
set matrix height 1,xm#,t,rnd(100)+800
set matrix height 1,xm#-1,t,rnd(100)+800
set matrix height 1,xm#-2,t,rnd(100)+800
set matrix height 1,xm#-3,t,rnd(100)+800
set matrix height 1,xm#-4,t,rnd(100)+800
set matrix height 1,xm#-5,t,rnd(100)+800
set matrix height 1,xm#-6,t,rnd(100)+800
endif
next t

for t=13 to 70
xm#=rnd(6)
if xm#=0
set matrix height 1,xm#+70,t,rnd(100)+800
endif
if xm#=1
set matrix height 1,xm#+69,t,rnd(100)+800
set matrix height 1,xm#+68,t,rnd(100)+800
endif
if xm#=2
set matrix height 1,xm#+68,t,rnd(100)+800
set matrix height 1,xm#+67,t,rnd(100)+800
set matrix height 1,xm#+66,t,rnd(100)+800
endif
if xm#=3
set matrix height 1,xm#+67,t,rnd(100)+800
set matrix height 1,xm#+66,t,rnd(100)+800
set matrix height 1,xm#+65,t,rnd(100)+800
set matrix height 1,xm#+64,t,rnd(100)+800
endif
if xm#=4
set matrix height 1,xm#+66,t,rnd(100)+800
set matrix height 1,xm#+65,t,rnd(100)+800
set matrix height 1,xm#+64,t,rnd(100)+800
set matrix height 1,xm#+63,t,rnd(100)+800
set matrix height 1,xm#+62,t,rnd(100)+800
endif
if xm#=5
set matrix height 1,xm#+65,t,rnd(100)+800
set matrix height 1,xm#+64,t,rnd(100)+800
set matrix height 1,xm#+63,t,rnd(100)+800
set matrix height 1,xm#+62,t,rnd(100)+800
set matrix height 1,xm#+61,t,rnd(100)+800
set matrix height 1,xm#+60,t,rnd(100)+800
endif
if xm#=6
set matrix height 1,xm#+64,t,rnd(100)+800
set matrix height 1,xm#+63,t,rnd(100)+800
set matrix height 1,xm#+62,t,rnd(100)+800
set matrix height 1,xm#+61,t,rnd(100)+800
set matrix height 1,xm#+60,t,rnd(100)+800
set matrix height 1,xm#+59,t,rnd(100)+800
set matrix height 1,xm#+58,t,rnd(100)+800
endif
next t

rem River
for t=30 to 40
set matrix height 1,t,5,-1500
set matrix height 1,t,6,-1500
set matrix height 1,t,7,-1500
set matrix height 1,t,8,-1500
set matrix height 1,t,9,-1500
set matrix height 1,t,10,-1500
set matrix height 1,t,11,-1500
set matrix height 1,t,12,-1500
set matrix height 1,t,15,-1500
next t

rem Make river round
set matrix height 1,30,5,1
set matrix height 1,31,5,1
set matrix height 1,32,5,1
set matrix height 1,30,6,1
set matrix height 1,30,7,1
set matrix height 1,30,12,1
set matrix height 1,30,13,1
set matrix height 1,30,14,1
set matrix height 1,30,15,1
set matrix height 1,31,14,1
set matrix height 1,32,15,1
set matrix height 1,33,15,1
set matrix height 1,34,15,1
set matrix height 1,39,15,1
set matrix height 1,40,15,1
set matrix height 1,40,14,1
set matrix height 1,40,12,1
set matrix height 1,40,2,1
set matrix height 1,40,1,1
set matrix height 1,40,0,1
set matrix height 1,39,0,1
set matrix height 1,35,15,1
set matrix height 1,37,15,1
set matrix height 1,38,15,1
set matrix height 1,39,15,1
set matrix height 1,40,15,1
set matrix height 1,30,15,1
set matrix height 1,31,15,1

rem Set river grounds a bit higher than some places
set matrix height 1,32,5,rnd(200)-1500
set matrix height 1,32,6,rnd(200)-1500
set matrix height 1,31,6,rnd(200)-1500
set matrix height 1,31,7,rnd(200)-1500
set matrix height 1,30,7,rnd(200)-1500
set matrix height 1,30,8,rnd(200)-1500
set matrix height 1,30,9,rnd(200)-1500
set matrix height 1,30,10,rnd(200)-1500
set matrix height 1,30,11,rnd(200)-1500
set matrix height 1,30,12,rnd(200)-1500

rem Make the river be shallow to deep
set matrix height 1,32,5,-100
set matrix height 1,33,5,-120
set matrix height 1,34,5,-110
set matrix height 1,35,5,-90
set matrix height 1,36,5,-95
set matrix height 1,37,5,-90
set matrix height 1,38,5,-100
set matrix height 1,39,5,-90
set matrix height 1,40,5,-120
set matrix height 1,40,6,-110
set matrix height 1,40,7,-115
set matrix height 1,40,8,-90
set matrix height 1,40,9,-100
set matrix height 1,40,10,-110
set matrix height 1,40,11,-95
set matrix height 1,40,12,-85
set matrix height 1,40,13,-120
set matrix height 1,40,14,-110
set matrix height 1,40,15,-100
set matrix height 1,39,15,-110
set matrix height 1,38,15,-90
set matrix height 1,37,15,-96
set matrix height 1,36,15,-85
set matrix height 1,35,15,-120
set matrix height 1,34,15,-110
set matrix height 1,33,15,-90
set matrix height 1,32,15,-85
set matrix height 1,31,15,-80
set matrix height 1,39,12,-80
set matrix height 1,38,12,-85
set matrix height 1,37,12,-96
set matrix height 1,36,12,-90
set matrix height 1,35,12,-110
set matrix height 1,34,12,-120
set matrix height 1,33,12,-85
set matrix height 1,32,12,-90
set matrix height 1,31,12,-110
set matrix height 1,30,12,-100
set matrix height 1,30,11,-90
set matrix height 1,30,10,-120
set matrix height 1,30,9,-110
set matrix height 1,30,8,-80
set matrix height 1,30,7,-100
set matrix height 1,30,6,-115
set matrix height 1,31,6,-185
set matrix height 1,32,6,-195
set matrix height 1,33,6,-220
set matrix height 1,34,6,-180
set matrix height 1,35,6,-200
set matrix height 1,36,6,-220
set matrix height 1,37,6,-180
set matrix height 1,38,6,-195
set matrix height 1,39,6,-180
set matrix height 1,31,6,-185
set matrix height 1,32,6,-195
set matrix height 1,33,6,-220
set matrix height 1,34,6,-180
set matrix height 1,35,6,-200
set matrix height 1,36,6,-220
set matrix height 1,37,6,-180
set matrix height 1,38,6,-195
set matrix height 1,39,7,-200
set matrix height 1,39,8,-220
set matrix height 1,39,9,-180
set matrix height 1,39,10,-190
set matrix height 1,39,11,-185
set matrix height 1,39,12,-180
set matrix height 1,39,13,-220
set matrix height 1,39,11,-310
set matrix height 1,38,11,-280
set matrix height 1,37,11,-290
set matrix height 1,36,11,-285
set matrix height 1,35,11,-310
set matrix height 1,34,11,-320
set matrix height 1,33,11,-305
set matrix height 1,32,11,-300
set matrix height 1,31,11,-280
set matrix height 1,31,10,-320
set matrix height 1,31,9,-300
set matrix height 1,31,8,-285
set matrix height 1,31,7,-295
set matrix height 1,32,7,-495
set matrix height 1,33,7,-500
set matrix height 1,34,7,-520
set matrix height 1,35,7,-505
set matrix height 1,36,7,-495
set matrix height 1,37,7,-485
set matrix height 1,38,7,-515
set matrix height 1,38,8,-505
set matrix height 1,38,9,-525
set matrix height 1,38,10,-485
set matrix height 1,38,11,-495
set matrix height 1,38,12,-515
set matrix height 1,37,7,-615
set matrix height 1,37,8,-505
set matrix height 1,37,9,-525
set matrix height 1,37,10,-485
set matrix height 1,37,11,-495
set matrix height 1,37,12,-515
set matrix height 1,36,7,-715
set matrix height 1,36,8,-505
set matrix height 1,36,9,-525
set matrix height 1,36,10,-485
set matrix height 1,36,11,-495
set matrix height 1,36,12,-515
set matrix height 1,35,10,-500
set matrix height 1,34,10,-495
set matrix height 1,33,10,-485
set matrix height 1,32,10,-500
set matrix height 1,32,9,-580
set matrix height 1,32,8,-600
set matrix height 1,33,8,-620
set matrix height 1,34,8,-640
set matrix height 1,35,8,-680
set matrix height 1,36,8,-700
set matrix height 1,33,8,-900
set matrix height 1,33,9,-920
set matrix height 1,34,8,-880
set matrix height 1,34,9,-905
set matrix height 1,35,9,-910

rem Update matrix
update matrix 1

rem Make the character
make object cube 1,50
hide object 1

rem Starting variables
position object 1,5000,300,500
x#=5000
y#=300
z#=500
x2#=5000
z2#=500
position camera 5000,100,10000

rem stop the player from being able to jump until there is a collision
playergrav(1)=1

rem Make collision boxes
set_collision(1,1,65535)

rem Do loop
do

rem Walk and run toggle
if shiftkey()=1 then walk=1 else walk=0

rem Control Player
if die#=0
if playergrav(1)=0
if swim#=0
if walk=0
stage=0 : gunlag#=5.0
if keystate(200)=1 or keystate(17)=1
x#=newxvalue(x#,cya#,10.0) : z#=newzvalue(z#,cya#,10.0)
gunlag#=1.3
stage=1
if air1#-50 then gamma#=0 : set gamma 225,225,225 : fog on : fog color rgb(0,50,0) : fog distance 50000
if swim#=1
rotate object 1,wrapvalue(cxa#),wrapvalue(cya#),0
playergrav(1)=0
if keystate(17)=1
if air1#0 then dec air1#,1
endif
if keystate(31)=1
if air2#0 then dec air2#,1
endif
if air1#>0 then move object 1,air1#
if air2#>0 then move object 1,0-air2#
x#=object position x(1)
z#=object position z(1)
y#=object position y(1)
endif

if playergrav(1)=1 and swim#=0
if air1#>0 then x#=newxvalue(x#,aircya#,air1#) : z#=newzvalue(z#,aircya#,air1#)
if air2#>0 then x#=newxvalue(x#,aircya#,0-air2#) : z#=newzvalue(z#,aircya#,0-air2#)
if air3#>0 then x#=newxvalue(x#,aircya#-90,air3#) : z#=newzvalue(z#,aircya#-90,air3#)
if air4#>0 then x#=newxvalue(x#,aircya#+90,air4#) : z#=newzvalue(z#,aircya#+90,air4#)
endif

if playergrav(1)=0 and swim#=0
if keystate(17)=0 and air1#>0 then dec air1#,2
if keystate(31)=0 and air2#>0 then dec air2#,2
if keystate(30)=0 and air3#>0 then dec air3#,1.5
if keystate(32)=0 and air4#>0 then dec air4#,1.5
endif
endif

rem Walk woddle height
if stage=1
walkha#=wrapvalue(walkha#+16.0)
else
walkha#=curveangle(0.0,walkha#,5.0)
endif
walkh#=(cos(walkha#)*4.5)

rem Ensure player stays on floor
fx#=0 : fz#=0
for r=0 to 35
ex#=newxvalue(x#,r*10,15)
ez#=newzvalue(z#,r*10,15)
eh#=get ground height(1,ex#+mx#,ez#+mz#) + get ground height(3,ex#+mx#,ez#+mz#)
if eh#90.0 then cxa#=90.0
x2#=curvevalue(x#,x2#,2)
y2#=curvevalue(y#,y2#,2)
z2#=curvevalue(z#,z2#,2)
if playergrav(1)=0 then aircya#=cya#
if swim#=0 then position camera x2#,y2#+50+walkh#,z2#
if swim#=1 then position camera object position x(1),object position y(1)+50+walkh#,object position z(1)
rotate camera wrapvalue(cxa#),wrapvalue(cya#),0

rem Apply decay to gravity
if swim#=0 and gravity#0
x#=x#-get object collision x()
z#=z#-get object collision z()

`set player gravity off
playergrav(id)=1
endif
endif

`subtract step size
if grav=0
y#=y#-step_size#
endif

`reposition
position object object_id,x#,y#,z#

`y collision
if object collision(object_id,0)>0
y#=y#-get object collision y()

rem Reset player gravity
playergrav(id)=0
endif

rem Matrix height stuff
matrixheight#=get ground height(1,x#-matrix position x(1),z#-matrix position z(1))+(object size x(id)/2)+matrix position y(1)
matrixheight#=matrixheight#+get ground height(3,x#-matrix position x(1),z#-matrix position z(1))+(object size x(id)/2)+matrix position y(1)
if y#0 then playergrav(1)=0

`smooth the y climbing
y#=curvevalue(y#,oldy#,1)
position object object_id,x#,y#,z#

endfunction
Chiwawa
22
Years of Service
User Offline
Joined: 13th Oct 2002
Location: Canada
Posted: 26th Mar 2003 00:23
hope you did not write the "set matrix" manuelly :-s
you should use....array and loop.....

..and i dont have time to check the code.....sorry for your question..
Xoid
22
Years of Service
User Offline
Joined: 8th Mar 2003
Location:
Posted: 26th Mar 2003 14:24 Edited at: 26th Mar 2003 14:24
dude, how do you expect people to help you, none really wants to scan through all that, well... I wouldn't for FREE that is, if you paid me then that'll be different

as Chiwawa suggests, use arrays and loops it'll be alot easier to read and MUCH shorter
Freezer
22
Years of Service
User Offline
Joined: 12th Nov 2002
Location:
Posted: 26th Mar 2003 23:25
Yes i have Written the most of yes! But Why i have done so. Is for the world. Al small up and down hills. and water..

cusoi
22
Years of Service
User Offline
Joined: 3rd Jan 2003
Location: Netherlands
Posted: 26th Mar 2003 23:34
Yeah, but you should write a matrix height edit program that saves your matrix to a file, and then reading it.

Pentium IV 2.4 GHZ 256 MB Ram Geforce 4 TI 4200 128 MB
www.cuso.tk
Joe Cooning
22
Years of Service
User Offline
Joined: 29th Mar 2003
Location: United States
Posted: 30th Mar 2003 06:41
If you need help, don't show the WHOLE DANG PROGRAM!!! Just show the part you need help with. :-s

"Everyone has a photographic memory . . . some just don't have film."
xmen
22
Years of Service
User Offline
Joined: 27th Jan 2003
Location:
Posted: 30th Mar 2003 14:48
Look tell me what you want and I will make a world editor for you

or a Matrix editor or i can help you make one
Shadow Robert
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 30th Mar 2003 15:22
he wants to know why the second matrix won't texture and somehow i don't think he knows which part that is ...

personally i'd use the
'prepare matrix texture' with the
'fill matrix' command

Tsu'va Oni Ni Jyuuko Fiori Sei Tau!
One block follows the suit ... the whole suit of blocks is the path ... what have you found?
Freezer
22
Years of Service
User Offline
Joined: 12th Nov 2002
Location:
Posted: 30th Mar 2003 22:08
Raven: I don´t think that you should say anything if you don´t know something! Which you don´t so i suggest **** UP. I am in a bad "mode".
xmen: Was trying to create an RPG Matrix with Good looking Water. And smooth hills. Ca nyou do that for me?

John H
Retired Moderator
22
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 31st Mar 2003 01:39
I think Raven knows a lot more than you do. And hes right. You need to make your matrix, and use Prepare matrix texture.

RPGamer

Current - RPG: Eternal Destiny
http://www.halbrosproductions.netfirms.com
Dont ask those questions! Read the help files lazy! Oh ya, and Tat has a plugin for that!
Chiwawa
22
Years of Service
User Offline
Joined: 13th Oct 2002
Location: Canada
Posted: 31st Mar 2003 01:46 Edited at: 31st Mar 2003 01:46
tut tut tut... no discusting...i know more than everyone of you
Freezer
22
Years of Service
User Offline
Joined: 12th Nov 2002
Location:
Posted: 31st Mar 2003 12:44
RPGamer: I did´t meen that he know more coding than me. That he probabely does. But what i ment was That he said that i don´t know what part of MY matrix that i talk about.
Yes i know what part of the Matrix i talk about but he can´t obious see what part it is.
What i ment is this:
rem Make river round
set matrix height 1,30,5,1
set matrix height 1,31,5,1
set matrix height 1,32,5,1
set matrix height 1,30,6,1
set matrix height 1,30,7,1
set matrix height 1,30,12,1
set matrix height 1,30,13,1
set matrix height 1,30,14,1
set matrix height 1,30,15,1
set matrix height 1,31,14,1
set matrix height 1,32,15,1
set matrix height 1,33,15,1
set matrix height 1,34,15,1
set matrix height 1,39,15,1
set matrix height 1,40,15,1
set matrix height 1,40,14,1
set matrix height 1,40,12,1
set matrix height 1,40,2,1
set matrix height 1,40,1,1
set matrix height 1,40,0,1
set matrix height 1,39,0,1
set matrix height 1,35,15,1
set matrix height 1,37,15,1
set matrix height 1,38,15,1
set matrix height 1,39,15,1
set matrix height 1,40,15,1
set matrix height 1,30,15,1
set matrix height 1,31,15,1

rem Set river grounds a bit higher than some places
set matrix height 1,32,5,rnd(200)-1500
set matrix height 1,32,6,rnd(200)-1500
set matrix height 1,31,6,rnd(200)-1500
set matrix height 1,31,7,rnd(200)-1500
set matrix height 1,30,7,rnd(200)-1500
set matrix height 1,30,8,rnd(200)-1500
set matrix height 1,30,9,rnd(200)-1500
set matrix height 1,30,10,rnd(200)-1500
set matrix height 1,30,11,rnd(200)-1500
set matrix height 1,30,12,rnd(200)-1500

rem Make the river be shallow to deep
set matrix height 1,32,5,-100
set matrix height 1,33,5,-120
set matrix height 1,34,5,-110
set matrix height 1,35,5,-90
set matrix height 1,36,5,-95
set matrix height 1,37,5,-90
set matrix height 1,38,5,-100
set matrix height 1,39,5,-90
set matrix height 1,40,5,-120
set matrix height 1,40,6,-110
set matrix height 1,40,7,-115
set matrix height 1,40,8,-90
set matrix height 1,40,9,-100
set matrix height 1,40,10,-110
set matrix height 1,40,11,-95
set matrix height 1,40,12,-85
set matrix height 1,40,13,-120
set matrix height 1,40,14,-110
set matrix height 1,40,15,-100
set matrix height 1,39,15,-110
set matrix height 1,38,15,-90
set matrix height 1,37,15,-96
set matrix height 1,36,15,-85
set matrix height 1,35,15,-120
set matrix height 1,34,15,-110
set matrix height 1,33,15,-90
set matrix height 1,32,15,-85
set matrix height 1,31,15,-80
set matrix height 1,39,12,-80
set matrix height 1,38,12,-85
set matrix height 1,37,12,-96
set matrix height 1,36,12,-90
set matrix height 1,35,12,-110
set matrix height 1,34,12,-120
set matrix height 1,33,12,-85
set matrix height 1,32,12,-90
set matrix height 1,31,12,-110
set matrix height 1,30,12,-100
set matrix height 1,30,11,-90
set matrix height 1,30,10,-120
set matrix height 1,30,9,-110
set matrix height 1,30,8,-80
set matrix height 1,30,7,-100
set matrix height 1,30,6,-115
set matrix height 1,31,6,-185
set matrix height 1,32,6,-195
set matrix height 1,33,6,-220
set matrix height 1,34,6,-180
set matrix height 1,35,6,-200
set matrix height 1,36,6,-220
set matrix height 1,37,6,-180
set matrix height 1,38,6,-195
set matrix height 1,39,6,-180
set matrix height 1,31,6,-185
set matrix height 1,32,6,-195
set matrix height 1,33,6,-220
set matrix height 1,34,6,-180
set matrix height 1,35,6,-200
set matrix height 1,36,6,-220
set matrix height 1,37,6,-180
set matrix height 1,38,6,-195
set matrix height 1,39,7,-200
set matrix height 1,39,8,-220
set matrix height 1,39,9,-180
set matrix height 1,39,10,-190
set matrix height 1,39,11,-185
set matrix height 1,39,12,-180
set matrix height 1,39,13,-220
set matrix height 1,39,11,-310
set matrix height 1,38,11,-280
set matrix height 1,37,11,-290
set matrix height 1,36,11,-285
set matrix height 1,35,11,-310
set matrix height 1,34,11,-320
set matrix height 1,33,11,-305
set matrix height 1,32,11,-300
set matrix height 1,31,11,-280
set matrix height 1,31,10,-320
set matrix height 1,31,9,-300
set matrix height 1,31,8,-285
set matrix height 1,31,7,-295
set matrix height 1,32,7,-495
set matrix height 1,33,7,-500
set matrix height 1,34,7,-520
set matrix height 1,35,7,-505
set matrix height 1,36,7,-495
set matrix height 1,37,7,-485
set matrix height 1,38,7,-515
set matrix height 1,38,8,-505
set matrix height 1,38,9,-525
set matrix height 1,38,10,-485
set matrix height 1,38,11,-495
set matrix height 1,38,12,-515
set matrix height 1,37,7,-615
set matrix height 1,37,8,-505
set matrix height 1,37,9,-525
set matrix height 1,37,10,-485
set matrix height 1,37,11,-495
set matrix height 1,37,12,-515
set matrix height 1,36,7,-715
set matrix height 1,36,8,-505
set matrix height 1,36,9,-525
set matrix height 1,36,10,-485
set matrix height 1,36,11,-495
set matrix height 1,36,12,-515
set matrix height 1,35,10,-500
set matrix height 1,34,10,-495
set matrix height 1,33,10,-485
set matrix height 1,32,10,-500
set matrix height 1,32,9,-580
set matrix height 1,32,8,-600
set matrix height 1,33,8,-620
set matrix height 1,34,8,-640
set matrix height 1,35,8,-680
set matrix height 1,36,8,-700
set matrix height 1,33,8,-900
set matrix height 1,33,9,-920
set matrix height 1,34,8,-880
set matrix height 1,34,9,-905
set matrix height 1,35,9,-910

That code wasn´t so hard but who to texture it. Thats hard couse i´ve used as you all se the hard way around coding. But i will do as you say. To make it More easy. But if writes that i don´t know what part of my own matrix i talk about then i can say he has a BIG wrong!

Freezer

Shadow Robert
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 1st Apr 2003 02:55 Edited at: 1st Apr 2003 02:57
look firstly... i said everyone else isn't sure what you want, secondly the question you asked was "why doesn't the water matrix texture!"

and as i've noted this has nothing to do with the matrix position and height or editing - this has just got to do with how you're going about applying the texture. At which i think you'll find that what i've posted will actually mean that the matrix will be textured fine now.

That aside if you wish to create water then use a small algorithm which changes the matrices height mathematically rather than manually.

Tsu'va Oni Ni Jyuuko Fiori Sei Tau!
One block follows the suit ... the whole suit of blocks is the path ... what have you found?
John H
Retired Moderator
22
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 1st Apr 2003 05:24
^^Ditto^^

And O PLEASE use an agrothim So much better speed, and code

Current - RPG: Eternal Destiny
http://www.halbrosproductions.netfirms.com
Dont ask those questions! Read the help files lazy! Oh ya, and Tat has a plugin for that!

Login to post a reply

Server time is: 2025-05-16 19:54:05
Your offset time is: 2025-05-16 19:54:05