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 / Turn object command problems

Author
Message
stjerna
17
Years of Service
User Offline
Joined: 19th Oct 2007
Location: Norway
Posted: 14th May 2008 02:37
Hello.

Im having problems with the turn object command.



Everytime I turn left or right it turn around in this circle, moving. I just want it to turn left or right while standing still.
What do I do wrong ?

Thanks for you time
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 14th May 2008 07:14 Edited at: 14th May 2008 07:26
if that is, indeed, ALL the movement code you're using in your project, then it shouldn't "move" (forward/backward) at all. have you tried using other keys for the turn object parts? ie, trying WASD controls? if you reconfigure the keys and it works as intended, i'd bet your keyboard isn't, well, "compatable" with standard leftkey()/rightkey() input (which is why people tend to use the keystate and scancode commands over the arrow keys).

try this bit of code, too (use leftkey/rightkey to rotate the box):


if the words leftkey/rightkey show, then i think you've got a different issue and you'll need to show more of your code to get help.

Virtual Nomad
AMD XP 1800+ (~1.6 Ghz) / 1.5 GB RAM
ATI Radeon 8700LE 128 MB / Windows XP
jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 14th May 2008 15:25
Turn only rotates the object on its own axis...there is no movement at all. Here is your code back, with that factored into the mix.

Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 14th May 2008 20:45 Edited at: 14th May 2008 20:48
@jinzai, i think what's happening is identical to the result of what your code will cause, but stjerna states:

Quote: "
I just want it to turn left or right while standing still.
"


so, either his/her keys are acting weirdly, or there is more to the movement code than what was shared here (ie, a move object statement is made regardless of any key press), or, i am reading the "question" completely backwards, which is possible

i guess we'll know soon enough.

Virtual Nomad
AMD XP 1800+ (~1.6 Ghz) / 1.5 GB RAM
ATI Radeon 8700LE 128 MB / Windows XP
jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 14th May 2008 22:50 Edited at: 14th May 2008 22:53
NVM....let's just wait and see.
Cheers.
chafari
Valued Member
18
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 15th May 2008 00:39
Hallo friends....just try jinzai`s code again...you can stay still of work if needed.

chao



oh my god
stjerna
17
Years of Service
User Offline
Joined: 19th Oct 2007
Location: Norway
Posted: 16th May 2008 16:32
Sorry for not responding, been very busy lately.

Well i tryed your code Virtual Nomad, also jinzai with no luck. Still causes a wierd turn to the movement.

And yes it displayed "leftkey" and "rightkey" 100% sure it aint my keyboard.



Forward and backward is working perfectly normal, but as I said when I try turning the object it rotates in a circle and move at the same time rather than standing still and rotate around itself.

attached a picture to try and illustrat it, green line is how I want it to rotate and red is how it does rotate atm.

Thanks

Attachments

Login to view attachments
pcRaider
17
Years of Service
User Offline
Joined: 30th May 2007
Location:
Posted: 18th May 2008 14:19
Is your main character a car?
Veron
18
Years of Service
User Offline
Joined: 22nd Nov 2006
Location:
Posted: 18th May 2008 15:43
Quote: "Is your main character a car?"


This made my day.


jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 18th May 2008 15:49 Edited at: 19th May 2008 00:45
I don't know if its relevant, but your gosub routines have no returns, and the labels are supposed to be outside the main program.

Also, I've not seen multiple do/loops like that. It just looks very different from what I am accustomed to seeing, and I would expect it to crash after some time of gosub-ing without returning, which leaves the return address on the stack.
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 19th May 2008 00:01 Edited at: 19th May 2008 00:03
well, that is all the movement code, then.

now i'm wondering if your "bil.3ds" model's "center" is offset. THAT would definitely cause it to "drive in a circle" vs simply spinning on it's y-axis like it should.

so, did you build the model yourself? is it's center something you know how to check? otherwise, attach the model and someone here can check it.

Virtual Nomad
AMD XP 1800+ (~1.6 Ghz) / 1.5 GB RAM
ATI Radeon 8700LE 128 MB / Windows XP
stjerna
17
Years of Service
User Offline
Joined: 19th Oct 2007
Location: Norway
Posted: 19th May 2008 12:08
I dont see why I would have to make the movment code more fancy, all i want it to do is go forward, backward, turn left and right. why would I need anything more?

"bil.3ds" is center, im using 3ds max 2007 to chekc this, and im sure its not the problem either.

I really dont think you understand my problem here, guess this isn´t for much help as people make fun of my problem here.

And yes i know there is no return in the gosubs JET , this isn´t finished.

Lets just close this.. thanks anyway.
pcRaider
17
Years of Service
User Offline
Joined: 30th May 2007
Location:
Posted: 21st May 2008 18:33
Is a version of your DBP latest?

It does not understand me that you say.
Therefore it may be wrong.



Please say how it is different.
jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 21st May 2008 19:07
Didn't mean to insult you.
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 22nd May 2008 08:07
I have to agree with Virtual Nomad on this.

It certainly sounds like your object's centre of rotation isn't in the centre of the object.

TDK_Man

Login to post a reply

Server time is: 2024-11-25 23:47:45
Your offset time is: 2024-11-25 23:47:45