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.

Newcomers DBPro Corner / kul begining but wont work?

Author
Message
gothboy 101
20
Years of Service
User Offline
Joined: 31st May 2004
Location: Watonga, ok, usa
Posted: 5th Aug 2004 11:39
as i said its a cool begining thing but it wont close the nest line a line 193?

Rem Project: Midtime
Rem Created: 8/4/2004 8:13:31 PM

Rem ***** Main Source File *****
sync on
sync rate 0
backdrop on
color backdrop 0
scrolly$=" A DRAGONSEIGE PRODUCTION "
scrlsize=len(scrolly$)
scrlpos=1
maxchar=20
width=9.9
height=19
startpoint=200
endpoint=1
speed=1
dim xpos(600)
spacing=startpoint/maxchar
set text font "tahoma"
set text size 128

for j = 1 to 60
cls 0
center text 64,32,chr$(j+31)
get image j,0,0,128,128
next j

hide mouse
sync on
sync rate 0
backdrop on
color backdrop rgb(0,0,0)
set image colorkey 0,0,0

for char=1 to maxchar
make object cube char,width
make object cube 100+char,width
make object cube 200+char,width
make object cube 300+char,width
make object cube 400+char,width
make object cube 500+char,width
ghost object on char,0
ghost object on 100+char,0
ghost object on 200+char,0
ghost object on 300+char,0
ghost object on 400+char,0
ghost object on 500+char,0
xpos(char)=char*spacing
texture object char,1
texture object 100+char,1
texture object 200+char,1
texture object 300+char,1
texture object 400+char,1
texture object 500+char,1
set object transparency char,1
set object transparency 100+char,1
set object transparency 200+char,1
set object transparency 300+char,1
set object transparency 400+char,1
set object transparency 500+char,1
next char
position camera startpoint/2,0,-80
point camera startpoint/2,0,0

do

for char=1 to maxchar
if scrlpos=scrlsize
scrlpos=1
endif

if xpos(char)<endpoint
xpos(char)=startpoint
a$=mid$(scrolly$,scrlpos)
a=asc(a$)-31
texture object char,a
texture object 100+char,a
texture object 200+char,a
texture object 300+char,a
texture object 400+char,a
texture object 500+char,a
inc scrlpos,1
endif

xpos(char)=xpos(char)-speed
position object char,xpos(char),0,0
position object 100+char,xpos(char),0,-20
position object 200+char,xpos(char),xpos(char),xpos(char)
position object 300+char,xpos(char),0-xpos(char),xpos(char)
position object 400+char,50+xpos(char),xpos(char)-20,xpos(char)-20
position object 500+char,50+xpos(char),(0-xpos(char))+20,xpos(char)-20
next char
wait 5000
a = 255
b = 100
c = 100
choice = 1
leftkeypressed = 0
rightkeypressed = 0
`-------------------- Select screen -------------------------------
do

`if key e pressed
if keystate(18) = 1
if keypressed = 0
choice = 3
endif
endif
`if key l pressed
if keystate(38) = 1
if keypressed = 0
choice = 2
endif
endif
`if key n is pressed
if keystate(49) = 1
if keypressed = 0
choice = 1
endif
endif
`cycle through next option and update choice
if rightkey() = 1
if keypressed = 0
inc choice, 1
if choice > 3 then choice = 1
endif
else
leftkeypressed = 0
endif

`cycle through previous option and update choice
if leftkey() = 1
if keypressed = 0
dec choice, 1
if choice < 1 then choice = 3
endif
else
rightkeypressed = 0
endif

`set colors for print options
select choice
case 1 : a = 255 : b = 100 : c = 100 : selected$ = "new game highlighted" : endcase
case 2 : a = 100 : b = 255 : c = 100 : selected$ = "load game highlighted" : endcase
case 3 : a = 100 : b = 100 : c = 255 : selected$ = "exit game highlighted" : endcase
case default : a = a : b = b : c = c : selected$ = selected$ : endcase
endselect

`pressing enter prints the selected option
if keystate(28) = 1
if choice = 3 then end
selected$ = "exit was selected"

