voidfunctionCallGlobalFunctionNoWait(stringasScriptName, stringasFuncName, var[]aParams)NativeGlobal
[DEV SERVER] Loading description...
Caveats
CK Wiki - Notes
- If the script name or function name don't exist, the function will error. You may want to check for the existence of the mod you want to talk to before using this.
- The parameter types must match exactly. You cannot insert a float into the param array if the function expects an int, or a Actor if the function expects an ObjectReference. Normally the compiler would do these casts for you in a normal function call, but it doesn't know what the parameters are, so it is your responsibility to match them up.
- The compiler cannot check the script name, function name, or parameters for you, so make sure to triple check everything!
- If you need the return value from the function you'll have to use Utility.CallGlobalFunction(...) instead.
Parameters
stringasScriptName
CK Wiki Description
The name of the script containing the function
stringasFuncName
CK Wiki Description
The name of the function to call
var[]aParams
CK Wiki Description
The list of parameters to pass
Examples
; Call "Function MakeEvenCooler(int aiValue, float afValue, From aItem) global"
; on script "CoolModScript" and don't wait for it to finish
Var[] params = new Var[3]
params[0] = 10
params[1] = 11.0 ; Note the '.0' to make this a float
params[2] = MyCoolArmor as Form ; Must cast as form by hand, even though armor is derived from form
Utility.CallGlobalFunctionNoWait("CoolModScript", "MakeEvenCooler", params)
params[2] = MyCoolWeapon as Form
Utility.CallGlobalFunctionNoWait("CoolModScript", "MakeEvenCooler", params)
; Now we have two copies of MakeEvenCooler running in parallel with us, each with different parametersAuto-Generated Example
string myString__asScriptName
string myString__asFuncName
var[] myVarArray__aParams
Utility.CallGlobalFunctionNoWait(myString__asScriptName, myString__asFuncName, myVarArray__aParams)Related Pages
Additional References
View this function’s page on the Fallout 4 Creation Kit Wiki
