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 / Newbie here...

Author
Message
GMX
19
Years of Service
User Offline
Joined: 19th Sep 2005
Location: In front of my monitor
Posted: 19th Sep 2005 22:55
Hello DarkBASIC users,

I am new to DarkBASIC. I'm currently using Gamemaker (a drag and drop game making program, though it uses some code so I know quite a lot of things about coding). Now that I'm starting with DarkBASIC I'm just sort of bamboozled by the 3d concepts (Gamemaker is a 2d maker). Does anybody know where I can download some tutorials?

Also, I tried making a simple 3rd person game (nothing special, just where the camera follows a cube around) but for some reason it isn't working, my code is at the bottom of the post.

Thanks!
WarGoat
20
Years of Service
User Offline
Joined: 19th Sep 2004
Location: Montreal
Posted: 20th Sep 2005 02:55
sry youre code didn't post do [ code] your code and [ /code] (withouth the space between the [c and the [/c.

Windows XP,pentium IIII, 1,9 MGZ, 256 mb memory, 128 mb video card ATI Radeon 9200 se s80 'sett squadron back on the assault'
GMX
19
Years of Service
User Offline
Joined: 19th Sep 2005
Location: In front of my monitor
Posted: 20th Sep 2005 02:59
Oops, sorry, here it is. It's actually not working quite right, when I press up or down it doesn't go completely straight and sort of turns wierd. Can anybody tell me what's wrong?

Xolatron old
20
Years of Service
User Offline
Joined: 25th Jan 2004
Location: The Star Forge Language: DBpro
Posted: 20th Sep 2005 03:51 Edited at: 20th Sep 2005 03:52
The code box doesn't work for people who have newbie accounts (have to wait for their posts to be approved). I't also bad because it can't be edited (or so I believe - testing here).

[EDIT]
Yes, I can't change that code, so everyone's stuck with it now
[/EDIT]

-Xol


DBpro IonRay IDE: Demo 0.1.0.0 available!
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 20th Sep 2005 14:23 Edited at: 20th Sep 2005 14:35
For a start, you aren't using Delphi!

