Difference between revisions of "SetScript"

Jump to navigation Jump to search
1,033 bytes added ,  06:20, 6 August 2014
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 ofonto the calling reference or passed object, and returns any previous script.
 
|name = SetScript
|returnType = refscript:form
|referenceType = ref
|arguments =
{{FunctionArgument
|Name = scriptInRefNewScript
|Type = refscript
}}{{FunctionArgument
|Name = itemScriptableObject
|Type = refform
|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]]
Anonymous user

Navigation menu