Difference between revisions of "CloneForm"
Jump to navigation
Jump to search
imported>Scruggs |
imported>DragoonWraith (→Notes) |
||
(12 intermediate revisions by 7 users not shown) | |||
Line 2: | Line 2: | ||
'''Syntax:''' | '''Syntax:''' | ||
[ | [nuObjectID] CloneForm [objectID] | ||
This function creates | This function creates an exact duplicate of the referenced base object supplied in objectID and returns the new objectID. | ||
'''Example:''' | |||
<pre> | <pre> | ||
ref clone | ref clone | ||
set | ref originalObject | ||
set originalObject to myReference.GetBaseObject | |||
set clone to CloneForm originalObject; clone the base object of myReference | |||
player.placeAtMe clone 1 0 0 ; place a reference to the clone at the player's location | player.placeAtMe clone 1 0 0 ; place a reference to the clone at the player's location | ||
</pre> | </pre> | ||
This function | ==Notes== | ||
*Cloned forms are saved in the save game. | |||
*Cloning an object allows you to then make changes to the clone without affecting the original object. Changes to cloned base objects are also saved, which they usually are not. | |||
*This function works for any game type (objects, spells, enchantments, NPCs). | |||
*If called on an Inventory Object (weapon, armor, light, potion, book, ingredient etc.) you may pass the CS EditorID directly into the function. | |||
*For any other type you must first set a ref variable to the appropriate objectID before calling CloneForm. | |||
* Cloned NPCs have no items in their inventories and are unscripted. | |||
* It appears that an NPC can only be cloned once. | |||
* Cloned books will not have text. | |||
==See Also== | |||
*[[IsClonedForm]] | |||
<!--[[Category: OBSE Functions]] | |||
[[Category: OBSE Item Functions]]--> | |||
[[Category: OBSE Functions]] | [[Category: Functions]] | ||
[[Category: OBSE | [[Category: Functions (OBSE)]] | ||
[[Category: OBSE | [[Category: Inventory Functions]] | ||
[[Category: Inventory Functions (OBSE)]] | |||
[[Category: Actor Functions]] | |||
[[Category: Actor Functions (OBSE)]] | |||
[[Category: Miscellaneous Functions]] | |||
[[Category: Miscellaneous Functions (OBSE)]] |
Latest revision as of 14:30, 30 September 2011
A command for Oblivion Script Extender
Syntax:
[nuObjectID] CloneForm [objectID]
This function creates an exact duplicate of the referenced base object supplied in objectID and returns the new objectID.
Example:
ref clone ref originalObject set originalObject to myReference.GetBaseObject set clone to CloneForm originalObject; clone the base object of myReference player.placeAtMe clone 1 0 0 ; place a reference to the clone at the player's location
Notes[edit | edit source]
- Cloned forms are saved in the save game.
- Cloning an object allows you to then make changes to the clone without affecting the original object. Changes to cloned base objects are also saved, which they usually are not.
- This function works for any game type (objects, spells, enchantments, NPCs).
- If called on an Inventory Object (weapon, armor, light, potion, book, ingredient etc.) you may pass the CS EditorID directly into the function.
- For any other type you must first set a ref variable to the appropriate objectID before calling CloneForm.
- Cloned NPCs have no items in their inventories and are unscripted.
- It appears that an NPC can only be cloned once.
- Cloned books will not have text.