Jump to content

[LE] Data structures without SKSE - way to store strings in FormList structure?


Recommended Posts

I need to build a data structure to define an MCM menu (and the effects of its options). I need the structure's contents to be determined in the plugin, and interpreted by the papyrus script for the MCM.

 

This mod will also be on SE, so I can't use SKSE features. EDIT: just realized I phrased this poorly. On systems with SkyUI, the mod will have an MCM menu. On systems without SkyUI, the mod will automatically add a spell menu to the player. Both the MCM and the spell menu will use the data structure.

 

Here is my tentative structure using FormLists:

FormList MenuPage
    FormList OptionNames
        String Name1
        String Name2
        ...
    FormList OptionStates
        GlobalVar State1
        GlobalVar State2
        ...
    FormList Sources
        LeveledActor Src1
        LeveledActor Src2
        ...
    FormList Destinations
        LeveledActor Dst1
        LeveledActor Dst2
        ...

Now, the only issue is that I can't store strings inside of a FormList for the option names.

 

I would just use any random object type and indirectly store the string in that object's name, but without SKSE there is no GetName function to retrieve the string.

 

The best option I've found is to use Keywords, but this is really limiting because the keyword's text is also its Editor ID. So it needs to be unique, it can't contain spaces, and if you don't put a prefix it will be impossible to find them in the CK.

 

Does anyone know of another way to store strings inside of a Formlist structure? Or alternatively is there a better approach instead of FormLists (without SKSE)?

Link to comment
Share on other sites

I don't think a hacked multidimensional array will work due to a couple of restraints. First, the menu structure and contents need to be determined entirely within the plugin, not hardcoded in papyrus, and it needs to be organized intuitively so my end users can build menus with it. Second, the above data structure is just for a single page of my menu; then I need to store them all in an array of pages, each of which contains a different unknown number of entries (options).

Creating a new script type that just contains a single string property might work. So I would just choose some arbitrary type of object that can accept scripts, attach the string-storage script to it, set the string value in the property editor window, then store those objects in my FormList? Not sure what object type would be best to use.

 

EDIT: Can confirm that this solution (from the second paragraph) works. Current best contender for base type is Activator, will update if I find a better (smaller) object that can accept scripts.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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