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 / the shooting and killing part

Author
Message
PAGAN_old
18
Years of Service
User Offline
Joined: 28th Jan 2006
Location: Capital of the Evil Empire
Posted: 8th Feb 2006 00:59
i am a noob at dark basic so i started practising on the tutorials. I wanted to make a simple space shooter, so i was referring to the "my first FPS" tutorial here on the tutorial page at the top. http://www.ruccus.net/Tutorial.htm
(space shooter and fps are almost the same thing)

so when it came to aming, shooting and killing the enemies i am stuck. basically what it told me to do is i had to have a limb in front of my charecter 500 units away from him (or more for higher shooting range) and it is supposed to detect if anything is between the limb and the charecter. and if there is and i click the enemy dies.

IF OBJECT EXIST(2)=1

IF INTERSECT OBJECT (2, LIMB POSITION X(1,1), LIMB POSITION Y(1,1), LIMB POSITION Z(1,1), OBJECT POSITION X(1),OBJECT POSITION Y(1), OBJECT POSITION Z(1))>0

DELETE OBJECT 2

ENDIF

ENDIF

this is what the tutorial told me to do but the "IF INTERSECT OBJECT (2, LIMB POSITION X(1,1), LIMB POSITION Y(1,1), LIMB POSITION Z(1,1), OBJECT POSITION X(1),OBJECT POSITION Y(1), OBJECT POSITION Z(1))>0" this invisible beam from the limb functionis only avaliable for DB PRO and i have DB 1.12

so i am wondering if there is another way around this shooting part? a different way to do the shooting

thanks

dont hate people who rip you off,cheat and get away with it, learn from them
smallg
Valued Member
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location: steam
Posted: 8th Feb 2006 15:48
the most common way is to make a small sphere with a collision box

and place it at the camera's co-ordinates

then set it to face the same way as the camera

then move it forward slowly

then check if it hits anything..


well that's the basics.... u'll need a little more but that should be enough to get u on your way.

here's the code all together..


life's one big game
spec= 1.6ghz, 512mb ram, 128mb gpu, directx 9.0c, dbpro and classic
PAGAN_old
18
Years of Service
User Offline
Joined: 28th Jan 2006
Location: Capital of the Evil Empire
Posted: 9th Feb 2006 00:10
cool thanks!

dont hate people who rip you off,cheat and get away with it, learn from them

Login to post a reply

Server time is: 2024-09-24 15:33:44
Your offset time is: 2024-09-24 15:33:44