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 / Hi everyone I could uses some help on firing a shell.

Author
Message
Game Programming Beginner
20
Years of Service
User Offline
Joined: 18th Aug 2004
Location: USA VA
Posted: 20th Aug 2004 07:52
Hi and Thank you for looking to see if you can help me out. I’m trying to make a tank game in the time frame of WW1. I have been use the tutorial on the “monster hunt” as a guide to help me to make this game. It has help me to learn what some of the code is use for, but do get lost as to where to put the code at most of the time. It would help they put the full code at the end of the tutorial, so I can see where I was to place it. Ok now this is what I’m trying to do, I can’t get it to work for me.

1 When you press the left mouse button “soon it will be the F key” a shell from the tank will fire and if it hits nothing will explode some distance from the tank. And make a sound when fired.

2 Is there a tutorial on how to make an enemy randomly spawn?

Thank you in again for any help you can give me

WindowsXP Professional, AMD Athlon 2.500+ GHz CPU, 512 MB of RAM, GEForce2 MX 64mb of RAM. Let the Game's Begin...
MR AI
20
Years of Service
User Offline
Joined: 24th Jan 2004
Location:
Posted: 20th Aug 2004 08:27
I will help u but first tell me DBC or DBpro
Game Programming Beginner
20
Years of Service
User Offline
Joined: 18th Aug 2004
Location: USA VA
Posted: 20th Aug 2004 08:59
Thank you I have Dark Basic Professional Trial if it looks like I can get the hang all of this programming, I'm going to buy the Super Game Creator Pack 2004 hear so I can start to learn it.

WindowsXP Professional, AMD Athlon 2.500+ GHz CPU, 512 MB of RAM, GEForce2 MX 64mb of RAM. Let the Game's Begin...
MR AI
20
Years of Service
User Offline
Joined: 24th Jan 2004
Location:
Posted: 20th Aug 2004 09:25
Well i start by doing the same as u useing the monster hunt tut
all this like the forum did not exist when i started but I tryed and then tryed some more and I 2 years later i am still trying lol .

ok its pointless me just giving u the code u dont learn that way
I kow that the monster hunt tut shows you how to set up and fire objects if u dont kown where to look ,look for the code that ref to
bullets and bullet life (this is all from mem so it might be a bit off ) it also show's u how to do an explode and how to place a random enemy so its all in there if mem serve's me right.

just a note that tut was writen for DBC which was easy'er to learn than DBpro because it had a better help system.

just ask one question at a time and i will anwser if i can start with question's on basic programing would be the best place to start.for eg: wots a (main loop)

and stay in here i will be as quick as i can to respond
Game Programming Beginner
20
Years of Service
User Offline
Joined: 18th Aug 2004
Location: USA VA
Posted: 20th Aug 2004 10:04
Ok in the tut 3.4 its talking about making a bullet out of a sphere that I do know what they are talking about. The hide object I get to but where would you put it at I know that go before the main loop, I put in after Randomize the matrix that will make the map? It's when I put in the mouseclick at that point. I tryed to run the game at that point to see if the sphere would show up when I click bulleten nonthing happen so I thought that I need to put more of the code in but then get more errors when I did that


Rem Make bullet
Make Object Sphere 2,2
Hide Object 2 *I set this to show so I could see but did not work

if Mouseclick()=1 and BulletLife=0
Position object 2,X#,Y#+43,Z#
Set object to camera orientation 2
BulletLife =25
Show object 2
Endif

I'm slow at this keybord thing so I many not respond as fast as I may like to
we can start with that and go on from there.

WindowsXP Professional, AMD Athlon 2.500+ GHz CPU, 512 MB of RAM, GEForce2 MX 64mb of RAM. Let the Game's Begin...
Game Programming Beginner
20
Years of Service
User Offline
Joined: 18th Aug 2004
Location: USA VA
Posted: 20th Aug 2004 15:14
If this helps you to see my knowledge of programming, I had about 12 week of MS VB 6 in school. I do know a little bit about basic not much, but some of the commands I do get like If, loop, next, or, print and the like. It's just on how they fit in the big picture that always kicks my but at times. I hoping that DarkBasic will be a lot easier then VB was and the teacher we had went over our heads most of the time. But hey still got an b out it Getting in to this I know how some other game programmer fill when it all goes to pot on them. If anyono else can help out also I would appreciat that as well the more knowledge the better you our

