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 / HELP ME I cant load any .x models!

Author
Message
code spinneker
20
Years of Service
User Offline
Joined: 18th Aug 2004
Location: My Computer
Posted: 2nd Sep 2004 03:15
I cant find out how to load my models into DBPRO, I also need help figuring out how to load in a bmp to use as the Backdrop. SOMEONE PLEASE HELP ME!!!!!
Hawkeye
21
Years of Service
User Offline
Joined: 19th Sep 2003
Location: SC, USA
Posted: 2nd Sep 2004 03:33
OK, give me a coupla minute to whip up a simple tutorial. Be with you in a sec

Bring out the mercenary in you!
http://www.davidtattersall.me.uk
Mercenaries2 Community (not yet, anyway, but coming soon! right?)
Hawkeye
21
Years of Service
User Offline
Joined: 19th Sep 2003
Location: SC, USA
Posted: 2nd Sep 2004 03:51 Edited at: 2nd Sep 2004 05:04
Ok, let's see here. To load a model into DBP, you need the directory path to the file and a number that acts as the "referense" to your object. You then use the LOAD OBJECT command to, well, load the object

Here's some sample code:


Note that I'm using a variable to hold the object referense. This is commonly viewed as good coding pratice, and becides, it's alot easier to reference a variable than to have to remember all those numbers. Cuz remember, you'll probally have at least five models or so, more likely upwards of 10 or 20, along with your GUI (graphical user interface - this is what appears on the screen to show you your lives, health, shields, ammo, and other vitaly important info), music, sound effects, matrixs (if you like being old school ), terrains, etc. etc. And you have to have numbers for all of that stuff. So, it would be much easier on your brain to store all of those numbers in varyables

