Jump to content

Would I benefit from PapyrusUtil for mod ?


Recommended Posts

My mod uses a frock-tonne (ie. hundreds) of items in a string array (each about 250 characters) that as of now sits within my main script for my mod. Everything functions very well and there's no problems with this setup that I have noticed.

However, in thinking more about adding extensibility to my mod to make it easy (for others, hopefully) to add support for other mods (mainly mods that add dungeon locations), it's pretty clear that having the string arrays sitting in that main script isn't really feasible.

I've looked a little at papyrusUtil but don't see a lot of documentation regarding how to use it. 

Any recommendations about where to start other than cracking open a mod that uses PapyrusUtil ?

Link to comment
Share on other sites

The comments inside the papyrusutils source scripts are all the documentation you should need.  Specifically, you want to look at StorageUtil.psc

However, I grew very unsatisfied with StorageUtil and officially recommend you go with JContainers instead.  There are other parts of PapyrusUtils that are still useful, but StorageUtil mishandles storage of records keyed on ObjectReferences which was a show stopper for my own uses, and will limiting for you over time.  That said, you are currently looking at storing strings so it's not that important; StorageUtil will do the job.

Link to comment
Share on other sites

 @csbx NO not StorageUtil use the more modern JsonUtil. Bottom line JContainer uses Xml file and PapyrusUtil uses Json files, they are the friggen same with different text syntax options, the only real difference is xml support "namespaces" and json does not

https://en.wikipedia.org/wiki/XML

https://www.json.org/json-en.html

https://en.cppreference.com/w/cpp/language/namespace

 both have extra features that are unique,  I would long term look at the extra features, and see which are more appealing to you, so bottom line is not data storage, but can you do with the extra features it brings?

Probably the most famous mods that use external data  is DynDOLOD and SexLab,  but now, DynDOLOD has its own independent mechanism,  the json format is more human readable too, if that matters to you

@xkkmEl I tried to be neutral, cos they are the same, he needs data storage, but I stand by that not the reason to favor one over the other...

@csbx I use both xml and json, if I need to serialise any objects with namespaces, it a is no brainer what I use 

https://en.wikipedia.org/wiki/Serialization

take your time and look at the extra features too, you get one chance to choose, without abandoning backward compatibility. 

EDIT oops, I mentioned external data, cos that way it is easy to share data with other mods, without risking any integrity to your, papyrus has no private options for method functions  etc, and the only way you can enforce Property  integrity, is to abandon automatic properties with Full Properties 

https://ck.uesp.net/wiki/Variables_and_Properties#Full_Property:~:text=edit source]-,Full Property

the time it takes to protect your mod if you plan it being used has master, it will pay itself back untold times, when someone plays with it, breaks its, then complains it does not work..., you should be aware how SKYUI only gives access to limited PSC, enough to compile yours, not enough to recompile theirs and change, so they do not have to hear idiot users  whingings.. and more importantly publishing recompile PEX. 

Trust me integrity, is problem for SkyUI CampFire and such..and they work it out beforehand

 

 

 

Link to comment
Share on other sites

JContainers uses json.  Don't even know if it supports xml.

Won't comment on JSonUtil as I haven't used it.  It does not support my uses cases well.

The JContainers API is much cleaner and more general, but everyone is welcome to their point of view, coming at it with different experiences, expectations and requirements.  Any of the three options (StorageUtil, JsonUtil and JContainers) should fit your limited need.

Link to comment
Share on other sites

really, wonder where I use  xml one then,  it was two many years ago, but I recall, it was definitely the xml format.  I assumed it was JContainers, but I only use it once, my bad.. I checked, your right...

still stand by it is extra features and not the data storage that the defining factor 😉😉

Link to comment
Share on other sites

  • Recently Browsing   0 members

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