Jump to content

Help With A Script


MadTod

Recommended Posts

I found a solution, add the items to a LeveldList so I can have different amounts of various items, then add the LeveldList to the FormList, simple.

 

Thanks for all the help, I really apreciate it.

Link to comment
Share on other sites

No problem. The script by IsharaMeradin actually also solves the object issue actually, now that I think of it. Preventing objects from respawning with the container would probably require making the container itself non-respawning, and using IsharaMeradin's example that does not use RemoveAllItems for refilling the container when it is accessed. So that actually sort of solves it, if you can make the container itself non-respawning.

 

Also, if IsharaMeradin reads this, I would still be interested in some background for the two loop methods in my post at the bottom of the previous page. Just out of curiosity, it has been puzzling me for some time now. :smile:

 

Edit: Ooops. Too much "actually", actually. I need to expand my vocabulary. :facepalm:

Edited by Contrathetix
Link to comment
Share on other sites

Regarding the loop methods, I don't know the specifics on why. I have done it both ways. I suspect that for most authors it is for convenience to have less lines of code. If you want to assign the data to a variable and use that instead, it will work. If you are concerned about performance issues, I'm not the one to ask.

Link to comment
Share on other sites

Okay. Understood. Thank you for the answer. Maybe someone will some day provide some evidence one way or the other. Maybe not. Maybe it does not matter, being something so small.

 

Also thank you for the idea of checking each item individually. It took me a while to notice that it also partially fixes the issue with items not being kept in the container. When the container is made non-respawning, then it fixes it completely! Clever catch. :thumbsup:

Link to comment
Share on other sites

One caveat about containers. If the container has not been accessed yet by the player, its contents are unknown by the game because while the visual item my be loaded the contents do not initially get loaded until the player accesses it. So if one were to use OnCellAttach to manipulate the contents of the container, they would need to use a global variable to indicate whether the player accessed the container the first time. Otherwise, the script I posted would not perform as intended when using OnCellAttach. Another reason I suppose for using OnActivate. Just let users know that if you are manipulating a large number of objects in the script that they may see the contents change in the container UI.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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