I made a fast web page for this game if you like to see it click the link

[href]http://www.sierratel.com/martin/games/welcome_to_my_game_site.htm

WindowsXP Professional, AMD Athlon 2.500+ GHz CPU, 512 MB of RAM, GEForce2 MX 64mb of RAM. Let the Game's Begin...
MR AI
20
Years of Service
User Offline
Joined: 24th Jan 2004
Location:
Posted: 21st Aug 2004 20:42 Edited at: 21st Aug 2004 20:50
ok sorry i had somthing i need to do so i hope u still read this

Rem Make bullet
Make Object Sphere 2,2
Hide Object 2 *I set this to show so I could see but did not work*
you did not see it because u did not position it so it basicly could of been any where i think it was probly x,0 y,0 z,0 but that can be in the center of the map or at the corner depends on how u set it up !note the "make object" goes at the start of ur code before the main loop or u will get an error "object exist"

THE BULLET SET UP
if Mouseclick()=1 and BulletLife=0 *this "bulletlife=0" basicly checks to see if the object has gone as far as it can go with out this every time u clicked it would be pull back to the starting position*

Position object 2,X#,Y#+43,Z# *this positions the object u r useing for a bullet the X#,y#,z# are the varibles that store the cam or player position*

Set object to camera orientation 2 *this basicly points the object in the same direction as the cam so then u can control it because u know where it will go if u move it forward or back we can come back to this if u have more questions*

BulletLife =25 *this will lose u if i try to explain this now
but i will get to it in a min*

Show object 2 *we can now show the object because u will not see it just siting there*

Endif
(this code will only run every time u click and the bullet has gone as far as it is going to)

(the next code to basicly fire this thing will look some thing like this)

THE BULLET FIRE & MOVE
if bulletlife >0 *this will check to c if the bullet is active*

dec bulletlife *remmber that we gave this 25 well think like this , move points for the bullet and it dec this number every time the bullet or object is moved*

move object 2,5 *this moves the object or bullet as u will 5 world units*

if bulletlife =0 then hide object 2 *after the bullet has used up all its move points u dont what a bullet or object just siting there so we hide it but it will still be there untill we make the "BULLET SET UP" code run .

endif

As for tips on were to place code ie:what comes first and where.

anything that needs to be run or setup just once eg:make object can go before the "do loop or main loop" .
IN the main loop
next think about what needs to be done or set up before something else can happen ( just think what would happen if we did that bullet fire code in the wrong order it would be a mess)
plan your code on paper or in note pad or in your head.
when u first start dont try and see to far in to the code do it a bit at a time then link the code.
this may sound stupid but think of a program as a water fall the DObeing the top and the LOOPthe pump and the code in the middle directing the flow of where that water goes.

i will keep checking this post for a few days if u need any more help
sorry if any of this is patranizing (my spelling sucks )
keep trying and good luck
lee.
Game Programming Beginner
20
Years of Service
User Offline
Joined: 18th Aug 2004
Location: USA VA
Posted: 21st Aug 2004 22:45
Wow Mr AI AKA "lee" you gave me a lot of info, I love it I'm glad that you took the time to tall me what each line does Thanks. I was able to get the shell to come up about 2 am this morning, it was dumb luck that I got it. Wish that look at this sooner It would have helped. But this great because now I know why it works . It did feel great when I got it to work. Now I have been baging my head on getting it to move forword some distance away from the tank I thank it's some of that VB that's grtting in the way at times. I keep trying ues some of that and DBP don't like. But you can help me out with that I would very much appreciat it.

This is what I got so for



I made a quick web sit that shows what I have been doing.

