General Discussions

My program isnt working, Help required! – Tails

Tails

Junior Member

Posts: 7
From: Scunthorpe, UK
Registered: 08-21-2003
Hi

Been learning blitz basic through Krylar's book and i have created my own program in which when ran will display info on 2 cars.

When i runthe program no errors are reported however, it just display's a black screen.

Graphics 640,480

Type Cars
Field Make$
Field Model$
Field BHP%
Field TopSpeed%
End Type

;go to the car data
Restore CarData

;set our data reading flag to true
bData = True

;while we still have data
While bData
;read the data
Read Make$
If Make$ <> "STOP"
bData = False
Else
Read Model$
Read BHP%
Read TopSpeed%

;create an instance
Driver.Cars = New Cars
If Driver.Cars <> Null
Driver\Make$ = Make$
Driver\Model$ = Model$
Driver\BHP% = BHP%
Driver\TopSpeed% = TopSpeed%
Else
Text 0,0,"Error: Could not perform task"
bData = False
EndIf
EndIf
Wend

;set the vertical control variable
iTextY% = O

;step through each instance and print
For Driver.Cars = Each Cars
Text 0,iTextY,"Make: " + Driver\Make$
iTextY = iTextY + 16
Text 0,iTextY,"Model: " + Driver\Model$
iTextY = iTextY + 16
Text 0,iTextY,"BHP: " + Driver\BHP%
iTextY = iTextY + 16
Text 0,iTextY,"Top Speed: " + Driver\TopSpeed%
iTextY = iTextY + 32
Next

;step through each instance of the type and delete
For Driver.Cars = Each Cars
Delete Driver
Next

;wait for a keypress
WaitKey()

;end the program
End

;************
;* Car Data *
;************
.CarData
Data "Ford","Ka",63,92
Data "Vauxhall","Astra",120,111
Data "STOP"


All help would be appretiated

------------------
-Tails

AmazingJas

Member

Posts: 437
From: Sydney, NSW, AUSTRALIA
Registered: 04-03-2003
I can't see any buffering commands in there like FLIP?
Psyco

Member

Posts: 55
From: Australia
Registered: 08-25-2003
Yes if your using the "text" command not the "print" command then you have to set the buffer at the top "setbuffer backbuffer()" then put "flip" and "cls" after you have drawn everything and before the waitkey()

Just remember all of this:

Graphics 800,600
setbuffer backbuffer()
.loop
most of your code goes here
drawstuff
flip
cls
goto loop
functions


And there is a loop that can be used for what you are doing to doom 3, though you might want to change the loop to a "wend" loop, though I personally dont use the wend one because im wierd.
------------------
W00terness

[This message has been edited by Psyco (edited August 25, 2003).]

Mack

Administrator

Posts: 2779
From:
Registered: 01-20-2001
Welcome to CCN Psyco!

------------------
It's not seeing is believing, it's believing and then seeing.
http://www.twoguyssoftware.ca

AmazingJas

Member

Posts: 437
From: Sydney, NSW, AUSTRALIA
Registered: 04-03-2003
Hey Psyco, another Aussie! Send me your email to jasace50@hotmail.com and I'll add you to my list of Aussie Christian developers!
Where abouts in Oz are you from? I'm a Sydneysider.
Psyco

Member

Posts: 55
From: Australia
Registered: 08-25-2003
I have been hanging out at Bc.com for a while decided to come here. I live in tweed heads, you cant miss it, On the eastern beach or Aus, on the NSW QLD boarder. But atm im in Japan on exchange in a wierd place in the middle of nowere.

Oh and hi.

------------------
W00terness

c h i e f y

Member

Posts: 415
From: Surrey, United Kingdom
Registered: 03-07-2002
hello Psyco m8, I know you very well on Blitzcoders

how come you decided to join up on here? very nice to see you aboard anyway, metalman is around here TOO!

------------------
Do you live or work in Surrey?
check out www.surreycounty.co.uk then !! :D

Tails

Junior Member

Posts: 7
From: Scunthorpe, UK
Registered: 08-21-2003
Thanks a lot guys.

Although when following the example in Kyrlar's book it didn't tell me to put backbuffer and flip etc.

ah well.

back to the learning

------------------
-Tails

Psyco

Member

Posts: 55
From: Australia
Registered: 08-25-2003
Tails you keep on learning and ask for help when you need to, once you pick it up everything will be a breeze.

