GSC reference › Built-in
GetMinBitCountForNum()
Built-in (engine)
Server + client
Math
Returns the minimum number of bits needed to express the provided integer
Signature
GetMinBitCountForNum(<uint>)
Parameters
| Name | Required? | Details |
|---|---|---|
| uint | Required | The integer a minimum bit count is needed for |
Example (from Treyarch's docs)
GetMinBitCountForNum( 15 ) returns 4
Real uses in BO3's scripts
Called 182 times in the decompiled scripts. A few, zombies first:
- scripts/zm/_zm.csc, line 488
bits = getminbitcountfornum(power.size + 1); - scripts/zm/_zm.gsc, line 1822
bits = getminbitcountfornum(trigs.size + 1); - scripts/zm/_zm_ai_spiders.csc, line 82
clientfield::register("scriptmover", "play_spider_web_tear_fx", 9000, getminbitcountfornum(4), "int", &play_spider_web_tear_fx, 0, 0); - scripts/zm/_zm_ai_spiders.gsc, line 118
clientfield::register("scriptmover", "play_spider_web_tear_fx", 9000, getminbitcountfornum(4), "int"); - scripts/zm/_zm_score.gsc, line 151
clientfield::register("clientuimodel", (("PlayerList.client" + i) + ".score_cf_") + name, version, getminbitcountfornum(max_count), "coun...
Related built-ins
- StopForceStreamingXModel()Forces the streamer to load model and texture LODs for a model even if it isn't yet visible.
- GetBitsForAngle()Gets the compressed bits for an angle with <num bits> granularity
- GetBodyAccentColorCountForHero()Returns the number of accents for the specified body model of a specific hero
- GetHelmetAccentColorCountForHero()Returns the number of accents for the specified helmet model of a specific hero
- GetNumberOfCollectiblesForLevel()Returns the number of collectibles for the given level
- StopForceStreamingMaterial()Forces the streamer to load the texture LODs for a material even if it isn't yet visible.
- 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.
- Min()Returns whichever of <a> or <b> is smallest.
- ForwardRotateAroundUpByAngle()Returns a vector that is the result of angles1 forward vector rotated around its up by degrees
- GetEntityNumber()Get the entity number of the entity
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).