(You don't put a semicolon on the end of lines in DB)...

You also have colons where they shouldn't be.

I also suggest that you use indentation in your code to make it easier to read.

Other than that it seems to work OK, though without any reference point you couldn't see anything was moving. So I added a matrix for that reason.

Also, much of your code could be replaced with the Set Camera To Follow command (which I'll leave to you to experiment with).



TDK_Man

GMX
19
Years of Service
User Offline
Joined: 19th Sep 2005
Location: In front of my monitor
Posted: 20th Sep 2005 20:58
Thanks for your help with my code, I'm glad to know that I don't have to put semicolons after every line. (I do that when I program in gamemaker, I guess I'm just trained lol)

The matrix works (I didn't even know there was such a thing lol) but the cube still moves wierd, for example if you are moving forward and turn with left/right, the camera will turn but the cube will still not (then after a couple seconds the cube will turn), or sometimes the opposite. Any ideas?

Thanks,
-GMX
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 23rd Sep 2005 04:10
I think most of your problems are down to your camera code - you are trying to calculate things that DB can already do.

All you need to do is read the keyboard, alter the Y rotation of the object then use Move Object.

Set Camera To Follow will do all the nasty calculations for you...



TDK_Man

thinkdigital
21
Years of Service
User Offline
Joined: 18th Oct 2003
Location:
Posted: 24th Sep 2005 19:16
GMX - Hi. (ahem...)

Just so you know, you can use a ':' to separate commands in DB, although they are not required at the end of every line. Darkbasic assumes that each command ends at the end of that line.
GMX
19
Years of Service
User Offline
Joined: 19th Sep 2005
Location: In front of my monitor
Posted: 25th Sep 2005 00:51
Wow, it works! Awesome! Thanks everybody.
GMX
19
Years of Service
User Offline
Joined: 19th Sep 2005
Location: In front of my monitor
Posted: 25th Sep 2005 04:11
Sorry for a double post, but the rules said if you think of another question after posting a topic to post your other questions in 1 topic, so I figured I should post them here? Or a mod could un-confuse me

Anyways, I tried loading an object into DBPro, using this code:



(It's in the code given to me by TKD, just under walkspeed=2)

I'm trying to replace the cube with the shipobj (in other words I deleted the make object cube line). Here's my code so far:



But when I try and compile/run the game, it just gives me a black screen for half a second and then exits, without showing anything. What's going on?
UFOs other account lol
19
Years of Service
User Offline
Joined: 3rd Jun 2005
Location: Somewhere :)
Posted: 25th Sep 2005 16:54
It works in Dark Basic Classic with a hovercraft model instead of the ship model (because I don't have the ship model). There could be something wrong with the model or there must be some extra code you need in DB pro that you don't need in DB classic.

Green Bunnies rule!
GMX
19
Years of Service
User Offline
Joined: 19th Sep 2005
Location: In front of my monitor
Posted: 26th Sep 2005 22:36 Edited at: 26th Sep 2005 22:38
Well just in case it's the model, here's the model:

http://www.thekeystoreality.com/adam/ship1.3DS

Could somebody try this model with my code on their computer?

Or maybe like Green Bunny said it is something that has to do with DBPro?
Me!
19
Years of Service
User Offline
Joined: 26th Jul 2005
Location:
Posted: 26th Sep 2005 23:26 Edited at: 26th Sep 2005 23:28
I tried to load it

the model is duff...doesn`t load
I loaded another 3DS model into the same code and that worked fine
I suggest you convert all your 3DS models to .X, they load a lot faster and they are more flexible, 3DS has issues in pro, you are best avoiding them.

Me!

we know where area 51 is, but where are areas 1 to 50?, and what do they do there?.
GMX
19
Years of Service
User Offline
Joined: 19th Sep 2005
Location: In front of my monitor
Posted: 26th Sep 2005 23:35 Edited at: 27th Sep 2005 01:09
Well at least now I know...

P.S. I'm using 3ds max to make my models. I don't think 3ds max can export to .x, is there any other format that works with db pro?

EDIT: Well, I got it working. I figured out the problem, too. DBPro won't let me load models that I applied texture to when I made it in 3ds max. Why is that? And how do I apply texture that's just a shiny color to it? Or maybe gray color for the body of the ship and red for the wings?

EDIT: Also, I really need a tutorial. I tried making a game, and it stunk. Nothing worked. I attached the game to this message (source code). Here's what it's supposed to do:

You are supposed to see the sky in front of you (sort of works but I know there has to be an easier way)
You can press up and down to change your height, and left and right to change your horizontal position. (this works)
2 enemies start out a little ways in the distance and come towards you. (this works but I'm doing this in a really difficult and limiting way)
More enemies randomly come when i, a variable containing a random value, is equal to 2. (this doesn't work)

And I don't know why it doesn't work!

I know I'm doing pretty much everything in this game the hard way, and that's what I'm mainly asking: how do I do this the "easy" way?

(P.S. the game's called Red Wing)

Attachments

Login to view attachments
WarGoat
20
Years of Service
User Offline
Joined: 19th Sep 2004
Location: Montreal
Posted: 27th Sep 2005 01:17
Quote: "P.S. I'm using 3ds max to make my models. I don't think 3ds max can export to .x, is there any other format that works with db pro?"


You are using 3ds max?! If I don't make a mistake, its the programs that worth like 5000$? But aniway, Lucas W(I think its him) as a program for converting 3ds to x in is web site. You should try it, its very useful.

Windows XP,pentium IIII, 1,9 MGZ, 256 mb memory, 128 mb video card ATI Radeon 9200 se s80 'sett squadron back on the assault'
GMX
19
Years of Service
User Offline
Joined: 19th Sep 2005
Location: In front of my monitor
Posted: 27th Sep 2005 01:23 Edited at: 27th Sep 2005 01:24
Thanks.

Could somebody take a look at Red Wing (read my above post) and see what I could do to make it different (different meaning better and actually work)?

Now I just need some beginner's tips. Like, what type of game should I start with, if not one like red wing (I don't want to start with pong). An FPS?

Login to post a reply

Server time is: 2024-11-27 16:45:58
Your offset time is: 2024-11-27 16:45:58