endif
if choice = 2
if keystate(38) = 1
filename$ = "currentsave.save"
if File Exist(filename$)=1
open to read 1,filename$
rem read floats ------
read float 1,savedata1#
read float 1,savedata2#
read float 1,savedata3#
position object 1,savedata1#,savedata2#,savedata3#
close file 1
endif
selected$ = "load game was selected"
endif
endif
selected$ = "load game was selected"
if choice = 1
selected$ = "new game was selected"
endif


`reset keypressed
if scancode() = 0
keypressed = 0
else
keypressed = 1
ink rgb(255,255,255), 0
set cursor 5,5
print selected$
endif

`print options
ink rgb(a,a,a),0 : center text 200, 400, "[N]ew Game"
ink rgb(b,b,b),0 : center text 330, 400, "[L]oad Game"
ink rgb(c,c,c),0 : center text 450, 400, "[E]xit Game"

sync
loop

Dragonseige
GameKit
21
Years of Service
User Offline
Joined: 6th Mar 2003
Location: USA, Staring Blankly at a Computer
Posted: 5th Aug 2004 12:21 Edited at: 5th Aug 2004 12:22
You have two "Do" commands, and only one "Loop". I'm not sure which one is out of place, but they are on lines 63 and 99. Delete one "Do" and your program should work.

Well... I hope I helped

The computer isn't an addiction, its more of a mental and social dependancy.
gothboy 101
20
Years of Service
User Offline
Joined: 31st May 2004
Location: Watonga, ok, usa
Posted: 5th Aug 2004 12:31
thanks

Dragonseige
gothboy 101
20
Years of Service
User Offline
Joined: 31st May 2004
Location: Watonga, ok, usa
Posted: 5th Aug 2004 12:35 Edited at: 5th Aug 2004 12:50
ok thanks but it says than name is not valid cuz its supposed to wait 10 seconds the go to the menu.

Rem Project: Midtime
Rem Created: 8/4/2004 8:13:31 PM

Rem ***** Main Source File *****
sync on
sync rate 0
backdrop on
color backdrop 0
scrolly$=" A DRAGONSEIGE PRODUCTION "
scrlsize=len(scrolly$)
scrlpos=1
maxchar=20
width=9.9
height=19
startpoint=200
endpoint=1
speed=1
dim xpos(600)
spacing=startpoint/maxchar
set text font "tahoma"
set text size 128

for j = 1 to 60
cls 0
center text 64,32,chr$(j+31)
get image j,0,0,128,128
next j

hide mouse
sync on
sync rate 0
backdrop on
color backdrop rgb(0,0,0)
set image colorkey 0,0,0

for char=1 to maxchar
make object cube char,width
make object cube 100+char,width
make object cube 200+char,width
make object cube 300+char,width
make object cube 400+char,width
make object cube 500+char,width
ghost object on char,0
ghost object on 100+char,0
ghost object on 200+char,0
ghost object on 300+char,0
ghost object on 400+char,0
ghost object on 500+char,0
xpos(char)=char*spacing
texture object char,1
texture object 100+char,1
texture object 200+char,1
texture object 300+char,1
texture object 400+char,1
texture object 500+char,1
set object transparency char,1
set object transparency 100+char,1
set object transparency 200+char,1
set object transparency 300+char,1
set object transparency 400+char,1
set object transparency 500+char,1
next char
position camera startpoint/2,0,-80
point camera startpoint/2,0,0


for char=1 to maxchar
if scrlpos=scrlsize
scrlpos=1
endif

if xpos(char)<endpoint
xpos(char)=startpoint
a$=mid$(scrolly$,scrlpos)
a=asc(a$)-31
texture object char,a
texture object 100+char,a
texture object 200+char,a
texture object 300+char,a
texture object 400+char,a
texture object 500+char,a
inc scrlpos,1
endif

