Difference between revisions of "TempClone - Form"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>Egocarib
(Created page with "Category:Scripting Category:Papyrus Category:SKSE '''SKSE Member of:''' Form Script Creates a temporary clone of this form. (This function requires SKSE) == ...")
 
imported>Egocarib
m (reworded a note for clarity)
Line 30: Line 30:
== Notes ==
== 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.
*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 function does not work on all forms, in many cases it will simply return an empty form.
*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.
*TempClone ''does'' work for cloning CombatStyle Forms.

Revision as of 16:40, 15 November 2013

SKSE Member of: Form Script

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

Syntax

Form Function TempClone() native

Parameters

None

Return Value

Returns a new Form type that is a clone of the Form it was called on.

Examples

   ;...
   ActorBase ab = SomeBandit.GetActorBase()
   CombatStyle cs = ab.GetCombatStyle().TempClone()
   newCS.SetMeleeMult(0.1)
   newCS.SetMagicMult(2.5)
   ab.SetCombatStyle(newCS)
   ;...

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.