Raised This Month: $32 Target: $400
 8% 

How to make a smooth stop?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
tonline_kms65
Member
Join Date: Aug 2016
Location: Ru. Komsomol-on-Amur
Old 09-17-2017 , 22:27   How to make a smooth stop?
Reply With Quote #1

Hello all !
How to make smooth stops, smooth braking after releasing the control keys?
tonline_kms65 is offline
sdz
Senior Member
Join Date: Feb 2012
Old 09-17-2017 , 23:31   Re: How to make a smooth stop?
Reply With Quote #2

You could decelerate bit by bit using OnGameFrame
sdz is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 09-17-2017 , 23:39   Re: How to make a smooth stop?
Reply With Quote #3

unless you're talking about sv_friction
Mitchell is offline
tonline_kms65
Member
Join Date: Aug 2016
Location: Ru. Komsomol-on-Amur
Old 09-17-2017 , 23:56   Re: How to make a smooth stop?
Reply With Quote #4

There is example code? Or something similar, can't think of how to make a sequel.

My code for the acceleration, a smooth increase in speed (counter fSpeedCount[idDrone]). I Use OnGameFrame.
PHP Code:
if (buttons IN_FORWARD){
    
OnButtonPressFRD(clientidDroneidDroneAnimbuttons); 
    }
//------------------------------------------------------------------------------
OnButtonPressFRD(int clientint idDroneint idDroneAnimint button){
      
DroneMoveForward(clientidDroneidDroneAnimbutton);         //a function of the forward movement
         
if(fSpeedCount[idDrone] <= fSpeedDrone)   fSpeedCount[idDrone] += 2.0;  
      } 

Last edited by tonline_kms65; 09-18-2017 at 00:05.
tonline_kms65 is offline
tonline_kms65
Member
Join Date: Aug 2016
Location: Ru. Komsomol-on-Amur
Old 09-18-2017 , 00:00   Re: How to make a smooth stop?
Reply With Quote #5

Quote:
Originally Posted by Mitchell View Post
unless you're talking about sv_friction
It sure is not.
tonline_kms65 is offline
hmmmmm
Great Tester of Whatever
Join Date: Mar 2017
Location: ...
Old 09-18-2017 , 04:53   Re: How to make a smooth stop?
Reply With Quote #6

What game you looking to do this in?
hmmmmm is offline
tonline_kms65
Member
Join Date: Aug 2016
Location: Ru. Komsomol-on-Amur
Old 09-19-2017 , 19:36   Re: How to make a smooth stop?
Reply With Quote #7

Quote:
Originally Posted by hmmmmm View Post
What game you looking to do this in?
Counter-Strike:Source
tonline_kms65 is offline
shavit
AlliedModders Donor
Join Date: Dec 2011
Location: Israel
Old 09-20-2017 , 06:18   Re: How to make a smooth stop?
Reply With Quote #8

i'm pretty sure sv_friction is the best method of smoothly stopping the movement, check this code: https://github.com/shavitush/noslide...ing/noslide.sp

edit: oh, cs:s. just apply this:
Code:
SetEntPropFloat(client, Prop_Send, "m_flStamina", 1320.0);
to make the player stop but still have proper client prediction applied
__________________
retired

Last edited by shavit; 09-20-2017 at 06:29.
shavit is offline
tonline_kms65
Member
Join Date: Aug 2016
Location: Ru. Komsomol-on-Amur
Old 09-21-2017 , 11:36   Re: How to make a smooth stop?
Reply With Quote #9

The problem I have solved.
Here is a Video of my solving the problem smooth acceleration and smooth stop

Last edited by tonline_kms65; 09-21-2017 at 11:44.
tonline_kms65 is offline
tonline_kms65
Member
Join Date: Aug 2016
Location: Ru. Komsomol-on-Amur
Old 09-21-2017 , 11:47   Re: How to make a smooth stop?
Reply With Quote #10

Quote:
Originally Posted by shavit View Post
i'm pretty sure sv_friction is the best method of smoothly stopping the movement, check this code: https://github.com/shavitush/noslide...ing/noslide.sp

edit: oh, cs:s. just apply this:
Code:
SetEntPropFloat(client, Prop_Send, "m_flStamina", 1320.0);
to make the player stop but still have proper client prediction applied
I never m_flStamina faced. Interesting.
tonline_kms65 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:01.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode