CallFunction

Revision as of 11:46, 8 December 2014 by imported>Plplecuyer (→‎Notes)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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

SyntaxEdit

<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>)

ParametersEdit

  • 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.

ExamplesEdit

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

NotesEdit

  • 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 AlsoEdit