http://www.sierratel.com/martin/games/welcome_to_my_game_site.htm

P.S. My spelling is not all that great too, but I have a good dictionary by me
Thanks again for the great info and the luck.

WindowsXP Professional, AMD Athlon 2.500+ GHz CPU, 512 MB of RAM, GEForce2 MX 64mb of RAM. Let the Game's Begin...
Game Programming Beginner
20
Years of Service
User Offline
Joined: 18th Aug 2004
Location: USA VA
Posted: 22nd Aug 2004 00:38
Hey Thanks Mr AI with you help I was able to get the shell to move away from the tank now. It was when I look at the info you give me that was
Quote: "Set object to camera orientation 2 *this basicly points the object in the same direction as the cam so then u can control it because u know where it will go if u move it forward or back we can come back to this if u have more questions* "

that was getting me all night I just needed to set the camera higher so the shell would move away from the tank. It is this line here if someone needs to use it too



I put in 32 where the 12.5 is.

well I have been up for 12 hours now I get to get some sleep now

WindowsXP Professional, AMD Athlon 2.500+ GHz CPU, 512 MB of RAM, GEForce2 MX 64mb of RAM. Let the Game's Begin...
Game Programming Beginner
20
Years of Service
User Offline
Joined: 18th Aug 2004
Location: USA VA
Posted: 22nd Aug 2004 10:20
Wow this is turning out to be Dark Basic 101 for me I love it , The poeple at Game Creators should thank you Mr. AI , becouse with your help on getting started with programming, as soon as I get paid I'm going to buy Dark Basic Pro and some other software to get going. When you said about puting your game on paper that is no joke when taking VB that help me out a lot, thats what I did when I first started this game. This is the list that I made.

1. Make a playing field
2. Put arrows as the Controls for moving
3. Put player on the map "the Tank" and move on map
4. Get tank to fire it's 25mm gun; add sound, smoke and explosion if it did hit anything.
5. Now put in enemy tank get it where if shell hits enemy it will explode enemy remove from map.
6. Put a AI for enemy tank, but not Mr. AI in tank have tank go after player.

This should give me a basic game engine

Now add a game, menu, trees, build.

Is this how you would put it on paper or is this a bad way to do it? If it is I can always start over.

I put more rem statements in the code to explain it better for future games that I make. Please take a look at and it and see if ok when you got the time.




This code will not work yet problem with the smoke particles I get an; runtime error 707 - object already exists at line 43

Make object plain x+10,5,5

This is part 3.7 of the tutorial in MH. Give me a day and see if I can get it, if maybe you or other person can help with.

WindowsXP Professional, AMD Athlon 2.500+ GHz CPU, 512 MB of RAM, GEForce2 MX 64mb of RAM. Let the Game's Begin...
MR AI
20
Years of Service
User Offline
Joined: 24th Jan 2004
Location:
Posted: 23rd Aug 2004 06:20
hi m8t ya problem is you r all ready uesing object 10 ie: (x) would start as 0 so x+10=10 u are trying to use the same object number twice make it +11 and all sould be good.

thanks for the nice reply u would be shocked at how many people dont
say a simple (thank you)

you'r rem note's look fine write as much as u can on that bit of code but as a tip in ( ) put what are in the varibles this way u don't have to back track through ur code to know where and what that varible is doing.

you'r planing look's good but that's just the basic start.
Brain storm at first then exspand on each area to how you are going to do each idea with a bit of quick exsample code on the key aspects on getting it to work.

my beloved A.I TIP number 1 nerver take it for granted that a varible is carring what u what it to.
Use the print command on varible's to make sure they are behaving
how u what them to trust me this will save u a lot of time it also should be used on array's to see if the data is being stored properly only try this if u are having trouble once you have sorted the problem get rid of the print they hurt ur frame rate .
TIP 2 all ways have ur programs frame rate displayed because if u dont u can write a bit of code and it would work but the cost could be higher than u know and there might be a way to optimize it.
TIP 3 look at you'r code and ask you'r self is there a better way of doing this for speed sake u what as little cammand's doing the same job also ask you'r self does this have to be done every loop
this is most commen with .A.I. killing ur frane rate.

