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 / Player movement troubles...

Author
Message
Rage_Matrix
21
Years of Service
User Offline
Joined: 14th Dec 2002
Location: Brighton, UK.
Posted: 1st May 2004 19:39
(code attached)

Hi all,

I'm trying to sort out the movement of my player along the XZ plain. I'm using a cone to simulate the direction of the player mesh. The player can move in eight directions at 45 degree increments. Eventually, I hope to have the cone rotate smoothly between each of the eight points, but for now I'm just setting the angle to the cone object.
This sort of works okay, but the problem is when ANDing the keystates together for say, Up-Left or Down-Right, when I let go of the two keys, the cone angle seems to reset to looking Up, Left, Down or Right, while I would like it to stay at the angle it was moving in. This only affects the ANDing of two keystates and not if I just press Left or Up, Down or Right.
I think it might be to do with the IF/ELSE code to do with movement...



Can anyone give me any ideas on how to fix this? Perhaps its to do with the keystate being too sensitive....as in when I take my fingers off Up & Right cursor keys, one finger comes off later than the next, thus triggering either the Up keystate or the Right keystate and switching the angle.

Little help?

www.tronsoftware.co.uk
AMD Athlon XP 1700+, 180GB HDD, 512MB DDR RAM, ATI Radeon 9700 Pro 128MB DDR, Windows XP Pro, DirectX 9.0b
Rage_Matrix
21
Years of Service
User Offline
Joined: 14th Dec 2002
Location: Brighton, UK.
Posted: 2nd May 2004 06:41
Politest possible bump. I wouldn't usually resort to such newbie-style methods, but this is kinda average urgent.

Jeez....I *hate* sounding desperate on the forums.

www.tronsoftware.co.uk
AMD Athlon XP 1700+, 180GB HDD, 512MB DDR RAM, ATI Radeon 9700 Pro 128MB DDR, Windows XP Pro, DirectX 9.0b
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 2nd May 2004 07:42
Looks greek to me I thought you had to put the scancodes in the () after keystate. Or did you not post the whole code?

"People don't fail ..... they stop trying." Specs. P4 2.8GHz 800 FSB | 512MB DDR333
GeForce FX 5200 AGP 256MB | Windows XP Pro Full
Rage_Matrix
21
Years of Service
User Offline
Joined: 14th Dec 2002
Location: Brighton, UK.
Posted: 2nd May 2004 07:44 Edited at: 2nd May 2004 07:45
The entire shebang is included in the source button thingy. The thing that might have thrown you is I'm using constants in the keystate function to replace the scancodes. Easier to remember that way. Anyway, its all in the source if you fancy taking a look in the spirit of charity.

www.tronsoftware.co.uk
AMD Athlon XP 1700+, 180GB HDD, 512MB DDR RAM, ATI Radeon 9700 Pro 128MB DDR, Windows XP Pro, DirectX 9.0b
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 2nd May 2004 08:58 Edited at: 2nd May 2004 08:59
I would make a second version of the code and take the player movement stuff out of a function - try this with a DO-LOOP. Yes theoretically it should all work but with dbp dodgy scope and other issues try a more straight forward approach. Then see if you have a different result

my $0.02


** DBP_NETLIB_v1 PLUGIN - FULL VERSION RELEASED! ** Mooooooo!
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 2nd May 2004 12:01
This works but might not be what you want.


"People don't fail ..... they stop trying." Specs. P4 2.8GHz 800 FSB | 512MB DDR333
GeForce FX 5200 AGP 256MB | Windows XP Pro Full
Rage_Matrix
21
Years of Service
User Offline
Joined: 14th Dec 2002
Location: Brighton, UK.
Posted: 2nd May 2004 15:47
Hey, thanks. Thats fixed it fine.

www.tronsoftware.co.uk
AMD Athlon XP 1700+, 180GB HDD, 512MB DDR RAM, ATI Radeon 9700 Pro 128MB DDR, Windows XP Pro, DirectX 9.0b
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 2nd May 2004 23:58
Glad I could help.

"People don't fail ..... they stop trying." Specs. P4 2.8GHz 800 FSB | 512MB DDR333
GeForce FX 5200 AGP 256MB | Windows XP Pro Full

Login to post a reply

Server time is: 2024-11-26 17:19:40
Your offset time is: 2024-11-26 17:19:40