Jump to content

[LE] Best way to have a list of LOTS of objects (more than 128) (and/or remember objects given to player from chest?)


Recommended Posts

Posted

Are there ways to have a list of a LOT of objects? Arrays can only be 128 long (right?)

 

My favorite player house has a script for the workbench and stuff to transfer items from a chest to the player so that you can use items out of the chest instead of carrying them. BUT, it doesn't do it... adequately. It has a bunch of named chests for every type of weapon/smithing resource, etc, but the workbenchs don't pull from those named chests, therefore it essentially makes those chests... useless. So I wanted to write a better script, but the problem I've run into is... well... what if a chest has more than 128 items in it? I could make some fancy scripting that uses multiple arrays, but that seems... annoying.

 

I'm sure someone has figured this out by now.

 

Does the skse function CreateFormArray allow for more than 128 elements? It says it's possible to create arrays longer than 128 elements, but it doesn't say if you should do that or not...

 

 

Posted

Sounds like you will want to use a Formlist for this.

Ugh.... I DID read about formlists, but I must have missed the part where you could make/edit them in game.

 

I thought they could only be created beforehand in creation editor.

 

Thanks.

Posted (edited)

They can only be created in the editor, but they can be modified via script in game afterwards. As long as you're in a situation where you know how many lists you'll need, or if you need to talk to Skyrim's other systems, they're a good solution.

 

If you absolutely need stuff to be created at runtime you're going to need to use arrays, and if you want those properly arbitrarily and dynamically sized, you'll need SKSE.

Edited by foamyesque
  • 2 weeks later...
Posted

If you just need Forms or ObjectReferences then SKSE allows the creation of arrays of more than 128 items.

But using a FormList in this case can be better.

  • Recently Browsing   0 members

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