Limping Player - Printable Version +- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum) +-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html) +--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html) +---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html) +---- Thread: Limping Player (/thread-19944.html) |
Limping Player - AKZEL - 01-15-2013 So I'm trying to imitate a limp player in the beginning of my CS. (will get healthy later, don't worry ) The problem is that the bodyforce I'm applying is always negative Z (backward force), no matter if the player is walking forwards, backwards or strafing. Code: void OnStart() Is there a way to get information about which direction the player is moving, or has someone else managed to script this effect without going full conversion..? //AKZEL RE: Limping Player - TheGreatCthulhu - 01-15-2013 I don't think there's a function which will give you the player's velocity vector, but, you can probably simulate limping without using AddPlayerBodyForce() - you could use these (together with timers) instead: PHP Code: // use this to modify the height of the "eyes" - some trial and error will be required RE: Limping Player - FlawlessHappiness - 01-15-2013 Also FadePlayerRollTo can be used RE: Limping Player - Kreekakon - 01-15-2013 If you want to simulate limping by using periodical deceleration, you can use this to alter the speed of the player without pushing him (The default speed is 1): SetPlayerMoveSpeedMul(float afMul); RE: Limping Player - TheGreatCthulhu - 01-15-2013 You can also use that function that gets the speed of the player to modulate the intensity of the head bobbing (you don't want it going up and down if you're standing still). RE: Limping Player - AKZEL - 01-16-2013 Hey, thanks for the replies! Yeah I managed to get a decent effect using only two SetPlayerSpeedMul and a couple of timers. (switching between two values if the player was moving). Adding a slight FadePlayerRollTo also made it more authentic, so thanks for that tip! I initially thought that it would create a rather jerky effect doing like this, and that I would have to use some kind of for-loop that would add or subtract the value gradually (like +/-0.1speedmul every 0.1sec or so). Stupid me for not trying the second-most easy method. (the PlayerBodyForce was just... um... dumb of me). Thanks again from a happy noob! |