I might not be in the forums for some time got to get back to some
major programing so I am going to give u my email any probs or basic chat or sling an idea at me (hope its A.I lol )then i will pleased to talk to u (darkengineer@fsmail.net)

ps write as much as u whant but be carefull to contact me before u send anything big c u later m8t

lee.
MR AI
20
Years of Service
User Offline
Joined: 24th Jan 2004
Location:
Posted: 23rd Aug 2004 07:22
post in here 1 more time so i know uv see my last post
Game Programming Beginner
20
Years of Service
User Offline
Joined: 18th Aug 2004
Location: USA VA
Posted: 23rd Aug 2004 14:19
Hey thinks for all the tips and help you gave me. I'll have to keep all of them in mind as I go. You and me must be think on the same wave-link because after I was looking at the code it dawn on that was the problem. I try putting in 12, 9, 13 and so on when I do that and press the lkey on the mouse the tank will jump all over the place It was funny to look at So then I tryed to make the tank object 1 or 2 with the arrows keys and all **** break loose whin I do that I have been on this now for 8 hours to no end. I hoping that I can find some book on DBP to get what some of the commands are about cause I so lost right now. Hope that you have better luck on your program then me with no bugs. Thanks for the e-mail always nice to have a few good friends in this programming world. If you like you can alwys shoot me one like a joke on programming or what ever. martin_g_01@hotmail.com I have a 2 mb limit on so can't get big files.

Good Luck and Fun with your project
Marty

WindowsXP Professional, AMD Athlon 2.500+ GHz CPU, 512 MB of RAM, GEForce2 MX 64mb of RAM. Let the Game's Begin...
MR AI
20
Years of Service
User Offline
Joined: 24th Jan 2004
Location:
Posted: 23rd Aug 2004 16:45
There is no book on DBpro yet but one is being writen but if u need help on a command do a search in the forum u got a 7 out of 10 chance some one has post about it before if not ask me by email
or post on the forum glad to see u r trying to solve the problems
you'r self thats all programming is end of story.
hopefully when u get up to speed (which i know u will) we can work on a project.
If u what a bit of advice buy DBpro but get a better graphics card the best u can aford because its my card that has heled up my game
on till now i just got a ATI 9800pro 256 by the time my current game
is done this will be years out of date lol hope to c u a round
here or hear from u

lee.

ps keep that keyboard smoking
Game Programming Beginner
20
Years of Service
User Offline
Joined: 18th Aug 2004
Location: USA VA
Posted: 23rd Aug 2004 18:06
Thanks lee I will do that, I can't DBP untill next week or maybe this thursday. I love ATI cards the one got now is ok it was free the best type there is. I plan to get a new one in about 12 weeks or so, but your right about having a very good vid card in your computer. I work on computers all the time for people and thats what I till them why there games will not work right or this to slow why can't I play it. Sounds cool about one day getting together on a project in the future. Don't let that vid card over heat with all of that gaming

Marty

WindowsXP Professional, AMD Athlon 2.500+ GHz CPU, 512 MB of RAM, GEForce2 MX 64mb of RAM. Let the Game's Begin...
MR AI
20
Years of Service
User Offline
Joined: 24th Jan 2004
Location:
Posted: 25th Aug 2004 13:39
now i am sure i post something in here after u but i think its been deleted any mods out there who deleted that post thanks for saying if u have not then i am going crazy as for my card overheating
no chance of that 100watt peliter and water cooled sits at about -10c lol if u what my MSN the give me a shout
Game Programming Beginner
20
Years of Service
User Offline
Joined: 18th Aug 2004
Location: USA VA
Posted: 25th Aug 2004 15:57
lol It be smoken tonight, you be playing to many game on that type of machine and have to much fun . I don't have MSN installed on my machine. Hey made a new Tager Tank for the game it's my 3rd 3D model I ever did. Came out ok I think take a look at my web site, see what you think. Have to UV it and put some good texture on it, but can't do that yet but give some time and I will.

