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

From the Fallout3 GECK Wiki
Jump to navigation Jump to search
imported>Omzy
m
imported>Omzy
Line 8: Line 8:
With the development of the GECK came several new object types and functions that were not seen in previous versions of Bethesda's game construction kits. One of the new object types that was added is called a FormList. A FormList is, naturally, a list of FormIDs of objects from the editor.
With the development of the GECK came several new object types and functions that were not seen in previous versions of Bethesda's game construction kits. One of the new object types that was added is called a FormList. A FormList is, naturally, a list of FormIDs of objects from the editor.


(why were formlists created? DLC...)
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 functionality of the following popular programming constructs:
(...)


==FormList Functions==
==FormList Functions==

Revision as of 00:46, 2 August 2009

This article is incomplete. You can help by filling in any blank descriptions.
Further information might be found in a section of the discussion page. Please remove this message when no longer necessary.

This article is a WIP. I'll try to finish it in the next few days.--Omzy 00:50, 1 August 2009 (UTC)

IMPORTANT

You will need Fallout_Script_Extender for this tutorial.

Introduction

With the development of the GECK came several new object types and functions that were not seen in previous versions of Bethesda's game construction kits. One of the new object types that was added is called a FormList. A FormList is, naturally, a list of FormIDs of objects from the editor.

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 functionality of the following popular programming constructs: (...)

FormList Functions

(make a FormList Functions subcategory to place in Function Types) The creators of FOSE saw potential in FormLists and decided to flesh out their abilities with a handful of new functions that could manipulate them in scripts.(ask FOSE creators to confirm this or change it). This table shows all the FormList functions currently available to modders:

Make a table here: The following functions are from the GECK (v?):

  • AddFormToFormList
  • IsInList
  • IsWeaponInList

The following functions are from FOSE (v?):

  • ListAddForm
  • ref.ListAddReference
  • ListRemoveForm
  • ListRemoveNthForm
  • ListReplaceForm
  • ListReplaceNthForm
  • ListGetForm
  • ListGetNthForm
  • ListGetFormIndex
  • ListGetCount

Modifying FormLists

  • create a list: can you do this dynamically? (just create it in the editor first)
  • adding forms to the list (which index do they start at if unspecified?)
    • ListAddForm
    • ref.ListAddReference
  • removing forms from the list
    • ListRemoveForm
    • ListRemoveNthForm
  • replacing forms in the list
    • ListReplaceForm
    • ListReplaceNthForm
  • getting forms from the list
    • ListGetForm
    • ListGetNthForm
  • getting form information
    • ListGetFormIndex
    • ListGetCount

Lists of Lists...What?

As it would seem, a FormList is also an object in the editor, which has its own FormID. That makes a FormList a Form. What this means is that FormLists can contain other FormLists. This may seem a bit confusing if you've never learned any mid-level programming before, so lets look at the following script and see what it does:

(script here)

(add more scripting tricks/uses)