Skyrim Mod:SkyProc/How to List/Duplicating
Related SkyProc Classes[edit]
-
- Mod - An object representing a complete Skyrim mod.
How To[edit]
Duplicate Records[edit]
To make a duplicate of a record (not an override, but a completely separate record with the same content) you must have a mod to have the duplicate originate from. Thus, the copy function is actually part of the Mod class, which automatically adds the record to the mod, and assigns it the next available FormID from that mod.
patch.makeCopy(aMajorRecord, aString);
After this has run, a duplicate of aMajorRecord will be inside patch.
To have easy access to the duplicated record (to modify it), simply assign the return value to a variable:
NPC_ npcDup = (NPC_) patch.makeCopy(anNPC, "newEDID"); ... code to modify npcDup ...
NOTE: In order to treat the return value as the same type of Major Record you put into the function, you must do a cast, as shown above. This is because makeCopy is a single generic function that can be used with any Major Record; you need to tell Java which type of Major Record it is returning.
The new editor id must be unique.