Jump to content

[LE] Are general Abstract Data Types available in the Papyrus API?


loogooter

Recommended Posts

I'm currently working on a trade algorithm for skyrim (obviously), which relies on a new attribute not included in the game itself. I want to seamlessly integrate this algorithm with the rest of the game, and in doing so would require me to extend and append an entirely new user-created attribute, which would be inherited by all objects tangible to the player's inventory. My question being, are abstract data types available in the Papyrus API, or do I have to engineer this in a more 'crude' way. The attribute itself should be displayed within the Inventory UI, alongside the 'Weight' and 'Value' attributes.

 

Apologies if this has been asked before, I only got into Papyrus like 20 minutes ago

Edited by loogooter
Link to comment
Share on other sites

I'll be honest I'm not entirely sure I understand the concept you're describing. If you're looking to add some arbitrary data storage field to a base object, you can't really.

 

Certain types of objects can contain actor values which can be somewhat arbitrary for the design you describe. But the types of objects that can do so is pretty limited. That also gets a bit more complicated as base objects have to be overrides to the vanilla game or 3rd party mods. If not doing overrides then they must be set on a per spawned instance of an object. It also cannot be done for an entire class of objects, like all food items. You would need to do it for the base object of apples, then potatoes, etc.

 

Modifying the UI to also display your new value besides weight will require additional concerns. For the actual inventory you would need to modify the actionscript swf files related to it. For world display I don't remember how to do it, but I think it was another swf. I'm just not sure about that one.

Link to comment
Share on other sites

Those concepts have been asked about before and the answer is that the various bits fall somewhere between impossible and nearly impossible.

 

Showing new values through the interface will require creating an SKSE plugin (or other DLL) that can provided a new way to transfer data between the UI and rest of the game. The UI gets only the information it absolutely needs to provide the display to the player or signal feedback to the rest of the game. SkyUI features past version 2.2 all make use of extended SKSE functions of that type which is why SkyUI 2.2 is the only version usable under Special Edition.

 

Items which go into containers or inventory lose much of their information. Attaching scripts to them can theoretically work but while the items are in containers the information contained in the scripts is extremely hard (i.e. almost impossible) to access. Again, if you were trying to store additional information and needed to know how many of the apples in the barrel had special tag A and how many had special tag B the only way to know because the game will treat them as one big pile of apples. It's only when you pull a particular apple out into the game world that you can access its script properties. In theory your SKSE plugin DLL could find a way to locate the internal data but don't expect it to be easy.

 

And the last problem is that there's no good way to attach a script to all things. In theory you might be able to edit the ObjectReference script itself but that would lead to massive compatibility problems.

Link to comment
Share on other sites

Basically nothing you want to do, as laid out, can be done in Papyrus, though as cdcooley says if you're up to working with making SKSE plugins you can get deeper into the guts of the game and perhaps make progress there.

 

What exactly is this attribute, and what do you want to do with it? Maybe there's an alternative approach.

Edited by foamyesque
Link to comment
Share on other sites

  • Recently Browsing   0 members

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