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 / Old DB code to DBPro help

Author
Message
EUKJaguar
14
Years of Service
User Offline
Joined: 9th Dec 2009
Location:
Posted: 9th Dec 2009 15:40
Hi
I used to play about with DB years ago and found some old code out that i used to play about with for creating menu's for my CD's. I've bought DBPro a while ago and thought i would have another go. I'M STUCK. even the code that used to work WORKS NO LONGER. I've been playing around for days now and still no joy. here is the code if anybody can help me.....


sync rate 75
sync on
rem hide mouse

set window on
set window size 620,460
set window title "My Games Menu"
load image "plasma.bmp",1
load music "music.mp3",1

create bitmap 1,128,256
set current bitmap 1
paste image 1,0,0
paste image 1,0,128

set current bitmap 0
create bitmap 2,128,128

make object cylinder 1,100
rotate object 1,270,0,270
fix object pivot 1
scale object 1,100,100,2500
texture object 1,1
set object 1,1,0,0

make object sphere 2,100
color object 2,rgb(0,0,0)
position object 2,0,0,1000
color backdrop rgb(0,0,0)
position camera 0,0,-1250

speed=1; limit=1; counter=0
loop music 1

do
draw to front
a#=mousex()
b#=mousey()
c#=mouseclick()
text 20,50,"X:"+str$(a#)+" Y:"+str$(b#)

if a#>244 and b#<213 and c#>0
set cursor 244,100
print "goodbye world"
execute file "c:\windows\notepad.exe","",""
else
set cursor 244,100
print "hello world"
endif

if counter=limit
set current bitmap 1
get image 2,0,y,128,y+128
set current bitmap 2
paste image 2,0,0
set current bitmap 0
texture object 1,2
inc y
if y=128 then y=0
counter=0
endif
z=z+2
zrotate camera wrapvalue(z)
inc counter
sync
loop
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 9th Dec 2009 17:22
It might be easier to help you out if you told us what errors you get.
Does the code compile at all? If not, what errors are the compiler rising? If the code does indeed compile, does the program just crash or do you get an error message?

If it's just something that's been removed / changed from DBC -> DBP, you will probably get an error at compilation telling you that "xxxxx at line yyyyy could not be understood" or similar. In that case, simply traverse to the given line (incorrect lines are usually not reported unless you have several source files) and see if you can make any sense of it. If not, post the particular line up here and somebody can probably tell you what's wrong at first glance

Also, line intendation makes you code much more readable.

=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 9th Dec 2009 18:41
It compiles ok for me, but can't run as I don't have the media you used.

Without Music or Love the world would be a very empty place... Thank god I still have music.. --'-<@
chafari
Valued Member
18
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 9th Dec 2009 19:39
it works ok here , but as =Prof= says, we have no media to load. Any way, just forcing the program to run, swiching off the loading media and some other lines of code, what I see, is a white notepad waiting for no idea...

You just execute notepad.exe;could be any other program, but what do you want the program do after that?

learning every day
EUKJaguar
14
Years of Service
User Offline
Joined: 9th Dec 2009
Location:
Posted: 10th Dec 2009 00:51
Sorry guys
the code supposed to show a plasma tunnel that looks like your traveling down as it rotates but all i get is a single line that rotates

I do not get any errors in the code it runs but no tunnel

When i had DB everything worked a dream, but movin house and i lost the disk for db thought i would upgrade to dbpro, i may have to find db on ebay or something if i cannot get it workin in dbpro.
EUKJaguar
14
Years of Service
User Offline
Joined: 9th Dec 2009
Location:
Posted: 10th Dec 2009 01:01
Sorry Guys

Its the Tunnel part thats not working just put in any .bmp picture it should look like you traveling down a rotating tunnel, all i get is a single line that rotates. code works fine on db but not dbpro so hope someone can help.

I get no errors when i run the code
chafari
Valued Member
18
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 13th Dec 2009 18:54
I had a look in the old darkbasic, and as you say.... it looks like a tunnel...a space tunnel....nice indeed, but what I cant understand, is...why to execute a external file?

learning every day
EUKJaguar
14
Years of Service
User Offline
Joined: 9th Dec 2009
Location:
Posted: 14th Dec 2009 02:17
Hi i'm doing a menu system so kids can click on parts to load different things(Thats not the problem tho). the problem in the tunnel effect is not workin in DBPro

Can any body shed any light on this for me
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 14th Dec 2009 22:38
what does the plasma bmp look like, the one I have that comes with DBP is a grey scale one that I've used, all works as it should.
the cylinder is turning, think it might have something to do with the lights?

do you have the old DBC exe so we can see what used to do?

Dark Physics makes any hot drink go cold.
EUKJaguar
14
Years of Service
User Offline
Joined: 9th Dec 2009
Location:
Posted: 15th Dec 2009 16:45
Here is the old .EXE i created that shows the tunnel working

Attachments

Login to view attachments
chafari
Valued Member
18
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 21st Dec 2009 11:12
it works fine in old Darkbasic. Dont give up programming if it doesn´t in Dbpro. some programms just doesn´t work in the new compiler.

learning every day
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 21st Dec 2009 12:12
what does your plasma.bmp picture looks like, run the exe and can now see what is does, noly have to now workout how it did it.

Dark Physics makes any hot drink go cold.
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 21st Dec 2009 12:17
I think DBPro has change the way the scale command works, try changing the scale line with this.



and tell us if that works.

Dark Physics makes any hot drink go cold.
EUKJaguar
14
Years of Service
User Offline
Joined: 9th Dec 2009
Location:
Posted: 22nd Dec 2009 00:39
Thanks HowDo

that did it. I would have never found the problem think i was lookin tooooo deep at it, lol

Works a treat now thanks again

Login to post a reply

Server time is: 2024-11-16 09:25:24
Your offset time is: 2024-11-16 09:25:24