Jump to content

Accessing an array from multiple functions within a script


Recommended Posts

Perhaps I misunderstood, but I thought in reading the CK wiki, I could define and build an array in the Event Oninit() and then reference that array (e.g. by checking what MyArray[index] is) from any functions in the script. I couldn't seem to get that to work. I have a couple of functions (in the same quest script) that overlap in their usage of a large array (50+ entries) and I would like to avoid doubling up the code. 

Is it possible to make this work ?

 

Edit: Ah - I see. I split up the declaration as the example in the wiki suggests, put the latter portion in the Oninit and it worked beautifully.

Edited by csbx
Link to comment
Share on other sites

  • Recently Browsing   0 members

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