GSC reference › Built-in
Ceil()
Built-in (engine)
Server + client
Math
Returns the ceiling of floating point value <a>. This effectively rounds up Ceil(2.7) == 3, Ceil(3.9) == 4.
Signature
Ceil(<a>)
Parameters
| Name | Required? | Details |
|---|---|---|
| a | Required | A float or integer value. |
Returns
Returns the ceiling of floating point value <a>.
Example (from Treyarch's docs)
rounded_down = Floor( val )
Real uses in BO3's scripts
Called 22 times in the decompiled scripts. A few, zombies first:
- scripts/zm/_zm_laststand.gsc, line 1717
weighted_down = int(1000 / (ceil(level.round_number / 5))); - scripts/zm/gametypes/_globallogic_score.gsc, line 1015
assist_level_value = int(ceil(damagedone / 25)); - scripts/zm/gametypes/_globallogic_spawn.gsc, line 169
numwaves = ceil(numwavespassedearliestspawntime); - scripts/shared/_oob.gsc, line 356
oob_effectvalue = ceil(oob_effectvalue * 31); - scripts/shared/ai/archetype_utility.gsc, line 606
angletonode = ceil(angleclamp180(self.angles[1] - self getnodeoffsetangles(self.node)[1]));
Related built-ins
- Int()Casts a floating point number or a string to an integer
- RandomFloatRange()Returns a random floating point number r, where min <= r < max
- DistanceSquared()Returns the squared distance between two points - this is cheaper than the actual distance as it doesn't involve a square root
- RandomInt()Returns a random integer between 0 and max-1 inclusive
- RandomIntRange()Returns a random integer r, where min <= r < max
- AnglesToForward()Returns the forward vector corresponding to a set of angles.
- VectorNormalize()Returns a normalized copy of this vector
- Abs()Returns the absolute value of a float
- Distance2DSquared()Returns the squared distance between two points, ignores height difference.
- Distance()Returns the distance between two points
- VectorDot()Returns the dot product of two vectors
- VectortoAngles()Returns a set of angles corresponding to the given vector.
New to GSC?
Start with the basics, or paste a compile error to get the fix.
Built-in descriptions, parameters and examples come from Treyarch's BO3 mod tools docs. Usage links point at shiversoftdev/t7-source (decompiled BO3 scripts).