Difference between revisions of "Scripting Tutorial: Working with FormLists"

Jump to navigation Jump to search
no edit summary
imported>Omzy
imported>Omzy
Line 9: Line 9:


FormLists were originally created to serve a variety of purposes (See [[FormList]]). The creators of FOSE developed a handful of new functions that allow easy script manipulation of FormLists. These functions made FormLists much more powerful, giving them the all the functionalities of the List programming construct found in almost all high level programming languages.
FormLists were originally created to serve a variety of purposes (See [[FormList]]). The creators of FOSE developed a handful of new functions that allow easy script manipulation of FormLists. These functions made FormLists much more powerful, giving them the all the functionalities of the List programming construct found in almost all high level programming languages.
In this tutorial, you may see forms described as base forms and reference forms. The difference between the two is that base forms are the object templates from the editor (like a class in C++) and reference forms are instances of these object templates (like an instance of a class). Both base forms and reference forms contain a FormID, so most list functions will not discriminate between the two. However, some list functions may only accept one type as a parameter. See the individual function definitions for more information.


==FormList Functions==
==FormList Functions==
Line 47: Line 49:


==Modifying FormLists==
==Modifying FormLists==
*create a list: can you do this dynamically? (just create it in the editor first)
The following sections detail some common list operations you might want to perform on your FormLists.
 
===Creating a List===
FormLists must be created in the GECK, as there are no functions at this time to generate them from scripts.
*Navigate in the Object Window to Miscellaneous -> Form List.
*Right click, select New.
*Enter an ID for your FormList.


*adding forms to the list (which index do they start at if unspecified?)
===Adding Forms to a List===
**ListAddForm
You can add base forms
*ListAddForm
**ref.ListAddReference
**ref.ListAddReference


Anonymous user

Navigation menu