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 / I NEED HELP

Author
Message
CrAzKiDd55
20
Years of Service
User Offline
Joined: 15th Sep 2004
Location: UK
Posted: 16th Sep 2004 03:17
hi im a complete newbie and i need someone to help me learn dark basic pro
thanks
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 16th Sep 2004 04:17
That's like saying - "I don't understand Maths - can someone explain it to me?" !!! You're going to need to be more specific.

Start by reading the tutorials, and look at the examples of source code. Then when you need help on specific problems, you will get help here.


CrAzKiDd55
20
Years of Service
User Offline
Joined: 15th Sep 2004
Location: UK
Posted: 16th Sep 2004 06:08
yes but i am no good at learning things by myself so i actually need an online "teacher" if you know what i mean.
i know the simple things like: Print and variables and rem etc but i just cant grasp other stuff by MYSELF. so having an online teacher would be good. but the thing is, is that these tutorials expect you to at leats know what integers mean etc...
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 16th Sep 2004 06:19
And please do not label threads like this "I NEED HELP". Something like "I need help learning DBP" (not in uppercase either) is more likely to do 2 things.
1. Make people want to look at this thread and help you more. Uppercase titles are very rude.
2. Will make sure if someone else needs help learning DBP they will be more likely to find this thread and learn from it. This forum search feature only searches titles and "I need help" covers alot of areas of programming.

Back on track. Yes read the manual and learn the syntax for the commands. Find and go through any tutorials you can. Then post any specific questions you may have here and someone will surely be glad to help you once you have put forth such effort.

CrAzKiDd55
20
Years of Service
User Offline
Joined: 15th Sep 2004
Location: UK
Posted: 16th Sep 2004 06:25
ok sorry for the bad topic name (dont know how to change it).
CrAzKiDd55
20
Years of Service
User Offline
Joined: 15th Sep 2004
Location: UK
Posted: 16th Sep 2004 17:16
ok thanx.. i am reading these tutorials which i have finally found to be useful. (no offence to the makers of the tutorials that i find to be not easy to understand)

Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 17th Sep 2004 02:23
Quote: "these tutorials expect you to at leats know what integers mean etc... "


An integer is a whole number - like 2,3,6,-253 etc.

A 'real number' (or a 'float'), on the other hand, is not a whole number - like 2.423674 or -456.237

Now keep reading the tutorial, and ask here again when you next get stuck!


CrAzKiDd55
20
Years of Service
User Offline
Joined: 15th Sep 2004
Location: UK
Posted: 17th Sep 2004 17:08
hi i dont get this idea of variables and the syntax of the RGB command (what values go where).
thanx
CrAzKiDd55
20
Years of Service
User Offline
Joined: 15th Sep 2004
Location: UK
Posted: 17th Sep 2004 17:09
i mean i do know a little bit about variables but i just dont get it. and also when you make a 3d model im just curious what polygons are to do with a 3d model as i have been reading about the dark matter programs and things.
blanky
20
Years of Service
User Offline
Joined: 3rd Aug 2004
Location: ./
Posted: 22nd Sep 2004 06:04
Variables
=====

A 'string' is basically a piece of text.
To stop text from being accidentally understood as more commands, you put double quotes around them.
For example:

"Hello World"

A number is obviously a number (integer = normal number. float = number with a decimal point)

No quotes needed.

Example:

86

Now, in DarkBasic, as soon as you first use a variable, it suddenly exists from nowhere. For example, here's a complete program

MyVariable=86

Now whenever you say about MyVariable (NOT IN QUOTES, OF COURSE), it will be replaced with the number 86.

It can be changed throughout the program. Example:

rem The variable is called x86
x86=1

for x86=1 to 20

print x86

next x86

print "Press a key to quit"
wait key
end

This would produce the following output:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Press a key to quit

And when you press a key, it will quit.

String (text) variables are differently named. They have to have a $ plonked on the end of their name.

Example:

rem THIS CODE IS WRONG
MyVariable="hi"
MyStringVariable$=32

rem THIS CODE IS RIGHT
variable1=32
variable2$="hi"

and then the dandelions went off with the pretty pansies