xpos(char)=xpos(char)-speed
position object char,xpos(char),0,0
position object 100+char,xpos(char),0,-20
position object 200+char,xpos(char),xpos(char),xpos(char)
position object 300+char,xpos(char),0-xpos(char),xpos(char)
position object 400+char,50+xpos(char),xpos(char)-20,xpos(char)-20
position object 500+char,50+xpos(char),(0-xpos(char))+20,xpos(char)-20
next char
a = 255
b = 100
c = 100
choice = 1
disable escapekey
sync

if escapekey()=1 then goto line 101 or, wait 10000, then
do

`if key e pressed
if keystate(18) = 1
if keypressed = 0
choice = 3
endif
endif
`if key l pressed
if keystate(38) = 1
if keypressed = 0
choice = 2
endif
endif
`if key n is pressed
if keystate(49) = 1
if keypressed = 0
choice = 1
endif
endif
`cycle through next option and update choice
if rightkey() = 1
if keypressed = 0
inc choice, 1
if choice > 3 then choice = 1
endif
else
leftkeypressed = 0
endif

`cycle through previous option and update choice
if leftkey() = 1
if keypressed = 0
dec choice, 1
if choice < 1 then choice = 3
endif
else
rightkeypressed = 0
endif

`set colors for print options
select choice
case 1 : a = 255 : b = 100 : c = 100 : selected$ = "new game highlighted" : endcase
case 2 : a = 100 : b = 255 : c = 100 : selected$ = "load game highlighted" : endcase
case 3 : a = 100 : b = 100 : c = 255 : selected$ = "exit game highlighted" : endcase
case default : a = a : b = b : c = c : selected$ = selected$ : endcase
endselect

`pressing enter prints the selected option
if keystate(28) = 1
if choice = 3 then end
selected$ = "exit was selected"

endif
if choice = 2
if keystate(38) = 1
filename$ = "currentsave.save"
if File Exist(filename$)=1
open to read 1,filename$
rem read floats ------
read float 1,savedata1#
read float 1,savedata2#
read float 1,savedata3#
position object 1,savedata1#,savedata2#,savedata3#
close file 1
endif
selected$ = "load game was selected"
endif
endif
selected$ = "load game was selected"
if choice = 1
selected$ = "new game was selected"
endif


`reset keypressed
if scancode() = 0
keypressed = 0
else
keypressed = 1
ink rgb(255,255,255), 0
set cursor 5,5
print selected$
endif

