Scripting Tutorial: Working with FormLists

From the Fallout3 GECK Wiki
Revision as of 20:50, 31 July 2009 by imported>Omzy (beginning new tutorial on lists)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
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.

(why were formlists created? DLC...)

Functions

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)