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 / FPS shooting question

Author
Message
zeeenza
18
Years of Service
User Offline
Joined: 2nd Jul 2006
Location:
Posted: 4th Apr 2007 23:09
I read "The Newcomers Guide To Creating First Person Shooters" and it said for shooting to create a limb and check for intersection between it and the object. However one other tutorial I read (not on these forums) told me to create an object for a bullet like in the tutorial that comes with DBP. So I was wondering which is better? I'm having problems with both.

When I use the limb idea, I can shoot right through the matrix, walls, and all sorts of objects. Plus I would then be able to shoot multiple enemies at once if they were in a row.

When I use an object for a bullet, I want to be able to shoot an automatic weapon, not one bullet at a time like the tutorial. The only way to do that (that I could think of) was to shorten the bullet life, but then the bullet's range is so short that I have to be standing right in front of my target to be able to hit it.

Anyone have a solution to one (or both) of these problems?
MadSimon
17
Years of Service
User Offline
Joined: 5th Apr 2007
Location:
Posted: 5th Apr 2007 16:39
If you use objects as bullets, you can use more than one, so you don't need to shorten the bullet's life. Just load for example, 10 bullets, and then shoot them sequentially:

if mouseclick()=1
position object num,obj pos x(shooter),obj pos y(..),obj pos z(..)
rotate object num,obj angle x(shooter),obj angle y(..),obj angle z(..)
num=num+1
endif

then make the "num" variable cycle:
if num>10 then num=1

and move all the bullets:

for tot=1 to 10
move object tot,1
next tot

So every bullet can run for long distances before it's repositioned.
zeeenza
18
Years of Service
User Offline
Joined: 2nd Jul 2006
Location:
Posted: 6th Apr 2007 00:02
I thought of that but I wasn't quite sure how to do it. So I'll try that. Thanks
zeeenza
18
Years of Service
User Offline
Joined: 2nd Jul 2006
Location:
Posted: 7th Apr 2007 05:26
I'm having a little trouble getting that to work. Could someone please post a small example of how to use 10 bullets?

Login to post a reply

Server time is: 2024-11-25 20:27:28
Your offset time is: 2024-11-25 20:27:28