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.

3 Dimensional Chat / control gun firing help needed!! (code provided)

Author
Message
ssj3_shadow
22
Years of Service
User Offline
Joined: 12th Jan 2003
Location:
Posted: 10th Oct 2003 04:31
i need help with controling a gun firig "multiple bullets" from a gun,the bullet works fine but i need to fire multiple bullets, see code provided, i need to shoot a maximum of 10 bullets a time. help if u can, thanks in advance

w00t -what does it mean?
Shadow Robert
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 10th Oct 2003 05:33
well all you have to do is create an array for the bullets, don't worry about the animation just do an alpha flash whenever a new bullet is created/fired

ssj3_shadow
22
Years of Service
User Offline
Joined: 12th Jan 2003
Location:
Posted: 10th Oct 2003 06:03
my code is fine for firing a bullet, i have created 10 bullets to use
i just cant edit my code to the point that it fires the bullets correctly and when the 10th is fired it starts again at the first, any editions to my code would be much appreciated

w00t -what does it mean?
JeroenNL
21
Years of Service
User Offline
Joined: 4th Sep 2003
Location:
Posted: 10th Oct 2003 13:15
I think you're not using a good algorithm. What you need to do is something like this:

* create an array which can hold all bullets being fired

Then somewhere in your rendering pipeline:

* handle all bullets in the array, checking if they hit something or if they go out of range
* if they hit something or go out of range, remove them from the bullet array (and handle the impact if needed)

And whenever you fire a bullet do this:

* add it to the array of bullets

That way you can have an unlimited amount of bullets flying around at a given time.

Use DeleD to get skilled in 3d editing! Visit http://www.gamefortress.com/delgine for more info.
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 10th Oct 2003 14:06
You've actually pretty much done it already, you just have to change the bullet your using everytime you fire, then move each bullet seperately.

Try this and see what it does:



HTH,


Van-B

ssj3_shadow
22
Years of Service
User Offline
Joined: 12th Jan 2003
Location:
Posted: 10th Oct 2003 14:54
thanks for the replies, they really helped.
JeroenNL - i have created a new algorithm that workes perfectly, bullets ahoy!!!, now all i need is for tgc to fix up the collision in bsps...

thanks again

w00t -what does it mean?

Login to post a reply

Server time is: 2025-06-27 04:41:26
Your offset time is: 2025-06-27 04:41:26