Function; Rule_Add - HWRM/KarosGraveyard GitHub Wiki

Rule_Add(<function_name>)

Description

Calls a named function every game tick. The name of the function is case-sensitive.

Rule_Add should probably not be used, see Rule_AddInterval instead.

⚠️ The named function needs to be globally defined in the same scope as the code using Rule_Add. The easiest ways to do this are to just write these functions in the same file as the usage of Rule_Add, or to seperate them into other files and import them via dofilepath/doscanpath.

Arguments

Param Type Description
function_name string The name of a function. This function needs to be globally available. Casing DOES matter.

Example

function updateTimer()
 -- your code here...
end

-- elsewhere...
-- calls our 'updateTimer' function every game tick:
Rule_Add("updateTimer");

Related Pages