Blitz: A language that takes a few weeks to get the hang of but takes a few years to master, though I have only been using it for one year.

Cheify I needed another forum, though I didnt see what christianity had to do with coding so I didnt come here. Anyway while BC was down I decided to have a look around and found out that here isnt that bad a place, can talk about more stuff but still about coding.
Also the name and idea of my game was somthing else keeping me from comming here

------------------
W00terness

Psyco

Member

Posts: 55
From: Australia
Registered: 08-25-2003
Is my computer broken because noone has said anything in over a day...what did I do???!!??

------------------
W00terness

CobraA1

Member

Posts: 926
From: MN
Registered: 02-19-2001
CCN tends to be low-traffic. Sometimes, there's a good thread that gets some attention, but in genereal, don't expect too much. A lot of people here spend a lot of time in Real Life, so the forums don't get too much attention.

------------------
There are only 10 types of people - those who understand binary, and those who don't.
Switch Mayhem now available! Get it here
Codename: Roler - Planning

Psyco

Member

Posts: 55
From: Australia
Registered: 08-25-2003
oh good I thought something was wrong, I probably would be in RL if I wasnt in Japan soo boring here.

------------------
W00terness

AmazingJas

Member

Posts: 437
From: Sydney, NSW, AUSTRALIA
Registered: 04-03-2003
What's the name of your game?
Psyco

Member

Posts: 55
From: Australia
Registered: 08-25-2003
Dark Afterlife

------------------
W00terness

AmazingJas

Member

Posts: 437
From: Sydney, NSW, AUSTRALIA
Registered: 04-03-2003
Well the name in itself isn't unwelcome, what's the game about?
Psyco

Member

Posts: 55
From: Australia
Registered: 08-25-2003
Well im not god at explaining things but here goes:

Baiscally it runs off a heven and hell thing that I made up, a big planet split in half by good and evil that exists in the soal plane. So when people die they go there. Now origonally 20,000 years ago the place was rules by 10 evil people (im bad wih names too) and to cut a long story short they were eventually defeted and improsoned in earth. But noone knew that humans would become on earth. Humans go to heven/hell because they can tell the diffence between good and evil. Um thats basically the background theory.
Now the game is set in 2040 in a place called mous city (Coincedently built ontop of where the evil ones were imprisoned). Anyway 5 specil people die and become emendors (people that can controll powers and take over bodys). Then they are sent back to stop the evil form enslaving earth basically. I still cant get it too sound right.
Think GTA3 meets max payne meets diablo and put in a even weirder story and your done.
There we go what do you think?

------------------
W00terness

Krylar

Administrator

Posts: 502
From: MD, USA
Registered: 03-05-2001
Tails...don't know if you ever got help with your problem or not, but the issue stems in the piece of code where you're reading in the data statements:


While bData

;read the data
Read Make$

If Make$ <> "STOP"
bData = False
Else
Read Model$
Read BHP%
Read TopSpeed%

The problem is that you're saying "If Make$ does NOT equal 'STOP'" when it should read "If Make$ DOES equal 'STOP'". I've done this a hundred times, which is why I caught it!


While bData
;read the data
Read Make$
If Make$ = "STOP"
bData = False
Else
Read Model$
Read BHP%
Read TopSpeed%

...change it to that and it'll work ;D

All the best!

Welcome aboard, Psyco!

-Krylar

------------------

Tails

Junior Member

Posts: 7
From: Scunthorpe, UK
Registered: 08-21-2003
Thanx alot Krylar works a treat!

------------------
-Tails

[This message has been edited by Tails (edited August 29, 2003).]

AmazingJas

Member

Posts: 437
From: Sydney, NSW, AUSTRALIA
Registered: 04-03-2003
Psyco, sounds complex, is it going to be fps, rpg, isometric, 3d, or what? BTW, I just read in PC Powerplay about the russian built game "Stalker" which sounds awesome. Said to be a cross between halflife and Elite (the freeform nature of Elite, trading and what not). It has all the bells and whistles of the new halflife2 physics engine, plus a more RPG adventure feel to it. I think its a concept that will be explored in more and more games.
Psyco

Member

Posts: 55
From: Australia
Registered: 08-25-2003
3ps, yeah sorry im not good at expaining things.

Stalker sounds good, though I probably wont hear much about it as I am in Japan atm. Im more looking forward to Max Payne 2.

------------------
http://www.ethecom.com/farcestudios/images/sig.jpg