TempCloneForm

From GECK
Jump to: navigation, search


A function added by the Fallout Script Extender.

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

[help]
(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