Fallout New Vegas

File information

Last updated

Original upload

Created by

DoctaSax

Uploaded by

DoctaSax

Virus scan

Safe to use

17 comments

  1. Magnusen2
    Magnusen2
    • premium
    • 55 kudos
    how would i go on about creating multiple uMCMPopScpt to avoid the max script size problem?

    i know they can be added to the uMCMStartupScpt like this:

    call xxxuMCMPopEWMain fVersion
    call xxxuMCMPopEWCompanions fVersion
    call xxxuMCMPopEWDefaultAll fVersion ;set all values to their defaults

    but what about the beggining of xxxuMCMPopEWCompanions:

     ; let A0ZombieController.ar_main := ar_construct "map"
     let ar_main := A0ZombieController.ar_main
     
     ; creating only menumap, so key is 0
     let ar_main[0] := ar_construct "map"
     
     ; creating submenu 1: examples of all types
     let ar_main[0][5] := ar_map "active"::1, "columns"::2, "enable"::1, "listtitle"::"Companion Options (1-30)", "pagetitle"::"Companion Options (1-30)"
     let ar_main[0][5]["options"] := ar_construct "map"
     let ar_options := ar_main[0][5]["options"]


    and of xxxuMCMPopEWDefaultAll:

    ; let A0ZombieController.ar_main := ar_construct "map"
     let ar_main := A0ZombieController.ar_main
     
     ; creating only menumap, so key is 0
     let ar_main[0] := ar_construct "map"
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
     if fMode == 0 ; first-time init, defaulting all vars
     foreach entry1 <- ar_main ; menu


    when i try this i get a error in the log:

    Error in script 76028C73 (xxxuMCMHandlingEWMain) in mod Endless Warfare MCM.esp
    Array does not contain key
    Operator [ failed to evaluate to a valid result
    Script line approximation: Let ar_options := ##ar_main[iMenu][iSubMenu]["options"]## (error wrapped in ##'s)
     Where ar_options=uninitialized array, ar_main=array keys [0], iMenu=0, iSubMenu=0
    File: Endless Warfare MCM.esp Offset: 0x03DA Command: Let


       
    1. Magnusen2
      Magnusen2
      • premium
      • 55 kudos
      Nevermind. Removing everything but the
       let ar_main := A0ZombieController.ar_mainfixed it.

      edit: found out that doing this make the game freeze after the first time opening the menu. So it's not a option.
    2. DoctaSax
      DoctaSax
      • member
      • 20 kudos
      I've had similar issues with arrays inside multitier structures somehow disappearing, under xNVSE 6. It's possible xNVSE 6.0.3 solves it.
    3. Magnusen2
      Magnusen2
      • premium
      • 55 kudos
      Yes sorry about that. The bug disappeared after updating to 6.0.2.
  2. Magnusen2
    Magnusen2
    • premium
    • 55 kudos
    For some unknown reason i'm getting this error after completing that quest for ranger ghost. Before that everything works fine with the menu:

    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


    can you please tell me what the "Invalid array access - the array was not initialized. 0" means?
       
  3. igotnousername
    igotnousername
    • supporter
    • 96 kudos
    I was wondering for 2 hours whats up then I realized "array_var ar_option" is not written on the standard script.

    Then when I solved it the compiler caps out 23kb of source file when the older and common template caps at 27kb. Almost similar character length.
    I've come to the conclusion this template makes the compiler reach the max size way quicker.

    Well, I'm not sure how to feel now. Like I thought this was one of the feature that it allows more size?
    Yes, I like how readable it is but I ended up searching for a way to double the script size limit (didn't know that was possible) and used that.
    Maybe add that as a requirement perhaps? The mod is Geck Extender.

    Thanks for the template though.
    1. DoctaSax
      DoctaSax
      • member
      • 20 kudos
      uMCM itself obviously doesn't change the size limit of scripts, but it prevents the entire MCM script structure (simultaneously entering and handling the intel) from being spread out over multiple scripts using lots of elseifs, becoming unmanageable. Because MCM scripting of any kind involves functions with string parameters, size was always an issue, and ofc if you enter those string parameteters in an array structure instead, that can still happen. A simple solution would be to outsource some of the pop code to a secondary UDF. Also have a look at the folder about more one-lining.

      Script size itself, however, was never the primary concern. Clarity and flexiblity was. For instance, uMCM allows for many more types of data storage than traditional quest vars, and due to everything being in arrays, and the ability to associate player input with the execution of a UDF, you can change any aspect of your MCM menu on the fly, using MCM as a UI for in-game programming. The latter requires a few extra steps though, those are methods I developed since this was first published;

      The Geck Extender is not required, so I won't list it as a requirement.
    2. Magnusen2
      Magnusen2
      • premium
      • 55 kudos
      I experienced this as well. I have a 44k character uMCMPopScpt and i get a max script size error on geck extender, while a 63k character script unrelated to uMCM compiles fine.
      btw i'm using notepad++ and it shows the character lenght at the bottom.
  4. dAbalo8
    dAbalo8
    • member
    • 1 kudos
    Hey, Doc

    Excellent templates!

    Could you help me out with an advanced use case? I'm trying to read and write variables from "SettingString" instead of "quest" and I go about it like this: First I remove "quest"::uMCMVARZ and then put in its place "SettingString"::fAVDCarryWeightsBase - but it results in the said item not appearing at all, in fact the whole submenu disappears with it (only tested with 1 item in 1 submenu)

    I'm using the example scripts provided in "advanced use" folder and they are (or at least seem) to be all set up correctly.

    EDIT: if anyone comes across this shame of mine and is in the similar predicament: just put the damn setting name in quotes!
  5. hexef
    hexef
    • premium
    • 86 kudos
    Thank you so much for these templates. I can finally implement MCM options into my mods now. :)
  6. Fallout2AM
    Fallout2AM
    • premium
    • 257 kudos
    It's the second mod I script using this.
    It left me a bit overwhelmed at start, I'm slow to change habits, but in the end it is objectively well done and I find it easier to work with it.
    If I'll find enough time, I'm going to migrate even the past MCMs I did.
  7. FreedomFighter4
    FreedomFighter4
    • member
    • 22 kudos
    The sound of optimization gives my ears the good ol' tingly feeling.
  8. tgspy
    tgspy
    • premium
    • 187 kudos
    Thanks so much for this. It'll make creation of an MCM menu for the frontier so much easier
    1. DoctaSax
      DoctaSax
      • member
      • 20 kudos
      Happy to help. Let me know if there's anything special you guys want done via the system that the current templates don't cover.
    2. tgspy
      tgspy
      • premium
      • 187 kudos
      It'll take me a while to figure out how the whole system works, and I guess MCM as a whole But I'll certainly let you know if we need anything
  9. Xilandro
    Xilandro
    • premium
    • 2,346 kudos
    Masterpiece!
    1. DoctaSax
      DoctaSax
      • member
      • 20 kudos
      Thanks. I quite like it myself