GSC reference › Built-in
AssertMsg()
Built-in (engine)
Server + client
Utility
Throws a script error with the given message.
Signature
AssertMsg(<message>)
Parameters
| Name | Required? | Details |
|---|---|---|
| message | Required | error message |
Example (from Treyarch's docs)
AssertMsg( "Unhandled enemy type." )
Real uses in BO3's scripts
Called 156 times in the decompiled scripts. A few, zombies first:
- scripts/zm/_ambient.csc, line 399
assertmsg(("" + point.weaponinfo) + ""); - scripts/zm/_util.gsc, line 30
assertmsg(""); - scripts/zm/_zm.gsc, line 3943
assertmsg(""); - scripts/zm/_zm_ai_raz.gsc, line 177
assertmsg(""); - scripts/zm/_zm_ai_sentinel_drone.gsc, line 174
assertmsg("");
Related built-ins
- ErrorMsg()Throws a non-fatal script error with the given message.
- array()Create an array
- Assert()Assert that the given statement is correct.
- GetDvarInt()Gets the value of a dvar.
- IsArray()Checks whether this entity/variable is an array
- GetDvarString()Gets the value of a dvar.
- ArrayRemoveValue()Remove a value from an array (may affect multiple indexes)
- GetDvarFloat()Gets the value of a dvar.
- IsSubStr()Returns true/false if <substring> is a substring of <string>.
- GetArrayKeys()Returns an array consisting of the keys of the input array.
- ArrayCombine()Combine two arrays into and returns one new array
- IsInArray()Searches an array to determine if a given value is present in that array
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).