From the Fallout4 CreationKit Wiki
Jump to navigation Jump to search

Calls a Papyrus function on a script attached to the specified reference.

Syntax[edit | edit source]

<reference>.CallFunction <function> (<param1> <param2> <param3> <param4> <param5> <param6> <param7> <param8> <param9> <param10>)
<reference>.CF <function> (<param1> <param2> <param3> <param4> <param5> <param6> <param7> <param8> <param9> <param10>)

Parameters[edit | edit source]

  • Function: The function to call. The console tries to find the function on any scripts currently attached to the reference. If multiple scripts are found with the same function, you will have to clarify which script you mean with "script.function" syntax.
  • Param1 through Param10: (optional) The parameters to pass to the function in question.

Examples[edit | edit source]

myRef.CallFunction TestFunction
myRef.CF "TestScript.TestFunction" 10 1.4 "Hello World" myRef selected "MyQuest.Alias2"

Notes[edit | edit source]

  • The type and number of parameters are determined by the script function being called. The console will do its best to convert each parameter to the requested type.
  • If not enough parameters are passed, missing parameters will be filled with 0, 0.0, false, "", or None. They will not be filled with any defaults specified in the script (that data is inaccessible to the game).
  • Extra parameters will be ignored.
  • Var and array parameters are not supported.
  • ScriptObject parameters will attempt to resolve to forms first, then aliases.
  • You can pass "none" to alias or form parameters to pass nothing.
  • You can pass "selected" to give the function the currently selected ref in the console.
  • Aliases are passed by name and use the current console scope quest. If no scope quest is set or you want to pass an alias on a different quest you can use "quest.alias" syntax.
  • Any value the function returns is discarded.

See Also[edit | edit source]