Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rounding off.
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#3
RE: Rounding off.

My guess would be for such a function to work like so:

You input the floor(2.7f) into where you need it to be rounded, and it will return 2. For example:

PHP Code: (Select All)
int iHealthRounded floor(50.5f); //or whatever number you want to round.
float fHealth iHealthRounded;

SetPlayerHealth(fHealth); 

As you probably know, integers can't contain decimals, whereas floats can. It looks like this script simply converts the float (decimal) value to an integer, which kills off the decimal. I'm unsure if this conversion will automatically assume the closest full number or just ignore the decimal though.

Don't forget to have that line Rom posted somewhere in your file.

(This post was last modified: 08-25-2014, 12:25 AM by Mudbill.)
08-24-2014, 05:55 PM
Find


Messages In This Thread
Rounding off. - by FlawlessHappiness - 08-24-2014, 04:33 PM
RE: Rounding off. - by Romulator - 08-24-2014, 04:55 PM
RE: Rounding off. - by Mudbill - 08-24-2014, 05:55 PM
RE: Rounding off. - by FlawlessHappiness - 08-24-2014, 07:07 PM
RE: Rounding off. - by Mudbill - 08-24-2014, 07:58 PM
RE: Rounding off. - by FlawlessHappiness - 08-24-2014, 10:27 PM
RE: Rounding off. - by MrBehemoth - 08-24-2014, 11:16 PM
RE: Rounding off. - by Daemian - 08-24-2014, 11:40 PM
RE: Rounding off. - by MrBehemoth - 08-25-2014, 12:25 AM
RE: Rounding off. - by FlawlessHappiness - 08-25-2014, 12:00 PM
RE: Rounding off. - by TheGreatCthulhu - 08-25-2014, 05:34 PM
RE: Rounding off. - by Romulator - 08-26-2014, 04:21 PM



Users browsing this thread: 1 Guest(s)