Difference between revisions of "SetScript"
Jump to navigation
Jump to search
expanded. sources: gribbleshnibbit, me.
imported>Geckbot m (Robot: Automated text replacement (-'''.*'''\r\n +)) |
imported>Odessa (expanded. sources: gribbleshnibbit, me.) |
||
|
{{Function
|origin = FOSE1
|summary = Sets the specified script
|name = SetScript
|returnType =
|referenceType = ref
|arguments =
{{FunctionArgument
|Name =
|Type =
}}{{FunctionArgument
|Name =
|Type =
|Optional = optional
}}
}}
==Example==
<pre>
ref OldScript
set OldScript to SunnyREF.SetScript MyNewSunnyScript
; or (required if used for non-reference)
SetScript MyNewSunnyScript, SunnyREF
</pre>
==Warning==
If the target object already has a script attached to it, after changing the script the stored values of local variables for references to that object will not match the variables in the new script. If called on a reference, the variable list for the calling reference will be updated to match the new script, but other references to the same base object will not be updated.
SetScript is safe to use with quests, with previously unscripted objects, and on unique references (for which no other references exist to the same base object). Using the command on base objects for which non-unique references exist may result in undefined behavior.
==See Also==
*[[GetScript]]
*[[ResetAllVariables]]
*[[CompareScripts]]
*[[GetCurrentScript]]
[[Category:Functions_(FOSE)]]
[[Category:Script Functions]]
| |||