Difference between revisions of "AddFormToFormList"

From the Fallout3 GECK Wiki
Jump to navigation Jump to search
imported>Kkuhlmann
 
imported>JT
m (clarification: only pertains to New Vegas)
 
(11 intermediate revisions by 5 users not shown)
Line 1: Line 1:
=='''Description'''==
{{Function
 
|origin = GECK1
'''AddFormToFormList''' Adds a form to a formlist. This should be used in the RARE case where we want to add an item to a form list that already exists in the ESM. It's primary use it for modifying lists from the base game in downloadable content. In most cases you should add items to form lists in the editor object windows. This is for those special cases where you want to alter the contents of a list at runtime or want to change it without putting it in your ESP/ESM file. Once altered using this function, it will persist in the save game data.
|summary = 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.
 
It can '''not''' be undone.
 
=='''Syntax'''==
 
AddFormToFormList ''FormList'' ''FormToAdd''
 
(parameters are Base Objects)
 
=='''Examples'''==


This function was originally intended to modify lists from the base game in downloadable content.
|name = AddFormToFormList
|arguments =
  {{FunctionArgument
  |Name = FormListID
  |Type = ref
  }}{{FunctionArgument
  |Name = FormID
  |Type = ref
  }}
|example = AddFormToFormList AlcoholicDrinks SamAdamsBeer
  AddFormToFormList DialogueAnimationBulkyArmors NewBulkyArmor
  AddFormToFormList DialogueAnimationBulkyArmors NewBulkyArmor
}}


Animations are now aware of a new armor that is considered "bulky" and will be used to condition certain animations.
==Notes==
 
*Using this function to add a FormID already in the list will simply move it to the 0th index.  It will not add a duplicate entry of the FormID to the list.
=='''Notes'''==
*This function has been tested to accept any FormIDs, including base objects and dynamically created references.
*None at this time.
*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).
=='''See Also'''==
*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.
*[[AddNPCToLeveledList]]
* (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,
*[[AddCreatureToLeveledList]]
<pre>AddFormToFormList AmmoList10mm MyModSpecial10mmAmmo ;Adds my ammo to the front of the list
*[[AddItemToLeveledList]]
AddFormToFormList AmmoList10mm Ammo10mm ;Moves the original ammo back to the front of the list</pre>
 
* 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.
=='''Reference'''==
None provided.


==See Also==
*[[ListAddForm]]
*[[ListAddReference]]
*[[ListRemoveForm]]
*[[ListRemoveNthForm]]
*[[ListReplaceForm]]
*[[ListReplaceNthForm]]
*[[ListGetNthForm]]
*[[ListGetFormIndex]]
*[[ListGetCount]]
*[[IsInList]]
*[[IsWeaponInList]]


[[Category:List Functions]]
[[Category:List Functions (GECK 1.1)]]
[[Category:Functions]]
[[Category:Functions]]
[[Category:Object Functions]]
[[Category:Functions (GECK 1.1)]]

Latest revision as of 00:11, 23 July 2015

< [[::Category:Functions|Category:Functions]]

A function included in the GECK version 1.1.0.36.

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.

Syntax

[help]
AddFormToFormList FormListID:ref FormID:ref

Example

AddFormToFormList AlcoholicDrinks SamAdamsBeer
AddFormToFormList DialogueAnimationBulkyArmors NewBulkyArmor

Notes

  • Using this function to add a FormID already in the list will simply move it to the 0th index. It will not add a duplicate entry of the FormID to the list.
  • This function has been tested to accept any FormIDs, 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.

See Also