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 / A Few Tips For Newcomers- Getting Started

Author
Message
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 18th Aug 2006 22:52 Edited at: 19th Aug 2006 00:16
I noticed that many people are confused when they first get DarkBasic, thus making them quit. Because of that, I decided to write this, because they don't know what they're missing

Sorry if there are grammar/spelling mistakes.

"DarkBasic is hard!"
-Heh it may seem hard now, but it really isn't once you begin the think like a programmer. This post should hopefully guide you through the easy basics of programming, preparing you for many of the other tutorials that lie ahead. How about this:

-Programming is like being the boss of a bunch of people who cannot remember anything that they are told. They need to be told everything in the order that they are to do it in. For example, you can't just tell the people in this group to go and get that box outside. You need to tell them to stand up, turn towards the door, walk towards it, open it, walk outside, look for the box, turn towards the box, walk towards the box, pick it up when they get there, stand up straight again, turn back towards the building, walk towards the building, walk towards the door, open the door, step inside, close the door, turn and walk towards you, and finally give you the box; in that order. If you tell them to get the box and forget to tell them to stand up, they will just sit there, dumbfounded. That sounds like a lot of work! But don't worry, it gets easier and you learn shortcuts as you get better

-The next thing you must understand is the camera. The user of the program only sees what the camera can see. so, you need to place the camera accordingly to where you want the user to be able to see. Say you wanted to make a cube spin. Well, you would first need to create this cube. Next, you want to make it spin, right? WRONG! What's the point of making a spinning cube if we can't see it? Yup. No point. So, you would now put the camera where it can see the cube, and then you would make something called a "loop". A loop is when you tell the program to do whatever is inside it OVER and OVER again. This can save LOADS of time. And in this loop, we would tell it to turn! That's it for our cube.


Commands needed to do the above
>Make Object Cube
>Position Camera
>Do
>One of these, any of them will do. The "Turn" ones are easiest:
Turn object left
Turn object right
Yrotate object
rotate object
>Loop

NOTE: Do and loop are related.



-Here's another camera example. Say you wanted to make a person walk through a tunnel and have the user be able to watch him walk ALL the way through. First, you must make the person. Next you must make the tunnel. Now you must make the person be able to walk. But what's the point of all this is you can't see it? So, you must put the camera behind the person, and make it stay there that way the user can see almost everything that the person can see.

Commands needed to do the above
>Load Object (if you already have a model of a person and a tunnel waiting. If not, use Make Object Cube or something of the sort.)
>Position Camera
>Point Camera
>Object Position x()
>Object Position y()
>Object Position z()
>Do
>Loop

NOTE: Do and loop are related. This one may be a bit tough to do at the moment. Don't attempt it if you aren't ready


-Now, let's refer back to our cube example. You can't tell the cube to spin without making it first! If you do that, the program will not know that the cube is even there, and it will get all confused, because it will have no idea what cube you are talking about.

-But say you had lots of cubes, but you wanted only one to spin. Well, when you make a cube, you have to give it a number, like mostly every other object in DarkBasic. With these numbers, you can easily refer to a specific cube. If you didn't, you would confuse your program because it would be thinking "ACK! I want to do what the boss says but I don't know what he wants me to make spin!" So, all you need to do is tell the program which cube you want to make spin, and it will spin that one. You can also make multiple cubes spin using this same logic. Just tell each cube to spin. For example, if you wanted cubes number 1 and 2 to spin, then tell cube 1 to spin, and also tell cube 2 to spin. It's that simple. However, say you had 100 cubes. Surely you would not want to write that spinning code that many times! So, you can use another type of loop, called a For-Next loop. This will cycle through a range numbers in sequence, and will do the action you specify for each one.

Commands needed to do the above
>Make Object Cube
>Position Camera
>Do
>One of these, any of them will do. The "Turn" ones are easiest:
Turn object left
Turn object right
Yrotate object
rotate object
>For
>Next
>Loop

NOTE: Do and loop are related. For and next are also related.


Anyway, that's all I have time to write right now. I hope this helped Maybe I'll write more later.
If you have any comments, things that you want to add to it, or sugguestions feel free say something.

Daemon
18
Years of Service
User Offline
Joined: 16th Dec 2005
Location: Everywhere
Posted: 18th Aug 2006 23:42 Edited at: 19th Aug 2006 00:40
I think that you should suggest using a loop in order to tell multiple cubes to spin.


I think it's a good idea to have a post which explains programming thinking to newcommers, instead of focusing on code. If you are to expand on it, however, I suggest that at the end of each bullet point you include a list of commands necessary to performing the task in your example. Just a list, not explanations; let them look it up in the help files.

Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 19th Aug 2006 00:17 Edited at: 19th Aug 2006 01:10
Thanks for the feedback. I took your advice (and fixed those mistakes)

And feel free to add to this if you have any ideas!

Login to post a reply

Server time is: 2024-11-27 09:55:40
Your offset time is: 2024-11-27 09:55:40