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 Discussion / A going away gift that needs some fixing

Author
Message
Qualed Entertainment
20
Years of Service
User Offline
Joined: 17th Nov 2005
Location:
Posted: 14th Jul 2007 18:21 Edited at: 14th Jul 2007 18:23
Hello again,
I have a friend going away into the Air Force and I wanted to make him something. But I have a problem (like always). The F15 model I'm using won't rotate, so I have a F15 flying sideways. I would like to get this done today because tonight may be the last time I see him before he goes off to training.
All files and the code are attached.
Thank you in advance,
~Qualed

[edit] Also, I'm having a problem with my sky. I would like to have it so you can't fly through it, but I've tried all the collision types I could find.

A slight change..... Qualed Entertainment is no longer with us. The new name is Station 7 Produtions.
Libervurto
20
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 14th Jul 2007 19:04
You can't rotate it?
Have you tried rotating it to point forwards and then use FIX OBJECT PIVOT?

I am king of the noobs!
Qualed Entertainment
20
Years of Service
User Offline
Joined: 17th Nov 2005
Location:
Posted: 14th Jul 2007 19:12
I've tried to point the object in a direction and that didn't work. I've gone through the whole examples section and I haven't found anything that works.
If you haven't already, OBese, download the zip, it has everything you need. I really would appreciate it.

A slight change..... Qualed Entertainment is no longer with us. The new name is Station 7 Produtions.
Qualed Entertainment
20
Years of Service
User Offline
Joined: 17th Nov 2005
Location:
Posted: 14th Jul 2007 21:05
Normally I'm not one to post again without someone else saying something, but I would really appreciate anyone helping me figure this out. Like I said in the first post, I would like to get this done before 5 because tonight is the last night I am going to see him.

A slight change..... Qualed Entertainment is no longer with us. The new name is Station 7 Produtions.
Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 15th Jul 2007 00:49 Edited at: 15th Jul 2007 00:54
As far as the orientation of the plane, add two lines after
this section:


the lines to add being



And for the collision with the sky you can add this line


after



to do a 180 add go in the opposite direction right before the sync in the main DO LOOP:



Enjoy your day.
Station 7 Inc
18
Years of Service
User Offline
Joined: 15th Jul 2007
Location:
Posted: 15th Jul 2007 20:50
Latch, thank you so much for your help. I managed to figure something out for rotating yesterday, but yours works much better. Also, thank you for the collisions. May I ask one more thing though? Is it possible to make it so that the plane doesn't fly through the matix-ground?

Station 7 Inc. Your gaming partner, when need be...
Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 15th Jul 2007 23:12 Edited at: 15th Jul 2007 23:23
Quote: "May I ask one more thing though? Is it possible to make it so that the plane doesn't fly through the matix-ground?"


Since a matrix isn't an object per se in DBC, you have to check for collision by position and/or ground height. We'll check the position of the plane relative to the matrix ground height and say it's colliding if the plane's y value is less than the ground height (the y value the point on the matrix the plane is at). Using get ground height it's pretty easy. Add this line before the SYNC in the main do loop:



You don't have to have the plane just turn around, you could jump to a subroutine that processes a crash or something.


NOTE: Since you are using PLAINS as the sky, it's possible to have the airplane move through them without collision detection based on the speed of the airplane. This is because if it moves far enough in one iteration of a loop, it will be on one side of the sky, and then the other without ever having actually touched it. A better way to handle the collision is by checking where the airplane is (it's x y and z) and where the limits of the sky are in terms of x y and z.

pseudo code:


Enjoy your day.

Login to post a reply

Server time is: 2026-07-06 01:18:40
Your offset time is: 2026-07-06 01:18:40