[img src=http://blanky.pt-web.net/ddd.gif] >::p
blanky
20
Years of Service
User Offline
Joined: 3rd Aug 2004
Location: ./
Posted: 22nd Sep 2004 06:11
The RGB function
========

RGB stands for Red Green Blue.

It's a function. A function is normally a command where you give it some data, and it gives you back some data.

For example:

var1=object exist(1)

If the object number 1 existed, var1 would now have 1 stored inside it. Otherwise, 0.

RGB is the same thing, only its used for generating colour values.

A colour is a number. Yup, a number.

you can't just say color object 1,red

And the problem is, each command accounts for the bazillions of numbers there are in the world (in 16bit mode, its 32768 or something).

How are you supposed to know which number means red?

You're not.

RGB takes three parameters;

RGB ( Red, Green, Blue)

Each value (red green and blue) can take a number from 0 to 255.

So if you wanted full red nothing else, you could do RGB(255,0,0)

If you wanted black, you could do RGB(0,0,0).

White, RGB(255,255,255).

And RGB generates a meaningless number that means something.

So you want a cube by the name of object 1 to be red:

Make Object Cube 1,100.0
Color Object 1,RGB(255,0,0)
Wait key
end

Voila! One red cube program, that quits when you hit a key.

(Note: If you're making a pro. game, as it says in JessTicular's speed up tips thingy, you can get about a 5% speed increase or something by using Texture object, because Color Object makes a big texture that's all that colour, whereas you could just make one of size 1x1 )

[img src=http://blanky.pt-web.net/ddd.gif] >::p
CrAzKiDd55
20
Years of Service
User Offline
Joined: 15th Sep 2004
Location: UK
Posted: 22nd Sep 2004 17:21
hi thanks for the explaination i do understand it. but i am now trying to get a little bit more advanced so i am going through tutorials ... but ... where it says (from blanky186)
Quote: "
For example:

var1=object exist(1)

If the object number 1 existed, var1 would now have 1 stored inside it. Otherwise, 0.
"


i dont understand the syntax of this command for instance where it says var1 is that a variable called var1? and where it says object exist(1) is that a command? and how does it work where it says the (1)?
Philip
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 22nd Sep 2004 22:21
Frankly piper I think you really need to go and buy the Beginners Guide to DBC book. That'll help you out enormously.

Philip

What do you mean, bears aren't supposed to wear hats and a tie? P3.2ghz / 1 gig / GeForce FX 5900 128meg / WinXP home
Cybermind
Valued Member
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 23rd Sep 2004 00:53
var1 is variable name you choose (do not choose a name that is the same as a command) it could as well has been piper_var1, and the object exist is a command, the number in the brackets is the number of the object you want to test i.e. OBJECT EXIST(43) tests if object 43 exist in your code

so now we make a little code.

piper_var1 = OBJECT EXIST(43)

IF piper_var1 = 1
PRINT "object exist, YES"
ENDIF

IF piper_var1 = 0
PRINT "object do not exist, crap"
ENDIF

that should run well, and put this line at the top after you run the code first time,

MAKE OBJECT SPHERE 43,100

and then run it again, and fell free to ask if you do not understand.
blanky
20
Years of Service
User Offline
Joined: 3rd Aug 2004
Location: ./
Posted: 23rd Sep 2004 03:08
o dam

i realized what i forgot to put in at the top of the 'variables' bit..

::

In DarkBasic, unlike most other languages, variables are made as soon as you first use them.

So if you did:

x32=1

or

sumthin=object exist(1)

Then if the variable is not created yet, it will be created then and there on the spot. (You can't uncreate variables, so recycle your variables!)

You do sound like you need a general intro. to the BASIC language syntax (e.g, Visual Basic, DarkBasic, ethosBASIC, whatever).

A book might be good.

[img src=http://blanky.pt-web.net/ddd.gif] >::p
CrAzKiDd55
20
Years of Service
User Offline
Joined: 15th Sep 2004
Location: UK
Posted: 23rd Sep 2004 03:39
ok thanx, i understand and i will buy this dark basic beginner book.
if i have anymore questions i will ask them.

thanks again

Peter
Indian Homie G
20
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: San Jose, CA
Posted: 23rd Sep 2004 09:30
Em... i honestly didnt really like that book. I saw it in Barnes and Noble, and it's really only for 2d stuff, and anyways, its hard to learn from a book. You get frustrated and like if you get something the book can't talk to you. Even in general, I dont really recommend buying books(for me at least) cuz they tend to piss me off.

....but thats just me.

AMD Athlon XP 3000+, S3 Deltachrome s8, 512 PC3200 RAM, 160 GB HD
John H
Retired Moderator
21
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 23rd Sep 2004 10:34
I hate book. Book is stupid.

I had to say it!! For anyone that doesnt know thats an oldschool famous quote from the old black and white darkbasic forums So is GIMME DA CODEZ

Annnnyhow - I suggest you read through each command and check out what it does. There are plenty of code snippets in the codebase (most of them are explained) to help you learn.

There one thing I -STRESS- not to do - thats to jump straight into a big project like a FPS/RPG. Youll get frustrated and quit, Ive seen it happen o so many times

Good luck with DB, its a fun language when you get the hang of it


Check out our Team Request in the Team Request section if you want to help!
CrAzKiDd55
20
Years of Service
User Offline
Joined: 15th Sep 2004
Location: UK
Posted: 1st Oct 2004 04:40
yey i got my book .. anyway thanks for the help . if i need more help ill just ask more questions.

thanks again

Login to post a reply

Server time is: 2024-09-23 01:16:03
Your offset time is: 2024-09-23 01:16:03