WindowsXP Professional, AMD Athlon 2.500+ GHz CPU, 512 MB of RAM, GEForce2 MX 64mb of RAM. Let the Game's Begin...
MR AI
20
Years of Service
User Offline
Joined: 24th Jan 2004
Location:
Posted: 25th Aug 2004 22:01
http://www.sierratel.com/martin/games/welcome_to_my_game_site.htm
this right coz i get a ( 404er file not found ) i whent to c ur tank
but got this.
give us a shout when u have sorted it c u m8t
Game Programming Beginner
20
Years of Service
User Offline
Joined: 18th Aug 2004
Location: USA VA
Posted: 26th Aug 2004 04:34
I update my profile if you hit the web button it should take you their or hear is the address:

http://www.sierratel.com/martin/3dgames/world_Designer.htm

If you got some time I trying to get the tank to make sound when it moves, I tryed some of the ideas that I found on the forum but they do not work is there a way good way do do this?



I have tryed many ways that where on the forum but could not get it, or if you know a good tutorial thats out there. Or if someone out in this forum know a tutorial on sound and movement or can make one on this subject? I would appreciate any and all help on this

WindowsXP Professional, AMD Athlon 2.500+ GHz CPU, 512 MB of RAM, GEForce2 MX 64mb of RAM. Let the Game's Begin...
Sparda
20
Years of Service
User Offline
Joined: 13th Jan 2004
Location: Pacifica
Posted: 27th Aug 2004 23:40
Don't use object to object collision. You'll have rockets shooting right through people. Use rays, faster and more accurate.


Game Programming Beginner
20
Years of Service
User Offline
Joined: 18th Aug 2004
Location: USA VA
Posted: 28th Aug 2004 06:11
Hey thanks Konrad, but what an rays I don't think I heard that term before. As I'm new to this can you give me example of something like an rays? Any help is appreciate.

WindowsXP Professional, AMD Athlon 2.500+ GHz CPU, 512 MB of RAM, GEForce2 MX 64mb of RAM. Let the Game's Begin...
Sparda
20
Years of Service
User Offline
Joined: 13th Jan 2004
Location: Pacifica
Posted: 29th Aug 2004 01:30 Edited at: 29th Aug 2004 01:31
Rays are simply a method of testing for collision using a line of sight. Basically it's a line cast from one point to another.



Here, a ray is cast from point A to point B. There is nothing in the path for the ray to collide with.



Here the a second ray is cast from point C to D. Unfortunately there happens to be a wall in the way. Depending on how you use rays, you can get lots of info. Rays are best for testing collision for something that would use a line of sight method. Ex: A bullet travels in a straight line. Rays are also great because they return lots of other information. Like the distance of between the casting point and collision point as well as the angles any polygon.

There is only 1 ray command built in to db, the Intersect Object command. I would highly recommend paying the $10 for Nuclear Glory's dll.


Game Programming Beginner
20
Years of Service
User Offline
Joined: 18th Aug 2004
Location: USA VA
Posted: 29th Aug 2004 05:36
Hey Thanks Konrad, This helps me to understand a little bit about rays and what their for I will have to put them in. I have to start looking up on the forums to see how others use them in there programs to get idea how I can use them, Thanks for the tip I could use it . I'll have to wait on getting Nuclar Glory's dll just spent $210 on getting DBP and other programs hear, maybe in 2 or 3 weeks I can get it. I keep hearing about NG dll but was not sure what it was.

WindowsXP Professional, AMD Athlon 2.500+ GHz CPU, 512 MB of RAM, GEForce2 MX 64mb of RAM. Let the Game's Begin...
Sparda
20
Years of Service
User Offline
Joined: 13th Jan 2004
Location: Pacifica
Posted: 29th Aug 2004 13:50
Well if you've got $10, then NG is as good as yours.


Login to post a reply

Server time is: 2024-09-22 22:26:55
Your offset time is: 2024-09-22 22:26:55