AddFormToFormList

From GECK
Jump to: navigation, search


A function included in the GECK for Fallout 3.

Description

Adds a form to a FormList. Unlike ListAddForm, this function adds the new form at the 0th index, adding 1 to the indices of the other list entries.

This function was originally intended to modify lists from the base game in downloadable content. The change to the list is savebaked.

Syntax

[help]
AddFormToFormList formList:baseForm form:baseForm/refr

Example

AddFormToFormList AlcoholicDrinks SamAdamsBeer
AddFormToFormList DialogueAnimationBulkyArmors NewBulkyArmor 

Notes

  • If non persistent References are added to a formlist with this command they will only remain in the list for some time before they will be cleared by the game.
  • Using this function to add a Form already in the list will simply move it to the 0th index (Will do nothing if the form already exists via hard edit). It will not add a duplicate entry of the FormID to the list.
  • This function has been tested to accept any Form, including base objects and dynamically created references.
  • If you are performing lots of list modifications through scripts, consider using the FOSE function ListAddForm instead.
  • In the first example above, the new beer is now considered alcoholic and will produce the same effects of other alcoholic drinks when the game checks this list (the actual list name in the editor is misspelled as AlchoholicDrinks).
  • In the second example above, animations are now aware of a new armor that is considered "bulky" and will be used to condition certain animations.
  • (New Vegas) When adding an ammo type to an ammo list (e.g., AmmoList10mm) with this function (i.e., if you must use this function instead of ListAddForm which is generally superior), you should always make sure to re-add the original base ammo type to the list to move it back to the front of the list. For example,
AddFormToFormList AmmoList10mm MyModSpecial10mmAmmo ;Adds my ammo to the front of the list
AddFormToFormList AmmoList10mm Ammo10mm ;Moves the original ammo back to the front of the list
  • If this is not done, weapons will display your special ammo as their conventional ammo type when viewed in the inventory, and will default to that special ammo type when equipped. This is almost always undesired behaviour.

Bugs

  • On rare occasions, form lists edited with AddFormToFormlist get reset and the formlist entries added disappear from the save. ListAddForm does not suffer from this issue as it is not serialized (verified in New Vegas).

See Also