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 / Why won't this code work right?

Author
Message
Duke Blue Devils
20
Years of Service
User Offline
Joined: 11th Mar 2006
Location:
Posted: 9th Feb 2007 23:50
I made this function designed to essentially lock the position of a gun to the right side of the screen without using the lock object command. I asked some people to test it because it wasn't working right for me (it doesn't rotate according to the orientation of the camera) and it worked for people using DBP but not DBC. What's the problem? I've tried about a million things but the stupid gun just won't rotate correctly.




Visit the official Chicago Rush website
http://chicagorush.servegame.com/index.php
Duke Blue Devils
20
Years of Service
User Offline
Joined: 11th Mar 2006
Location:
Posted: 25th Feb 2007 18:28
C'mon please doesn't somebody have an idea?

Your signature has been erased by a mod
Creator Of Darkness
19
Years of Service
User Offline
Joined: 4th Jan 2007
Location:
Posted: 26th Feb 2007 22:20
How is anyone supposed to test it without the gun or the code controling camera position like cx, cy, cz?
Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 27th Feb 2007 06:00 Edited at: 7th Mar 2007 01:19
@Duke,

[Edit - see next message]

Enjoy your day.
Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 7th Mar 2007 01:18
Looked at the math. It seems ok, but I had some trouble wrapping my brain around it. I tried a bunch of different things and kept asking "why is the rotation changing when I get past a certain angle?" Then it dawned on me. The order of rotations is very important.

Put this line at the top of your function:

set object rotation zyx object_num

Should fix the problem! Here's some example code with the addition:



Enjoy your day.
Duke Blue Devils
20
Years of Service
User Offline
Joined: 11th Mar 2006
Location:
Posted: 8th Mar 2007 03:34
Unbelievable, I was going out of my mind trying to get it to work. Thank you so much. I owe you one.



Login to post a reply

Server time is: 2026-07-06 06:42:59
Your offset time is: 2026-07-06 06:42:59