Cyberpunk FPS/RPG (Need Help!)

OK so I have been trying to build my own Template for a Cyberpunk themed FPS/RPG.

I haven’t gotten far and I already need some help with the player movement. When
ever I move the player with WASD the player will move, however there isn’t enough dampening to stop the player in a timely fashion after letting go of said moment key. If I go ahead an apply 0.999 dampening then the player will stop in an ideal time frame. Unfortunately that brakes jumping.

Is there some way to make it so that the player has 0.999 or 0.975 dampening when they are on the ground, and only when there on the ground? I copyed and edited the code from the FPS tamplate so the player can only move when they are on the ground, could I use this somehow?

The file is here:
http://www.megaupload.com/?d=Y4SPEKZ0

I would really like to do a lot with this template, unfortunetly there isen’t much to see right now.

You could just make it so when the WASD keys are not down you set the speed to zero.

All keys sensor, negative pulse mode -> And -> Servo, linV = 0, force min = -5, force max = 5, no force on Z axis

…or whatever trigger you want, like specific keyboard sensors with negative pulse mode

I tried the solution above and I am still having the same problem, it acted as if I had done nothing. So I tried to link it through the python script that allows the player to walk, and had some strange output but nothing that I wanted, I’m fairly noob python coder.

I noticed that it is indeed a force that is moving the player, the player acts more like a hockey puck being acted on by wind then a human walking. I can turn after letting go of the movement keys (WASD) and the player will still drift in that direction even if I rotate the player.

I think I might take a look at how some other FPS’s do a player walk, maybe I can make the player act more like a human then a hockey puck.

Thanks for the help, and if anyone has any more solutions I really appreciate the help! :smiley:

PlayerCharacter_slowdown.blend (856 KB)

I added the necessary logic blocks to the PlayerCharacter object.

Force limits needed to be 20/-20 to achieve rapid slowing, sorry.

This an example of how to implement this and will need proper setting up.

Main issue:
The keyboard sensor set to “all keys” and with an inverted pulse mode. ie. If the player is firing a gun, this will register as a pressed key and the slowdown actuator will not be triggered.

You need to set it up so that the slowdown actuator is only triggered when no movement keys are pressed.

The character can jump, but will slow down on the x and y axes when the jump key is released. To fix this, a near sensor and a “ground” property on the ground could be used. The sensor should only trigger when the character is on the ground.

Alternatively, the slowdown actuator could be triggered from within your script at the appropriate times.

Hope this helps.

Edit: The slowdown is not instant due to control using forces, I think this is more realistic. How many people do you know that come to an instant stop when they stop running? :wink:

Slowdown speed can be fine tuned by changing the force limits and by tweaking the PID values.