Also note that the varyable (sorry for my atrocious spelling, I'm very focused today ) DOES NOT have to have the same name as your object, i.e. I could have used any of the following instead:


But it's a wise idea to choose a name that agrees with what you're trying to load, so SpongeBob=1 is (probally) out. Same for the pink bunnies one.

OK, now for displaying your object on the screen. First let's have some sample code:


Since I don't know how much you know, I'm taking this as slowly as possible First thing you'll notice (hopefuly) is the addition of the "rem" command. This isn't really a command isasmuch a reminder. It tells the complier to basicly ignore whatever's after that command on that line.

You'll also notice that abit further down, I seem to have changed all of the "rem" commands to a "`" (which is to the left of the 1 on most keyboards) This is exactilly the same as "rem", only it's a bit quicker to hit. I like using it for that reason, but you of course can do whatever you want.

Next thing we'll examine is this block of code at the very top of the mini-program:


The first line is just a reminder as to what this code does. I forgot to add this above, but reminders are mostly so you don't forget what your code does after a coupla days or so. Trust me, you'll forget it

The second line of code tells the complier to turn sync on. So what's sync, I hear you say. And why do we want it? Well, sync is what keeps your games smooth. You pretty much always want to set sync on. If you want a little more deatail, read this code snipper below. Otherwise, just skip it. But do come back to it later on, it's kinda nice knowing exactilly what you're doing at any time and with any command in your games


Ok, next code block. To keep you from scrolling back and forth, I've put the code block below


You probally already know what this does, since I explained it above. But I'll go over it again, just in case.

That code block consists of three lines:
First, it has a rem statement so you can remember what it was all about
Second, it creates a placeholder of sorts, so you don't have to remember a bunch of numbers (now let me see, is object 1274 the evil zombie boss, or is that the pink bunny? hmmmmm... )
And third, it loads your object (either the zombie boss, or the pink bunny, doesn't matter which one you decide on )

OK, next code block. Again, I've reprinted it here:


This is easily the most important bit of code in the entire thing. (of course, there isn't much there to begin with, but you get the idea ) First, the now familiar reminder, except I've switched to the "`" notation instead of the "rem" commands. Once again, this is purely fluff; it doesn't do anything except remind you as to what the code does.

Second command! The "do" command. This is very important, but to understand it properly we need to skip to the eighth command: "loop" This is, quite simply enough, a loop. The complier keeps running through this bit of code, all of the stuff from "do" to "loop", pretty much forever. At least untill you decide you've had enough spinning objects, thank you very much, and now you want to start on your RPG!

Newbie note: (READ THIS CAREFULY! IT IS VERY IMPORTANT!)
That bit about the RPG was a joke. Never, ever try to make an RPG unless you've been studying DBP for at least a year, perferably two or three. And even then, don't try posting about your grand new RPG UNTIL YOU HAVE SCREENSHOTS AND A WORKING DEMO! Too many new ppl have been flamed for doing this. If you want an example, try searching for "Midtime" in the Work In Progrss section of the forums. Read it. Many, many, times. As far as I know, gothboy 101 is still working on it. Maybe he gave it up (I hope so.) But if you want to make a RPG (or for that matter, a MMONRPG or an Action RPG), kindly keep your mouth shut untill you've either
a) Come to the conclusion that making a RPG is impossible
or b) Got a working demo with more than a untextured matrix and a sphere

OK, rant time is over. Back to the drawing board!

EDIT: THIS BRB IS LEFT IN BECAUSE... WELL, I DON'T WANT YOU TO BE OFFENDED (oh, and don't TYPE IN ALL CAPS, EITHER, IT ALSO ANNOYS PEOPLE!
[again, more stuff is coming. I didn't want to lose all of that stuff I just typed And don't take the RPG thing personaly, it's just that we've had a real rush of
Quote: "I WANNA GET A TEAM AND MAKE A MMONRPG!!! Comon doodz l37s g00!"
type of posts lately, and I want to keep the flames to a minimum. Get's too hot ]

Back to loops: So how do you exit if the loop is gotta repeat forever? Simple. Either you use the "END" command and quite the game, or if you want to go somewhere else (like back to a menu or somthing) you "GOTO" out of the loop. Note: Don't try using GOTO right away, it won't be pretty as you have all of your objects on the screen while your user is trying to navigate the menus. And what if they decide to start the game over? Better to wait on the l337 menus for a bit.

Newbie note: (this one isn't as important, but it's still useful)
l337, 1337, 31337, all of that means "elite." The idea is to take "elite" or "eleet" and subsitute numbers for some or all of the letters. This is generally regarded as a "haxor k15d 05 t61ng" and it is a good idea NOT to talk this way. It can really annoy people. Annoy them to the extent that they wouln't even post! Yes, you heard that right. "haxor s933k" isn't "kewl," and neither is "txt spk" where you remove all of the vowels. But, you alrady know this if you've bothered to read all of the sticky on each section of the forums. (right? cuz if not, then do read them! espcially the one marked "n00bs read here!" It not only gives you a good education, but it will also make you laugh yourself out of your chair! Read it!

Ok, now that we have loops down (and the proper useage and misuseage of teh 31337 haxor spk! ), lets look at the reamainding code (linesn 3-7):



First thing: a comment. Now, from that, can you figure out what the command below means? Think about it for a bit, and then read on.

...

Did you get it? Or are you just being lazy and reading on? If that's the case, GO BACK AND READ IT! Life is hard, anyone who says otherwise is trying to sell you somthing

...

Well? Did you get it? Yeah? So what is it? Correct! That is, if you said it rotates the object slowly. If you didn't, well... Read on!

The command we're looking at is, for a reference, this:
Quote: "YRotate Object MyObject, Object Angle Y(MyObject)+0.1"

Wow, you say, that's complicated! Well, says I, not if you take it slowly

EDIT: THIS ONE'S LEFT IN BECAUSE... WELL, IT'S FUNNY!
[aaaaaaaannd we'll be back, right after these messages! stay tuned!]

TheallnewbaconandcheeseburgerfromMcFoods! Threeslicesofcheesewithnicecrispybaconslowlyflamefrilledoverahotfreshn00b tryingtomakeaMMONRG!



Aaaaannnd we're back!

Again, the command we're looking at is this:
Quote: "YRotate Object MyObject, Object Angle Y(MyObject)+0.1"


To understand this command, you need a picture. Sooooo...

[be right back after I figure out how to link to the images in the pong tutorial without uploading them to a website ]

Yey! It worked!


The first thing you need to know is that all game programmers use the Cartisan Corodenate System. Yep, that's the thingee you learned in algebra but always whined about how you'd never use it. Well, guess again! Cuz you can't do anything without a basic knowledge of this...

I'll presume you know what CCS is for now. My head hurts already

OK, so... The code again:

And the line we're looking at is this:
Quote: "YRotate Object MyObject, Object Angle Y(MyObject)+0.1"


What that does it rotate your object around the Y AXIS. The YRotate command is the "main" command; but the Object Angle Y is important aswell. Object Angle Y(MyObject) returns the value that is equal to the rotation of your object. Since we want to rotate it 0.1 degerees per SYNC (you haven't forgot about SYNC yet, have you? If you have, GO READ IT AGAIN! ), we have to get the current rotation of the object so we can rotate it by 0.1 degeres.

Next bit:

This simply tells the complier that this is the point where everything has happened that is going to happen during this little bit of time. For more explanation, read the thingee about conserning the SYNC command

OK, I think that's about it! Oh, wait, it's not... You wanted to learn about bitmaps aswell... Here follows a quick tutorial on that:

The command you want is
Quote: "LOAD BITMAP "data\mybitmap", MyBitmap"

where MyBitmap is a unique number you've assigned to "handle" the bitmap. As for displaying it on the screen... Put this somewhere in the main loop
Quote: "Paste Bitmap MyBitmap"

actually, it might be this:
Quote: "Paste Image MyBitmap"

Uhmmmmmmmm... I don't know Ah well... Guess you'll have to figure it out yourself...

Ok, NOW I'm finished. Hope this tutorial helps...

~Hawkeye



[EDIT: removed all of those pesky "be right back" thingees ]

Edit2: Wow, that's not a "simple tutorial"! Must be three pages... And all done on the fly, aswell. How long did *that* take? *looks at clock* Woah... I just spent 30minutes explaining all of this stuff with I could have just said use LOAD OBJECT and LOAD BITMAP

Ok, alright... But it was a lot a work

Bring out the mercenary in you!
http://www.davidtattersall.me.uk
Mercenaries2 Community (not yet, anyway, but coming soon! right?)
code spinneker
20
Years of Service
User Offline
Joined: 18th Aug 2004
Location: My Computer
Posted: 2nd Sep 2004 06:39
QUOTATION: "data/mybitmap.bmp"
Ok i figured out that my bitmap is a none existent object and I shouldnt use it but what the heck is this data crap, WHAT DATA? WHERE DATA? HOW DATA? . Your making me feel like an so stop it! Please inform on how to do the mydata crap!
Hawkeye
21
Years of Service
User Offline
Joined: 19th Sep 2003
Location: SC, USA
Posted: 2nd Sep 2004 06:55


Uhm... Ok... Seesh, no need to be rough about it

Data is just a convention I use. I like to keep all of my external objects in a nice, simple folder named "data". Others make a media folder and put their stuff in that, and still others just dump all of the stuff in their project's root directory. Soooo... "data\mybitmap.bmp" is just the location of your bitmap. You can make it anything, as long as it's a valid directory.


~Hawkeye

Bring out the mercenary in you!
http://www.davidtattersall.me.uk
Mercenaries2 Community (not yet, anyway, but coming soon! right?)
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 2nd Sep 2004 07:31
Quote: "QUOTATION: "data/mybitmap.bmp"
Ok i figured out that my bitmap is a none existent object and I shouldnt use it but what the heck is this data crap, WHAT DATA? WHERE DATA? HOW DATA? . Your making me feel like an so stop it! Please inform on how to do the mydata crap! "


Be a bit more tolerant for god's sake. He just spent ages typing out a tutorial for you and the least you could do is be thankful and be polite.

Grow up.

Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"
code spinneker
20
Years of Service
User Offline
Joined: 18th Aug 2004
Location: My Computer
Posted: 2nd Sep 2004 08:13
Ya I know. Sorry man just got up way to early this morning and im still feeling the effects of it! SORRY! Thanx for the help and do u need a directory like data? Ive been so stupido!
The Rookie
20
Years of Service
User Offline
Joined: 2nd Sep 2004
Location: Wales, UK
Posted: 2nd Sep 2004 08:28
I am currently assessing Dark Basic Pro trial (writing some code for performance tests) and this step through tutorial here has been very helpful in speeding that up.

A helpful community is a big plus when picking a package and posts like this go a long way to nailing that one down. Thank you very much for your efforts in writing this Hawkeye, I'm sure its going to be very helpful for many people browsing by.

Frank "The Rookie" Dodd
Ian T
22
Years of Service
User Offline
Joined: 12th Sep 2002
Location: Around
Posted: 2nd Sep 2004 08:29
code spinneker, do you still have the box your computer came in?

code spinneker
20
Years of Service
User Offline
Joined: 18th Aug 2004
Location: My Computer
Posted: 2nd Sep 2004 08:36
What is that supposed to mean? I dunno anyway. I have the DBPro full version by the way just in case u guys needed to know to help me!
code spinneker
20
Years of Service
User Offline
Joined: 18th Aug 2004
Location: My Computer
Posted: 2nd Sep 2004 09:06
OK i tried your code snippet hawkeye and I got the file does not exist runtime error i tried this code

but it didnt work even though I made a directory named data right on my desktop plus made an object named my object and have it saved as a .x! can anyone tell me what is wrong here?
JeBuS
20
Years of Service
User Offline
Joined: 20th Jul 2004
Location: Undisclosed Location, Dominion of JeBuS
Posted: 2nd Sep 2004 09:11 Edited at: 2nd Sep 2004 10:05
the Load Object() command has to be pointed to the correct folder.

if you put it on your desktop, the folder would be something like "C:documents and settingsuserdesktopdataobject.x"

Put the data folder in your project's folder, that way you only have to tell it "dataobject.x"

Of course, seeing as how you don't know enough about folder structure to do so already, you probably won't understand a word I said.
Hawkeye
21
Years of Service
User Offline
Joined: 19th Sep 2003
Location: SC, USA
Posted: 2nd Sep 2004 11:05
Quote: "
Ya I know. Sorry man just got up way to early this morning and im still feeling the effects of it! SORRY! Thanx for the help and do u need a directory like data? Ive been so stupido!
"

Nah, you're fine, don't wory about it. That's happened to me aswell... Next time, wait a coupla minutes before you hit the "post message" button. That always does it for me As for the directory, just make sure it's in you project folder. That's useually somthing along the lines of:
C:\Program Files\DarkBasic Software\Projects\Myproject" where MyProject is, well, you project Oh, and the demo vs. full version thing doesn't matter much except for as how quickly we should respond...

@David T: Thanks
@Mouse: Well, it's funny, but it's not exactily nice, either... '[B]'
@The Rookie: Glad to hear it! "An artist is always glad to know his art is appreacatied" hehe, couldn't resist...

At first, I had decided not to *ever* again post here, as the n00bs are just... too n00b for my likings, but Rookie has changed that. It's amazing how much one apreacative person can mean to guy like me... Thank you

Now then, no too seem too soft, @code spinniker (again): Try working through things in the manual first before posting. It's actually more fun to figure out things yourself, rather than having to restort to the forum members for help. And even then, make sure to read the stickys FIRST, before you post. Alot of this stuff is covered in Hamish McHaggis's tutorial, and I'm sure you could've found help in the "My first pong game" thread. So, always check before posting. Cuts down on the flames

~Hawkeye

Bring out the mercenary in you!
http://www.davidtattersall.me.uk
Mercenaries2 Community (not yet, anyway, but coming soon! right?)
code spinneker
20
Years of Service
User Offline
Joined: 18th Aug 2004
Location: My Computer
Posted: 2nd Sep 2004 11:12
I like my burgers char broiled with big flames LOL thanx for the help again hawkeye and I do know what the project file is, I think??? Is it in that sidebar thing with the things like cursor and media and all that jazz? If so then I know which one if not then i'm lost
code spinneker
20
Years of Service
User Offline
Joined: 18th Aug 2004
Location: My Computer
Posted: 2nd Sep 2004 11:40
OK ive got the object to exist but now it wont load, its the darkmatter swat guy that I converted to become a bmp and stuffed him in the data file and used the long extension to get it to exist so my code looks like this

I think it may just be a problem with the code but I cant be sure. I did read the manual plus screwed around with the tutorials and stuff and still didn't know how to do this stuff! thanks for everything else and now I just have that one problem!
JeBuS
20
Years of Service
User Offline
Joined: 20th Jul 2004
Location: Undisclosed Location, Dominion of JeBuS
Posted: 2nd Sep 2004 12:47
GAH!

"c:\Documents and Settings\User\Desktop\data\" was just an example of where it might be. Find the real path to your folder and put that in there. I highly doubt the 'User' part is real.

Also, Load Object() does not load pictures. Load Image loads pictures. READ THE MANUAL.
code spinneker
20
Years of Service
User Offline
Joined: 18th Aug 2004
Location: My Computer
Posted: 3rd Sep 2004 01:14
NONO I did the above with my bmps and they worked but my 3d models wouldnt load themselves into darkbasic. I need to figure out which directory I should put them in because there is no my project directory anywhere in where all the Dark basic Pro files are. I can get BMPs to exist and work I just needed some help with finding out which directories and why the models wont work.
code spinneker
20
Years of Service
User Offline
Joined: 18th Aug 2004
Location: My Computer
Posted: 3rd Sep 2004 01:17
Sorry for mistake but i did load bitmap for my pictures and it worked, sorry BIG MISTAKE!
code spinneker
20
Years of Service
User Offline
Joined: 18th Aug 2004
Location: My Computer
Posted: 3rd Sep 2004 01:41
Sorry for triple post but I just got it to load my models using this code

Now all I need to figure out is how to shorten the directories so that other people can load it if they need to. Thank you for all the help before and all the good advice and now the only thing left is to figure out how to shorten down the directory so i dont have to do all this typing all the time Thanx again and if anyone knows how to shorten the directory could they A) tell me how to and B)give me a code snippet showing how to use the shortened directory!)
Dodo
20
Years of Service
User Offline
Joined: 8th Aug 2004
Location: eating lunch
Posted: 3rd Sep 2004 03:59
code spinneker, if you installed DBPro in the default folder and you store your projects in the default projects folder, then goto run (on the start menu) and type this in:

C:\Program Files\The Game Creators\Dark Basic Professional\Projects

then hit return(enter) and you should be in the default project folder. If you are not using the default folder then the project folder is the folder that you have saved your source code in. any media put in the same folder as the source code is saved in can be loaded just by using the name e.g.

Hawkeye
21
Years of Service
User Offline
Joined: 19th Sep 2003
Location: SC, USA
Posted: 3rd Sep 2004 05:36
Yep. Like Dodo said Just put your model in the root directory of your project and you'll be fine with this:


Bring out the mercenary in you!
http://www.davidtattersall.me.uk
Mercenaries2 Community (not yet, anyway, but coming soon! right?)
Newbie Pete
20
Years of Service
User Offline
Joined: 2nd Sep 2004
Location:
Posted: 3rd Sep 2004 06:32 Edited at: 3rd Sep 2004 06:36
As a newbie myself, imagine how pleased I am to be able to offer some help .

Here's a little bit of code (modified from one of DBPro's helpful 'help' examples) that shows how to deal with the file system. In this case, the first line sets the working directory, in this case *my* working directory, which is called "PRogramming" on my D: drive. You can change that to whatever you like.

A brief study of this should get you flying... I hope .

[Edit]
Sorry - pasted the wrong text - see next message!
Newbie Pete
20
Years of Service
User Offline
Joined: 2nd Sep 2004
Location:
Posted: 3rd Sep 2004 06:46
Let's try again.

Pete (with an inauspicious start to his forum contributions!)

Login to post a reply

Server time is: 2024-11-27 08:24:36
Your offset time is: 2024-11-27 08:24:36