Open main menu
Home
Random
Log in
Settings
About the CreationKit Wiki
Disclaimers
the CreationKit Wiki
Search
Editing
Array Reference
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Compiler Issues === Several compiler errors have been identified that are caused by using expressions inside of array index brackets. The standard papyrus compiler sometimes compiles expressions inside of array index brackets incorrectly, leading to unexpected behavior and data corruption. As a result, it is recommended to avoid using complex expressions or function calls inside of array index brackets when possible. '''[http://forums.bethsoft.com/topic/1491368-weird-array-index-behavior/ See this discussion]''' for further details and analysis of the problems outlined below: <br> *Using complex expressions inside of the index brackets of an integer array can cause unexpected behavior - <syntaxhighlight lang="papyrus"> ;these work fine: myIntArray[i] = newValue myIntArray[i * 5] = newValue ;this will result in unexpected values being inserted into the array at run time: myIntArray[i * 5 + 1] = newValue </syntaxhighlight> <br> *The array Find() function should not be used within an array's index brackets; it can also cause unexpected results - <syntaxhighlight lang="papyrus"> ;this works fine: i = myArray.Find(none) ;(find the first blank element) myArray[i] = newValue ;(and fill it with our newValue) ;this will result in values being inserted into unpredictable indices of the array at run time: myArray[myArray.Find(none)] = newValue </syntaxhighlight> <br>
Summary:
Please note that all contributions to the CreationKit Wiki are considered to be released under the Creative Commons Attribution-ShareAlike (see
CreationKit:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)