Background for Skyrim SE
Member of the Form script
FormfunctionTempClone()Native

Description

Wiki Description

Creates a temporary clone of this form. (This function requires SKSE)

Documentation Comment

Returns a temporary clone of this form


Caveats

CK Wiki - Notes

  • The clone will only exist for the current play session. Attempting to store the cloned Form in a variable for longer periods of time will not work, and may lead to game instability when your script attempts to access the form after a game reload.
  • This does not work on all types - you may get back a valid form with initialized default data rather than data copied from the source.
  • TempClone does work for cloning CombatStyle Forms.

Examples

   ;...
   ActorBase banditBase = SomeBandit.GetActorBase()
   Form csForm = banditBase.GetCombatStyle() as Form
   CombatStyle newCS = csForm.TempClone() as CombatStyle
   newCS.SetMeleeMult(0.1) ;reduce preference for melee attacks
   newCS.SetMagicMult(2.5) ;increase preference for magic attacks
   banditBase.SetCombatStyle(newCS)
   ;...

Auto-Generated Example

Form returnedValue = myForm__toCallFunctionOn.TempClone()

Additional References

View this function’s page on the Skyrim Creation Kit Wiki

Some data provided by the Skyrim Creation Kit Wiki. Licensed under the Creative Commons Attribution-ShareAlike license.