Difference between revisions of "FormList Script"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>CraftySentinel
m (→‎Member Functions: Formatting Change)
Tags: Visual edit Manual revert
 
(5 intermediate revisions by 5 users not shown)
Line 5: Line 5:
Native base script for Formlists in the game.
Native base script for Formlists in the game.


== Definition ==
See [[FormList Pseudocode]] for a more detailed perspective on the vanilla functions using C++.
 
==Definition==
<source lang="papyrus">
<source lang="papyrus">
ScriptName FormList extends Form
ScriptName FormList extends Form
</source>
</source>


== Properties ==
==Properties==
None
None


== Global Functions ==
==Global Functions==
None
None


== Member Functions ==
==Member Functions==
 
:'''[[AddForm - FormList|AddForm]](Form ''apForm'')'''
:*Adds the given form to the form list.


{|class="wikitable" width =100%
:'''Int [[Find - FormList|Find]](Form ''apForm'')'''
!style="text-align:left;"|Function
:*Finds the specified form in the form list and returns its index or returns -1 if it's not a member.  
!style="text-align:left;"|Description
|-
|[[AddForm - FormList|'''AddForm'''(Form ''apForm'')]]
|Adds the given form to the form list.
|-


|[[Find - FormList|Int '''Find'''(Form ''apForm'')]]
:'''Form [[GetAt - FormList|GetAt]](Int ''aiIndex'')'''
|Finds the specified form in the form list and returns its index or returns -1 if it's not a member.
:*Returns the form in the list at index ''aiIndex''.
|-


|[[GetAt - FormList|Form '''GetAt'''(Int ''aiIndex'')]]
:'''Int [[GetSize - FormList|GetSize]]()'''
|Returns the form in the list at index ''aiIndex''.
:*Returns the number of forms in the form list.
|-


|[[GetSize - FormList|Int '''GetSize'''()]]
:'''Bool [[HasForm - FormList|HasForm]](Form ''akForm'')'''
|Returns the number of forms in the form list.
:*Returns whether the passed-in form is in this form list.
|-


|[[HasForm - FormList|Bool '''HasForm'''(Form ''akForm'')]]
:'''[[RemoveAddedForm - FormList|RemoveAddedForm]](Form ''apForm'')'''
|Returns whether the passed-in form is in this form list.
:*Removes the given added form from the form list.
|-


|[[RemoveAddedForm - FormList|'''RemoveAddedForm'''(Form ''apForm'')]]
:'''[[Revert - FormList|Revert]]()'''
|Removes the given added form from the form list.
:*Removes all script added forms from the form list.
|-


|[[Revert - FormList|'''Revert'''()]]
==SKSE Member Functions ==
|Removes all script added forms from the form list.
:'''[[AddForms - FormList|AddForms]](Form[] ''akForms'')'''
|-
:*Adds all forms in an array to the FormList.


|}
:'''Form[] [[ToArray - FormList|ToArray]]()'''
:*Returns an array of all forms in the FormList.


== Events ==
==Events==
None
None


== Example Scripts ==
==Example Scripts==


[[Complete_Example_Scripts#Cycle_Through_an_Array_of_Objects_and_Perform_an_Action_on_Each_Object.28FormLists.29 | FormList Script Example: Disabling/enabling a large quantity of objects easily]]
[[Complete_Example_Scripts#Cycle_Through_a_List_of_Objects_and_Perform_an_Action_on_Each_Object.28FormLists.29 | Cycle Through a List of Objects and Perform an Action on Each Object(FormLists)]]


[[Complete_Example_Scripts#Show_Gift_Window_and_Identify_Items_Given| FormList Script Example: Show Gift Window and Identify Items Given]]
[[Complete_Example_Scripts#Show_Gift_Inventory_and_Identify_Items_Given | Show Gift Inventory and Identify Items Given]]

Latest revision as of 07:05, 23 February 2024


Native base script for Formlists in the game.

See FormList Pseudocode for a more detailed perspective on the vanilla functions using C++.

Definition[edit | edit source]

ScriptName FormList extends Form

Properties[edit | edit source]

None

Global Functions[edit | edit source]

None

Member Functions[edit | edit source]

AddForm(Form apForm)
  • Adds the given form to the form list.
Int Find(Form apForm)
  • Finds the specified form in the form list and returns its index or returns -1 if it's not a member.
Form GetAt(Int aiIndex)
  • Returns the form in the list at index aiIndex.
Int GetSize()
  • Returns the number of forms in the form list.
Bool HasForm(Form akForm)
  • Returns whether the passed-in form is in this form list.
RemoveAddedForm(Form apForm)
  • Removes the given added form from the form list.
Revert()
  • Removes all script added forms from the form list.

SKSE Member Functions[edit | edit source]

AddForms(Form[] akForms)
  • Adds all forms in an array to the FormList.
Form[] ToArray()
  • Returns an array of all forms in the FormList.

Events[edit | edit source]

None

Example Scripts[edit | edit source]

Cycle Through a List of Objects and Perform an Action on Each Object(FormLists)

Show Gift Inventory and Identify Items Given