Nymra Posted January 6, 2024 Posted January 6, 2024 (edited) Hi, sorry, new to JSON files... I am currently changing my mod from using ESP/savegame based Formlists to external JSON files. What I forgot is, that I need a way to find a Form in a list very fast (many lists to search). So I have Form akBaseObject and used this: Formlist01.HasForm(akBaseObject) || Formlist02.HasForm(akBaseObject) || .... etc to return true or false (all I need. basically is Armor Y (Form) in one of these 10 json files with Armor Forms or not? Is there something similar for JSON files, maybe even a 1:1 equivalent? I tried parsing the scripts, but no idea which one of those would be right... Or do I have to load all the forms first from the json into my script and then compare them all 1 by 1? thx alot... Edited January 6, 2024 by Nymra
VersuchDrei Posted January 6, 2024 Posted January 6, 2024 There is no easy way to do a contains on a json file that checks for two different values (mod file name and form id) unless you do some funky string combination like "MyMod.esp|0x00ABCDEF". The fastest would probably be to load all the .json files into arrays on game load and then do a find operation on the array.
Nymra Posted January 6, 2024 Author Posted January 6, 2024 8 minutes ago, VersuchDrei said: There is no easy way to do a contains on a json file that checks for two different values (mod file name and form id) unless you do some funky string combination like "MyMod.esp|0x00ABCDEF". The fastest would probably be to load all the .json files into arrays on game load and then do a find operation on the array. yeah, was afraid so..... maybe I just keep the Formlists in the background then... save Armor Outfits to external files and formlists at the same time, one for the player to keep outfits across saves and profiles and one for internal use... hmm.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now