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.

DarkBASIC Professional Discussion / 1st Person Racing game: Having alot of problems in general!!

Author
Message
Mike Schlueter
19
Years of Service
User Offline
Joined: 28th Nov 2005
Location: Somewhere that I\'m not suppose to be
Posted: 8th Jan 2010 20:53
Well after the many helpful tips that were given to me on my previous threads, I was able to come up with this program below.
(Warning, its a fair read)



Problem A: I've commented out My functions as I found they weren't working for some reason. I'm not too familiar with them, so I probaly missed something there.

Problem B: My Physic aren't working correctly. The Cars do funky rotations on just the flat plain(Grnd) and I've spent a day and a half trying to figure out what is wrong with no luck.
I've also commented this part out of the loop.

Problem C: So when I couldn't get the 2 fellas above working, I moved on to see if I could get the AI working. So I copied the code from the function and decided to see what error I'd get from this if any. Sure enough, at line 132 object already exists. Considering the the first object made is 302 (it was at 202, but I moved it up 100 units to try and fix it, which didn't work), and I had not programed any object higher than 100, I was completely stumped.
This I commented out as well and then played around with the AoR variable and found the Max and Mins for racers.

Well I'll thank you all ahead of time for looking through and finding what I can't. Oh and I have the Car object on the download thingy, and it's image on the post below. You'll have to edit the file name for the object path in the SETUP section of the code or just put it in a folder called "Beach Bug 2" or if you have darkMATTER you can find it in vehicles as beach bug 2 and avoid the whole download process altogether.

Mike

If you've noticed this notice, you will have noticed that this notice was not worth noticing.
Mike Schlueter
19
Years of Service
User Offline
Joined: 28th Nov 2005
Location: Somewhere that I\'m not suppose to be
Posted: 8th Jan 2010 20:53
Here the pic

If you've noticed this notice, you will have noticed that this notice was not worth noticing.
Mike Schlueter
19
Years of Service
User Offline
Joined: 28th Nov 2005
Location: Somewhere that I\'m not suppose to be
Posted: 10th Jan 2010 16:04
Bump

If you've noticed this notice, you will have noticed that this notice was not worth noticing.
paul5147
19
Years of Service
User Offline
Joined: 11th Jan 2006
Location: Hot & Sunny
Posted: 10th Jan 2010 21:32 Edited at: 10th Jan 2010 21:37
Hi Mike,try reading up a bit on the variable types that can be accessed from within functions.
Theres 2 types basicly "local" and "global",if you want to use the same variable within your main loop and your functions then the variable needs to be declared as global first.

Doing this meens any changes to the variables you make within a function also applies to the rest of your code.
Otherwise whatever variables you use within your function will cease to exist once the function is exited they are whats called "local".

hope this helps a bit
Mike Schlueter
19
Years of Service
User Offline
Joined: 28th Nov 2005
Location: Somewhere that I\'m not suppose to be
Posted: 15th Jan 2010 18:08
Thanks Paul. I haven't been able to try that out, been too busy in the past while.

If you've noticed this notice, you will have noticed that this notice was not worth noticing.
Mike Schlueter
19
Years of Service
User Offline
Joined: 28th Nov 2005
Location: Somewhere that I\'m not suppose to be
Posted: 18th Jan 2010 17:38
Anyone have the slightest idea on the other 2 problems??

If you've noticed this notice, you will have noticed that this notice was not worth noticing.
paul5147
19
Years of Service
User Offline
Joined: 11th Jan 2006
Location: Hot & Sunny
Posted: 18th Jan 2010 21:42 Edited at: 18th Jan 2010 21:43
Small bit of code to show how the functions work in the way you need them to.Remember that any variables you need to use in you function and your main loop need to be defined as global before you use them.Try to build on this,the object i use for the car has 4 limbs for wheels just the same as the model you use except there numbered 1 to 4.
Theres no AI for the other cars and no atempt at physics either,the AI is easy enought to do if all you need is a few waypoints and you simply turn the car to point at the next one when one is reached.
The physics is a lot more complicated then your code is trying to implement and there are some free plugins that can make the job a lot easier(sparkys collision and ezrotate free).sparkys is probably the simplest and best,once set up the 4 points of contact such as the wheels can be found on any terrain and the body rotated from the results obtained to allign it with the ground.
If you need a demo of it in action then let me know.

Login to post a reply

Server time is: 2025-08-09 01:58:45
Your offset time is: 2025-08-09 01:58:45