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 / Bullet direction problem

Author
Message
Justice
20
Years of Service
User Offline
Joined: 22nd Jun 2004
Location:
Posted: 7th May 2009 15:48 Edited at: 7th May 2009 18:45
Hi,

i have a piece of code that lets me walk around my 3dworld (works great).

I can point my gun using the mouse (360 degrees) and fire a bullet at what im pointing at (by pressing the control key).

My problem is that sometimes when for example im pointing my gun up or down it just shoots straight forward. (sometimes it works !!)
When i turn left or right and keep fireing sometimes the bullets get higher and higher ?


Can anyone spot my error in my code, as its starting to drive me crazy

Attachments

Login to view attachments
bobbel
15
Years of Service
User Offline
Joined: 5th Jan 2009
Location: In my DBPro case xD
Posted: 7th May 2009 21:04
well, i can't spot the error, but i think it has something to do with the anglex# variable, it somehow gets resetted so the bullet x angle is 0

(\__/)
(O.o )
(> < ) This is Bunny. Copy Bunny into your signature to help him on his way to world domination!
Justice
20
Years of Service
User Offline
Joined: 22nd Jun 2004
Location:
Posted: 7th May 2009 22:55
Thats what i thought it was but ive tried changing it and it hasn't made it any better
James H
17
Years of Service
User Offline
Joined: 21st Apr 2007
Location: St Helens
Posted: 8th May 2009 05:44
Your functions are missing in the download(if you intended to include them). There seem to be lots of simple functions that only appear to do simple things - what else do they do? example this function "moveobjectrightpro(2,10)" surely this doesn`t just move object 2 right 10 units?
I haven`t spent too much time looking through the code but line 167 is a function "rotateobjectpro(bullet_obj,0,angley#-180,anglex#)" - is anglex# meant to be in the z slot or is that the x slot - also if the case is its in the wrong place then the x slot is set to 0. Might be best to post the functions. Have you considered writing a much smaller piece of code that just rotates the camera in an empty scene with bullets that fire in the camera direction? Do you really have to use visible bullets?
Justice
20
Years of Service
User Offline
Joined: 22nd Jun 2004
Location:
Posted: 8th May 2009 08:50
The functions are all NuclearGlory functions !!

Ive put this post on the NGC website, i think they might be able to help me

Login to post a reply

Server time is: 2024-11-24 08:40:41
Your offset time is: 2024-11-24 08:40:41