CallGlobalFunction

From the Fallout4 CreationKit Wiki
Jump to navigation Jump to search

Calls a global Papyrus function.

Syntax[edit | edit source]

CallGlobalFunction <function> (<param1> <param2> <param3> <param4> <param5> <param6> <param7> <param8> <param9> <param10>)
CGPF <function> (<param1> <param2> <param3> <param4> <param5> <param6> <param7> <param8> <param9> <param10>)

Parameters[edit | edit source]

  • Function: The function to call. This must be in "script.function" syntax.
  • Param1 through Param10: (optional) The parameters to pass to the function in question.

Examples[edit | edit source]

CallGlobalFunction "Debug.Trace" "Hello World!"
CGF "TestScript.TestGlobal" 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]