`print options
ink rgb(a,a,a),0 : center text 200, 400, "[N]ew Game"
ink rgb(b,b,b),0 : center text 330, 400, "[L]oad Game"
ink rgb(c,c,c),0 : center text 450, 400, "[E]xit Game"

sync
loop

Dragonseige
gothboy 101
20
Years of Service
User Offline
Joined: 31st May 2004
Location: Watonga, ok, usa
Posted: 5th Aug 2004 12:48 Edited at: 5th Aug 2004 12:50
or if you press escape key its supposed to go to line 101

Rem Project: Midtime
Rem Created: 8/4/2004 8:13:31 PM

Rem ***** Main Source File *****
sync on
sync rate 0
backdrop on
color backdrop 0
scrolly$=" A DRAGONSEIGE PRODUCTION "
scrlsize=len(scrolly$)
scrlpos=1
maxchar=20
width=9.9
height=19
startpoint=200
endpoint=1
speed=1
dim xpos(600)
spacing=startpoint/maxchar
set text font "tahoma"
set text size 128

for j = 1 to 60
cls 0
center text 64,32,chr$(j+31)
get image j,0,0,128,128
next j

hide mouse
sync on
sync rate 0
backdrop on
color backdrop rgb(0,0,0)
set image colorkey 0,0,0

for char=1 to maxchar
make object cube char,width
make object cube 100+char,width
make object cube 200+char,width
make object cube 300+char,width
make object cube 400+char,width
make object cube 500+char,width
ghost object on char,0
ghost object on 100+char,0
ghost object on 200+char,0
ghost object on 300+char,0
ghost object on 400+char,0
ghost object on 500+char,0
xpos(char)=char*spacing
texture object char,1
texture object 100+char,1
texture object 200+char,1
texture object 300+char,1
texture object 400+char,1
texture object 500+char,1
set object transparency char,1
set object transparency 100+char,1
set object transparency 200+char,1
set object transparency 300+char,1
set object transparency 400+char,1
set object transparency 500+char,1
next char
position camera startpoint/2,0,-80
point camera startpoint/2,0,0


for char=1 to maxchar
if scrlpos=scrlsize
scrlpos=1
endif

if xpos(char)<endpoint
xpos(char)=startpoint
a$=mid$(scrolly$,scrlpos)
a=asc(a$)-31
texture object char,a
texture object 100+char,a
texture object 200+char,a
texture object 300+char,a
texture object 400+char,a
texture object 500+char,a
inc scrlpos,1
endif

xpos(char)=xpos(char)-speed
position object char,xpos(char),0,0
position object 100+char,xpos(char),0,-20
position object 200+char,xpos(char),xpos(char),xpos(char)
position object 300+char,xpos(char),0-xpos(char),xpos(char)
position object 400+char,50+xpos(char),xpos(char)-20,xpos(char)-20
position object 500+char,50+xpos(char),(0-xpos(char))+20,xpos(char)-20
next char
a = 255
b = 100
c = 100
choice = 1
disable escapekey
sync

if escapekey()=1 then goto line 101 or, wait 10000, then
do

`if key e pressed
if keystate(18) = 1
if keypressed = 0
choice = 3
endif
endif
`if key l pressed
if keystate(38) = 1
if keypressed = 0
choice = 2
endif
endif
`if key n is pressed
if keystate(49) = 1
if keypressed = 0
choice = 1
endif
endif
`cycle through next option and update choice
if rightkey() = 1
if keypressed = 0
inc choice, 1
if choice > 3 then choice = 1
endif
else
leftkeypressed = 0
endif

`cycle through previous option and update choice
if leftkey() = 1
if keypressed = 0
dec choice, 1
if choice < 1 then choice = 3
endif
else
rightkeypressed = 0
endif

`set colors for print options
select choice
case 1 : a = 255 : b = 100 : c = 100 : selected$ = "new game highlighted" : endcase
case 2 : a = 100 : b = 255 : c = 100 : selected$ = "load game highlighted" : endcase
case 3 : a = 100 : b = 100 : c = 255 : selected$ = "exit game highlighted" : endcase
case default : a = a : b = b : c = c : selected$ = selected$ : endcase
endselect

`pressing enter prints the selected option
if keystate(28) = 1
if choice = 3 then end
selected$ = "exit was selected"

endif
if choice = 2
if keystate(38) = 1
filename$ = "currentsave.save"
if File Exist(filename$)=1
open to read 1,filename$
rem read floats ------
read float 1,savedata1#
read float 1,savedata2#
read float 1,savedata3#
position object 1,savedata1#,savedata2#,savedata3#
close file 1
endif
selected$ = "load game was selected"
endif
endif
selected$ = "load game was selected"
if choice = 1
selected$ = "new game was selected"
endif


`reset keypressed
if scancode() = 0
keypressed = 0
else
keypressed = 1
ink rgb(255,255,255), 0
set cursor 5,5
print selected$
endif

`print options
ink rgb(a,a,a),0 : center text 200, 400, "[N]ew Game"
ink rgb(b,b,b),0 : center text 330, 400, "[L]oad Game"
ink rgb(c,c,c),0 : center text 450, 400, "[E]xit Game"

