Jump to content

Invalid array access?


Magnusen2

Recommended Posts

I'm trying to implement a MCM for the endless warfare mod but i'm encountering some issues with it displaying the submenus.
Everything works fine until i'm getting out of the mojave outpost after the nipton quest were the player tells ranger ghost that the town was sacked. I start to get script errors now stop on the nvse log and then only the first menu appears:

Error in script 7500109F (uMCMHandlingScpt) in mod Endless Warfare MCM.esp
Invalid array access - the array was not initialized. 0
Operator [ failed to evaluate to a valid result
Script line approximation: Call ##ar_main[iMenu]## (error wrapped in ##'s)
    Where ar_main=uninitialized array, iMenu=0
    File: Endless Warfare MCM.esp Offset: 0x026B Command: Call

I also were having "Invalid array access - expected numeric index, received string" before but after removing some duplicate variables and starting a new game it seems to be fixed.

Can anyone that had this type of error before explain to me why this happens?

 

Is this because i have over one hundred variables in the quest script?

Edited by Magnusen2
Link to comment
Share on other sites

"ar_main=uninitialized array" means you failed to define the variable "ar_main" as an array prior to using it for the first time. The declaration statement either needs to be placed at the beginning of the script (below the SCN <name> line and before the "Begin" line), or similarly in a script which is called before this one. (It can be declared after the Begin line, but then it is limited in scope to only that script.)

 

The number of variables should not be a problem. The total size of a single script can be, but that is very unusual. ALWAYS avoid duplicate variable names, except for temporary ones (like single letters) that can immediately be discarded/ignored (i.e. loop indexes) and are limited to being "local" in scope (defined below the Begin line).

 

-Dubious-

Edited by dubiousintent
Link to comment
Share on other sites

  • Recently Browsing   0 members

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