Background for Fallout 4
Member of the ScriptObject script
voidfunctionCallFunctionNoWait(stringasFuncName, var[]aParams)Native

Description

Wiki Description

Calls a function on this script asynchronously. Script execution continues immediately without waiting for the function you called to finish (or even start).

Documentation Comment

Calls a member function on this script without waiting for it to return. Note that the compiler
cannot check that the function exists, nor that the parameters are the right type. It will also not
be able to auto-cast, so you must pre-cast the parameters to the right type (derived or parent
types won't work). Will error if the function is not valid or doesn't exist on the object


Caveats

CK Wiki - Notes

  • If the 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 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 CallFunction instead.

Parameters

  1. stringasFuncName

    CK Wiki Description

    The name of the function to call

  2. var[]aParams

    CK Wiki Description

    The list of parameters to pass


Examples

; Call "Function LaunchFirework(int aHeight, float aTimer, Form aBaseObject)" on the "FourthOfJuly" script
; We use CastAs to make sure we don't depend on the script we want to call the function on 
ScriptObject celebration = CelebrationForm.CastAs("FourthOfJuly")
Var[] params = new Var[3]
params[0] = 10
params[1] = 11.0 ; Note the '.0' to make this a float
params[2] = RedBurst as Form ; Must cast as form by hand, even though explosion is derived from form
celebration.CallFunctionNoWait("LaunchFirework", params)
params[0] = 15
params[2] = BlueBurst as Form
celebration.CallFunctionNoWait("LaunchFirework", params)
; Now we have two copies of LaunchFirework running in parallel with us, each with different parameters

Auto-Generated Example

string myString__asFuncName
var[] myVarArray__aParams

myScriptObject__toCallFunctionOn.CallFunctionNoWait(myString__asFuncName, myVarArray__aParams)

Related Pages


Additional References

View this function’s page on the Fallout 4 Creation Kit Wiki

Some data provided by the Fallout 4 Creation Kit Wiki. Licensed under the Creative Commons Attribution-Share Alike 4.0 license.