Skip to content

error

Reports critical failures or invalid script states. This function alerts you to problems that require immediate attention during development.

The explicit call to log a critical failure.

ac.error("Failed to load configuration file")

ac.error functions similarly to ac.log, but it is intended for messages that signify a problem. In the Lua Debug app, messages sent via this function are highlighted in red, making them much easier to spot amidst regular status logs.

Messages are written to both the in-game console and the physical custom_shaders_patch.log file. Like other logging functions, its output to the physical file can be suppressed by using ac.setLogSilent. This is recommended if an error is occurring every frame to prevent potential performance degradation.

ParameterTypeRequiredDescription
...anyYesOne or more values to be stringified and logged.

Checking if a required scene node exists before attempting to manipulate it.

local carRoot = ac.findNodes("carRoot:0")
if carRoot:empty() then
ac.error("Critical: Could not find the player car root node!")
else
-- proceed with logic
end