GenericReplaceForm
From GECK
A function added by the New Vegas Script Extender.
Description
Replaces a form within an embedded list of forms associated with an object at a given index with a new one. Returns the replaced form.
Syntax
(OldForm:ref) GenericReplaceForm ListCode:int Target:object New:form Index:int
Embedded List Codes
- 0 = Race Hair (see also: GetRaceHairs
- 1 = Race Eyes (GetRaceEyes)
- 5 = Actor Base (NPC or creature) Packages (GetBasePackages)
- 6 = Actor Base Spells (GetBaseSpellListSpells)
- 7 = Actor Base Levelled Spells (GetBaseSpellListLevSpells)
- 10 = NPC Head Part (GetHeadParts)
- 13 = Form List form (redundant given existing functions, such as ListAddForm)
Example
To give Easy Pete a new beard:
ref OldForm let OldForm := GenericReplaceForm 10, EasyPeteREF, BeardChopper, 0 ; OldForm is 'Old Beard', now he's got a chopper.
Note: Changes to an actor's 3D are not visible until it reloads, which can be forced using Update3D.