View Single Post
Psyk0tik
Veteran Member
Join Date: May 2012
Location: Homeless
Old 12-23-2017 , 22:43   Re: Question: What is a ConVar.FloatValue's expected value?
Reply With Quote #7

Quote:
Originally Posted by 8guawong View Post
What are you doing in the callback?
Basically I'm just checking for how long and how far a player has been separated from their teammates. Once the player reaches the distance limit that is set by a cvar, a special infected is spawned behind them to "punish" them.

Spoiler


Though, the callback isn't the problem. I'm just wondering why setting the cvar value to 0.1 and using ConVar.FloatValue to retrieve it returns 0. I thought it'd be the same as manually setting the timer to 0.1.

I suppose when doing ConVar.BoolValue it works as follows: 0.9 (any number with 0 as the whole number rounds off to 0) ~= 0 = false, 1.1 (anything with 1 as the whole number rounds off to 1) ~= 1 = true (if true, that value will be used as the bool value).

And for ConVar.FloatValue, it seems to work as follows: 0.9 (any number with 0 as the whole number rounds off to 0) ~= 0 = false, 5.5 (1 or any value greater than 1) ~= 1 = true (if true, that value will be used as the float value).
__________________
Psyk0tik is offline