sync
loop

Dragonseige
Mind Storm 101
21
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Excaping the Gates of Heaven
Posted: 5th Aug 2004 12:54
You know... thers a "Code" feature.

"Think what you like, You'll all be mine in the end."

[href]www.DotBinary.dbspot.com[/href]
gothboy 101
20
Years of Service
User Offline
Joined: 31st May 2004
Location: Watonga, ok, usa
Posted: 5th Aug 2004 12:59
oh thanks mindstorm (youre work is very impresive)

Dragonseige
GameKit
21
Years of Service
User Offline
Joined: 6th Mar 2003
Location: USA, Staring Blankly at a Computer
Posted: 5th Aug 2004 13:04
Change it to a "For/Next" Loop Instead of a "Do/Loop" Loop... Replace "Do" with "For T=1 to 750" and the "Loop" with "Next T"...

PS: Very Nice Effect...

The computer isn't an addiction, its more of a mental and social dependancy.
gothboy 101
20
Years of Service
User Offline
Joined: 31st May 2004
Location: Watonga, ok, usa
Posted: 5th Aug 2004 13:13 Edited at: 5th Aug 2004 13:16
thanks also about the effect thing but it says could not determin perameter type of "line 101 or" at line 100. sorry for keep buggingg you

Rem Project: Midtime
Rem Created: 8/4/2004 8:13:31 PM

Rem ***** Main Source File *****
sync on
sync rate 0
backdrop on
color backdrop 0
scrolly$=" A DRAGONSEIGE PRODUCTION "
scrlsize=len(scrolly$)
scrlpos=1
maxchar=20
width=9.9
height=19
startpoint=200
endpoint=1
speed=1
dim xpos(600)
spacing=startpoint/maxchar
set text font "tahoma"
set text size 128

for j = 1 to 60
cls 0
center text 64,32,chr$(j+31)
get image j,0,0,128,128
next j

hide mouse
sync on
sync rate 0
backdrop on
color backdrop rgb(0,0,0)
set image colorkey 0,0,0

for char=1 to maxchar
make object cube char,width
make object cube 100+char,width
make object cube 200+char,width
make object cube 300+char,width
make object cube 400+char,width
make object cube 500+char,width
ghost object on char,0
ghost object on 100+char,0
ghost object on 200+char,0
ghost object on 300+char,0
ghost object on 400+char,0
ghost object on 500+char,0
xpos(char)=char*spacing
texture object char,1
texture object 100+char,1
texture object 200+char,1
texture object 300+char,1
texture object 400+char,1
texture object 500+char,1
set object transparency char,1
set object transparency 100+char,1
set object transparency 200+char,1
set object transparency 300+char,1
set object transparency 400+char,1
set object transparency 500+char,1
next char
position camera startpoint/2,0,-80
point camera startpoint/2,0,0


for char=1 to maxchar
if scrlpos=scrlsize
scrlpos=1
endif

if xpos(char)<endpoint
xpos(char)=startpoint
a$=mid$(scrolly$,scrlpos)
a=asc(a$)-31
texture object char,a
texture object 100+char,a
texture object 200+char,a
texture object 300+char,a
texture object 400+char,a
texture object 500+char,a
inc scrlpos,1
endif

xpos(char)=xpos(char)-speed
position object char,xpos(char),0,0
position object 100+char,xpos(char),0,-20
position object 200+char,xpos(char),xpos(char),xpos(char)
position object 300+char,xpos(char),0-xpos(char),xpos(char)
position object 400+char,50+xpos(char),xpos(char)-20,xpos(char)-20
position object 500+char,50+xpos(char),(0-xpos(char))+20,xpos(char)-20
next char
a = 255
b = 100
c = 100
choice = 1
disable escapekey
sync

if escapekey()=1 then goto line 101 or, wait 10000, then
For T=1 to 750

