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 / im sorry for bothering people on these forums but......

Author
Message
bigfish58
20
Years of Service
User Offline
Joined: 25th Dec 2004
Location:
Posted: 28th Dec 2004 17:56
hi

im really sorry for bothering all of you guys on this forum, you have all been really big helps, but i need just 1 more thing:

i have a gun object (in a .x file), if i wanted to make the gun shoot out a bullet, would i have to edit the .x file??

cheers
Joe Cooning
22
Years of Service
User Offline
Joined: 29th Mar 2003
Location: United States
Posted: 29th Dec 2004 01:13
No. just load the gun, and the bullet can be a totally seperate object.

Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 29th Dec 2004 10:44
Expanding on what Joe said;

What you want to do for bullets, is load in your .x gun model, position it to where it should be ( such as to the side for an FPS ), then you want to make some cubes, or possibly plains for the bullets.

Next, you want to position the bullets at the same spot as the gun, and point it in the same direction ( rotate it ).

Next, you need to sort out some bullet code ( search this page, and you'll find some usefull code to help you if you get stuck ), which will take care of the bullet's movement, and if it hits anything.

Then, you want to simply do something if the bullet his anything

An alternative method ( if you want to have realistic fireing, where the bullet moves so fast you can't see it ), is to use Ray Casting. This, however, involves either some vector math ( if you know how to ), or alot of fiddling around with moving objects, and wastefull code.

Jess.


Team EOD :: Programmer/All-Round Nice Guy
Aust. Convention!

Login to post a reply

Server time is: 2025-05-24 10:27:18
Your offset time is: 2025-05-24 10:27:18