TempCloneForm
A function added by the Fallout Script Extender.
Contents
Description
Clones the specifies BaseForm, returning a new base form. If ToClone is omitted and a calling reference is provided, that reference's BaseForm is used.
By default, a cloned form's ID has the FF mod index, like dynamic objects generated during the course of gameplay. If indexToCallingScript is true, it will instead use the index of the mod to which the calling script belongs, taking the first available form ID in it.
Either way, this cloned base form will not be persisted in the save game but the ref var containing the temporary form ID will be (which will be invalid on game load) so you must reinitialize the form on game restart.
Syntax
(Clone:baseForm) reference.TempCloneForm ToClone:baseForm indexToCallingScript:bool
Example
ref MyClone set MyClone to TempCloneForm Vodka
MyClone now points to a clone of the 'Vodka' ingestible, which uses a form ID with a FF prefix.
ref MyClone set MyClone to TempCloneForm Vodka 1
MyClone now points to a clone of the 'Vodka' ingestible, with a form ID using the same prefix as the mod to which the script belongs.
See Also
- IsClonedForm
- CreateTempRef
- Mod Local Data (A method to store data independent of save games)
- Auxiliary Variables (Another method)
- IsScriptMarkedOnLoad (Another method)