Jump to content

Question about initialization of long arrays


Recommended Posts

Damn nexus erased my post...

 

I need to set specific default values for a long (+50 elements) int array, options:

 

A) set them in ck, painful, tedious and not reusable. I'd prefer to have that done within the script and reduce the amount of time setting it up each time.

 

B) Massive on init block:

Array[0] = 45
Array[1] = 342
...
Array[50] = 32

I wish this would work, like in java:

int[] num = {1,2,3,4,5};

Or that you could cast string to array same way you cast array to string and it outputs something like:

[0, 23, 454, 1345 ,352]

So, question, would the massive on init block cause a noticiable performance impact when compared to setting then in ck? Any other/better way to approach this?

Edited by FrankFamily
Link to comment
Share on other sites

I think there'd be a performance hit, but I don't think it'd be that significant. That said, anything that tries to touch your script (e.g. accessing properties) will be forced to wait until the OnInit call stack (that is, OnInit and called during OnInit) has finished executing.

 

EDIT: I have TES5Edit scripts for setting up Papyrus properties in bulk. One of them allows you to enter an Int array as a comma-separated list. The "Skyrim - Papyrus Resource Library" and "CobbTES5EditUtil" scripts are libraries that the other scripts rely on, so be sure to install them alongside whatever specific ones you need.

Edited by DavidJCobb
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...