CreateBoolArray - Utility: Difference between revisions
Jump to navigation
Jump to search
DavidJCobb (talk | contribs) (Created page with "Category:Scripting Category:Papyrus '''Member of:''' Utility Script Creates an array of Bool values, with the specified length. '''Be careful when using this func...") |
m (Convert source tags to syntaxhighlight) |
||
| Line 6: | Line 6: | ||
== Syntax == | == Syntax == | ||
< | <syntaxhighlight lang="papyrus"> | ||
Bool[] Function CreateBoolArray(Int size, Bool fill = False) Native | Bool[] Function CreateBoolArray(Int size, Bool fill = False) Native | ||
</ | </syntaxhighlight> | ||
== Parameters == | == Parameters == | ||
| Line 18: | Line 18: | ||
== Examples == | == Examples == | ||
< | <syntaxhighlight lang="papyrus"> | ||
Bool[] myArray = Utility.CreateBoolArray(129) ; Create an array longer than the Papyrus compiler would allow | Bool[] myArray = Utility.CreateBoolArray(129) ; Create an array longer than the Papyrus compiler would allow | ||
</ | </syntaxhighlight> | ||
== Notes == | == Notes == | ||
Latest revision as of 20:55, 5 September 2026
Member of: Utility Script
Creates an array of Bool values, with the specified length. Be careful when using this function. It is possible to create arrays longer than 128 elements, and size is treated as an unsigned integer. Negative numbers will produce extremely large values, which can cause major issues.
Syntax[edit | edit source]
Bool[] Function CreateBoolArray(Int size, Bool fill = False) NativeParameters[edit | edit source]
- size: The length of the array.
- fill: Unused due to a bug in SKSE. The intention was for each array in the element to be set to this value.
Return Value[edit | edit source]
A Bool array of length size. The elements in the array will most likely be True, but there is no guarantee that they will have any particular value.
Examples[edit | edit source]
Bool[] myArray = Utility.CreateBoolArray(129) ; Create an array longer than the Papyrus compiler would allowNotes[edit | edit source]
- As mentioned above, an SKSE bug means that the contents of the array — the values of the bools — are effectively random. This bug should not affect the functions that create arrays of other types. Refer to the Talk page for more details.