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 Professional Discussion / Possible bug in the move object command

Author
Message
Beta1
22
Years of Service
User Offline
Joined: 28th Dec 2002
Location:
Posted: 11th Feb 2003 00:53
There seems to be something screwy here.



This should make a box that you can drive around with the arrow keys - the matrix is just there to make the movement more more clear. But what happens on my system is that the object moves OK for a bit but then gets stuck in somesort of weird vibrating effect if you try and turn then move.

Another thing why isnt there a list of reported issues on the board somewhere to stop people repeatedly posting the same bugs, and why no search function - if there was one I would have searched befor posting...
the architect
22
Years of Service
User Offline
Joined: 6th Jan 2003
Location: United Kingdom
Posted: 11th Feb 2003 01:16
Try using the keystate() command to register key strokes. This will make control much smoother. The named key commands make control jerkey and poor/

You can aquire keystate() values for keys by using scancode() results.
ie key_value=scancode()

note it down and then

if keystate(key_value)=1 then

in other words scancode is like a numerical inkey$()

Look them up. They are far better than the direct key pressed options.

Beta1
22
Years of Service
User Offline
Joined: 28th Dec 2002
Location:
Posted: 11th Feb 2003 14:45
Yep but I dont think thats whats causing the error here - I'm just using upkey() etc as a quick way of demonstrating the problem.

If move works properly the object should continue to move in a straight line - it doesnt.

Archon
22
Years of Service
User Offline
Joined: 4th Feb 2003
Location: Finland
Posted: 11th Feb 2003 15:46
in old db "if upkey() then" needs to be "if upkey()=1 then"
try that

-A

"death is my meat; terror is my wine"
-Asdrubael vect of the Black heart
Richard Davey
Retired Moderator
23
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 11th Feb 2003 15:51
Actually, even in old DB, "if upkey()" is valid and doesn't need the =1 part. The reason why is that =1 is the same thing as saying TRUE and the "if" command checks for this automatically.

Cheers,

Rich

"Gentlemen, we are about to short-circuit the Universe!"
DB Team / Atari ST / DarkForge / Retro Gaming
Beta1
22
Years of Service
User Offline
Joined: 28th Dec 2002
Location:
Posted: 11th Feb 2003 15:54
So was I right then - is this a bug or am I missng something?

Beta1
22
Years of Service
User Offline
Joined: 28th Dec 2002
Location:
Posted: 11th Feb 2003 15:54
other than the "i" in missing in the last post

Richard Davey
Retired Moderator
23
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 11th Feb 2003 16:16
You're right to use the upkey() etc like that, but if you try the following you'll find the rest of it works too:



Cheers,

Rich

"Gentlemen, we are about to short-circuit the Universe!"
DB Team / Atari ST / DarkForge / Retro Gaming
Beta1
22
Years of Service
User Offline
Joined: 28th Dec 2002
Location:
Posted: 11th Feb 2003 16:25
ok I'll try it tonight but I'm not convinced thats the problem.

Richard Davey
Retired Moderator
23
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 11th Feb 2003 18:36
*shrugs* fair enough, but the code I posted works.

Cheers,

Rich

"Gentlemen, we are about to short-circuit the Universe!"
DB Team / Atari ST / DarkForge / Retro Gaming
Beta1
22
Years of Service
User Offline
Joined: 28th Dec 2002
Location:
Posted: 11th Feb 2003 21:48
ok - I admit it your code does work but....

Acording to the command the turn object left 1,1 should turn the object to its left by 1 degree then the move should move it forward. In my first code the move works fine unless you first turn the object then it doesnt. The turn/move combo should work together but for some reaon doesnt...

Fluffy Paul
22
Years of Service
User Offline
Joined: 16th Dec 2002
Location: United Kingdom
Posted: 11th Feb 2003 23:44
As an aside... when doing a logical AND on two variables it won't return true unless both the variables have the same value. Simply being above zero isn't enough e.g.

if a and b then ...
won't trigger the "then" if a!=b or if both a and b are zero.

Ending a sentence with a French word is so passé
MrTAToad
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 11th Feb 2003 23:53
Because its trying to do a boolean operation on the two variables...

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!
MrTAToad
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 11th Feb 2003 23:54
It shouldn't (because there is the && command)...

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!
wargamer
22
Years of Service
User Offline
Joined: 7th Jan 2003
Location: United Kingdom
Posted: 12th Feb 2003 14:21
I have hit this one too - MOVE OBJECT doesn't work after TURN OBJECT commands (and I think also PITCH and ROLL). This another of the many BASIC 3d bugs that will be fixed in Patch 4.

A related bug is that object rotation order is stuck on ZYX, when the default is supposed to be XYZ. You can't change it to XYZ either. Another Patch 4 fix, Lee has told me.

AMD Athlon 1600+, 256MB, GeForce 3
Beta1
22
Years of Service
User Offline
Joined: 28th Dec 2002
Location:
Posted: 13th Feb 2003 16:42
I had a suspiscion pitch and roll were screwy - have had to find a horrible work around. Fortunately it only causes some odd graphical glitches in my program which when the command gets fixed I can sort out

Login to post a reply

Server time is: 2025-05-18 00:07:09
Your offset time is: 2025-05-18 00:07:09