`if key e pressed
if keystate(18) = 1
if keypressed = 0
choice = 3
endif
endif
`if key l pressed
if keystate(38) = 1
if keypressed = 0
choice = 2
endif
endif
`if key n is pressed
if keystate(49) = 1
if keypressed = 0
choice = 1
endif
endif
`cycle through next option and update choice
if rightkey() = 1
if keypressed = 0
inc choice, 1
if choice > 3 then choice = 1
endif
else
leftkeypressed = 0
endif

`cycle through previous option and update choice
if leftkey() = 1
if keypressed = 0
dec choice, 1
if choice < 1 then choice = 3
endif
else
rightkeypressed = 0
endif

`set colors for print options
select choice
case 1 : a = 255 : b = 100 : c = 100 : selected$ = "new game highlighted" : endcase
case 2 : a = 100 : b = 255 : c = 100 : selected$ = "load game highlighted" : endcase
case 3 : a = 100 : b = 100 : c = 255 : selected$ = "exit game highlighted" : endcase
case default : a = a : b = b : c = c : selected$ = selected$ : endcase
endselect

`pressing enter prints the selected option
if keystate(28) = 1
if choice = 3 then end
selected$ = "exit was selected"

endif
if choice = 2
if keystate(38) = 1
filename$ = "currentsave.save"
if File Exist(filename$)=1
open to read 1,filename$
rem read floats ------
read float 1,savedata1#
read float 1,savedata2#
read float 1,savedata3#
position object 1,savedata1#,savedata2#,savedata3#
close file 1
endif
selected$ = "load game was selected"
endif
endif
selected$ = "load game was selected"
if choice = 1
selected$ = "new game was selected"
endif


`reset keypressed
if scancode() = 0
keypressed = 0
else
keypressed = 1
ink rgb(255,255,255), 0
set cursor 5,5
print selected$
endif

`print options
ink rgb(a,a,a),0 : center text 200, 400, "[N]ew Game"
ink rgb(b,b,b),0 : center text 330, 400, "[L]oad Game"
ink rgb(c,c,c),0 : center text 450, 400, "[E]xit Game"

sync
Next T

Dragonseige
zircher
21
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 6th Aug 2004 00:07
Damn it! Learn to use the CODE tags. The button for it is on the freaking editor toolbar, are you blind? Alternately, use the source text box. You've been here long enough to know better and you're giving folks a bad impression of Oklahomans.
--
TAZ

"Do you think it is wise to provoke him?" "It's what I do." -- Stargate SG-1
SandraD
20
Years of Service
User Offline
Joined: 30th May 2004
Location: Down on the corner, out in the street.
Posted: 6th Aug 2004 00:16
Zircher!

Any truly great code should be indisguishable from magic.
gothboy 101
20
Years of Service
User Offline
Joined: 31st May 2004
Location: Watonga, ok, usa
Posted: 6th Aug 2004 01:13
sorry zircher ill learn to fit in hows this



Dragonseige
zircher
21
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 7th Aug 2004 04:52
Thanks. Sorry for shaking the tree, but sometimes it has to be done, especially when you see examples every day and the editor is staring you right in the face.
--
TAZ

"Do you think it is wise to provoke him?" "It's what I do." -- Stargate SG-1
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 7th Aug 2004 05:39 Edited at: 7th Aug 2004 05:41
Try changing this.

To this

I think you want it to bypass the 10 second wait if you press escape?
[edit] If this works let me know and I'll explain it. If not can you explain more what you want it to do?

gothboy 101
20
Years of Service
User Offline
Joined: 31st May 2004
Location: Watonga, ok, usa
Posted: 7th Aug 2004 12:57
thank you lost in thought for all youre trouble

Dragonseige
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 7th Aug 2004 13:52
Did it work like you wanted? If you have any questions on how it worked (if it did) just ask.

Login to post a reply

Server time is: 2024-09-22 20:19:47
Your offset time is: 2024-09-22 20:19:47