FireFlickerFlak Posted November 18, 2014 Share Posted November 18, 2014 This is hopefully the last thing I need to do before uploading this for testing, so I am excited as it will be the first thing I have uploaded (even though it is just an alpha tester). But anyway, here is a simplified version of what I am doing to arbitrarily but consistently translate any given ruined book. I have one formlist that stores all previously translated books. This formlist is initially empty and every time a new book is targeted, that book is stored in the formlist. The index of any given book in the formlist is used to determine the translation of the book. Since no two books will have the same index, they can all be treated as unique and every time the same book is translated, it will have the same result. When I say "translate" I am basically putting this index value into a formula that returns a result, but that is not important here since I am pretty sure that part is safe. My concern is that I currently never clean up this formlist and it just keeps getting larger with both forms of persistent and possibly non-persistent references . Theoretically, the player could choose to translate hundreds of books and the list would continue to allow each of them to always translate correctly, but the list would also possibly contain forms of many books that may not be persistent references. Will having the forms of non-persistent references stored in a formlist cause issues? I could create a script that removes these references, but since there would never be an issue with my code that I can see, I don't want to waste resources fixing problems with no symptoms. I would never actually use a function that returns these forms or uses the forms in game, but I would run find searches on the formlist... and that is all I do with the formlist right now, just find searches. Any thoughts? Will saving these books in a formlist potentially cause bloat, errors, etc? Link to comment Share on other sites More sharing options...
gamefever Posted November 18, 2014 Share Posted November 18, 2014 As someone that has played a lot of hours on Skyrim...DONT do it. Think about this, you want to store an index system that builds a formlist in a persons save file? That's not cool with me. It would be easier and safer to create a "Book Restoration Table" and a prebuilt Formlist of all books in game. The spell then picks a book at random from that pre-existing list. Please don't over think this. There are Vays to get around scripting to achieve very similar results. Link to comment Share on other sites More sharing options...
lofgren Posted November 18, 2014 Share Posted November 18, 2014 (edited) You won't have bloat but you will have errors. Consider the following: 1. The player translates an object reference placed in the base game.2. The player takes the book into her inventory.3. The player drops the book and attempts to translate it again. When the player drops the book, it will have a new object reference id and effectively be a new object, resulting in a new translation and a new entry in your list. But wait, it gets worse! 4. After translating, the book is taken into the player's inventory again.5. The object reference id created in step 3 is recycled by the game. You now have a "none" entry in your table, because the object reference no longer exists. Upon reloading the game, none entries in formlists get sorted to the beginning, thus throwing off all of your entry indexes!!! Now even previously translated books will return the wrong index and therefore show the wrong translation. Unfortunately, I don't think this is a viable method of keeping track of previously translated books. As for bloat, formlists are pretty tiny files to save in a savegame. I have no idea what gamefever is freaking out about. Lots of popular mods use this method to keep track of items. I think Frostfall is probably the most popular example. Edited November 18, 2014 by lofgren Link to comment Share on other sites More sharing options...
FireFlickerFlak Posted November 18, 2014 Author Share Posted November 18, 2014 (edited) You won't have bloat but you will have errors. Consider the following: 1. The player translates an object reference placed in the base game.2. The player takes the book into her inventory.3. The player drops the book and attempts to translate it again. When the player drops the book, it will have a new object reference id and effectively be a new object, resulting in a new translation and a new entry in your list. But wait, it gets worse! 4. After translating, the book is taken into the player's inventory again.5. The object reference id created in step 3 is recycled by the game. You now have a "none" entry in your table, because the object reference no longer exists. Upon reloading the game, none entries in formlists get sorted to the beginning, thus throwing off all of your entry indexes!!! Now even previously translated books will return the wrong index and therefore show the wrong translation. Unfortunately, I don't think this is a viable method of keeping track of previously translated books. As for bloat, formlists are pretty tiny files to save in a savegame. I have no idea what gamefever is freaking out about. Lots of popular mods use this method to keep track of items. I think Frostfall is probably the most popular example. Wow, that is super helpful information, thanks! So I guess I will need to revise a bit, and I'll probably just make it so each book get destroyed after translation instead of using the formlist to keep it simple for now, very glad I found this out before writing the code for this part, saved me a ton of time. Especially the part about formlists reorganizing themselves because of none entries, glad I didn't have to figure that one out by trial and error! Edited November 18, 2014 by FireFlickerFlak Link to comment Share on other sites More sharing options...
Recommended Posts