lee3310 Posted March 15, 2023 Share Posted March 15, 2023 Is there any advantage in injecting modded leveled list to vanilla containers (leveled items) using script instead of editor ? (V_LL.AddForm(M_LL as Form, lvl, count))And if i do it in a quest script, do i have to flag it as "run once" or i can safely start/stop it mid save if i decide to add more containers in the future.PSI'm also using a GV as "chance None". Link to comment Share on other sites More sharing options...
DieFeM Posted March 15, 2023 Share Posted March 15, 2023 (edited) Is there any advantage in injecting modded leveled list to vanilla containers (leveled items) using script instead of editor ? If there's another mod that modifies the same lvl through the editor, and it is loaded lower in the modlist, it will overwrite your changes, by doing your changes with scripts you avoid this problem. The chance of some other mod overwriting your changes is low, since most modders use the inject method, but is always better doing it "bulletproof". And if i do it in a quest script, do i have to flag it as "run once" or i can safely start/stop it mid save if i decide to add more containers in the future.PSI'm also using a GV as "chance None". A formlist doesn't allow the same form to be added, if you add the same form twice it will not make any difference. So I guess it's safe to restart the quest to add other forms later. Edit: In your script code you are adding a form to a fromlist, but the actual questin was "adding lists to vanilla containers". If we are talking about containers then I'm pretty sure you can actually add the same lvl list many times, so I guess that will spawn items from each instance of the leveled list. So I think is convenient that you inject lvl lists in to an existing lvl list than directly to the container. Edited March 15, 2023 by DieFeM Link to comment Share on other sites More sharing options...
lee3310 Posted March 15, 2023 Author Share Posted March 15, 2023 Is there any advantage in injecting modded leveled list to vanilla containers (leveled items) using script instead of editor ? If there's another mod that modifies the same lvl through the editor, and it is loaded lower in the modlist, it will overwrite your changes, by doing your changes with scripts you avoid this problem. The chance of some other mod overwriting your changes is low, since most modders use the inject method, but is always better doing it "bulletproof". And if i do it in a quest script, do i have to flag it as "run once" or i can safely start/stop it mid save if i decide to add more containers in the future.PSI'm also using a GV as "chance None". A formlist doesn't allow the same form to be added, if you add the same form twice it will not make any difference. So I guess it's safe to restart the quest to add other forms later. Edit: In your script code you are adding a form to a fromlist, but the actual questin was "adding lists to vanilla containers". If we are talking about containers then I'm pretty sure you can actually add the same lvl list many times, so I guess that will spawn items from each instance of the leveled list. So I think is convenient that you inject lvl lists in to an existing lvl list than directly to the container. Thank you for this explanation, and yes, i will add the LVL to an existant one (by container i was referring to "Container_Loot_Furniture_Tiny" for exemple which is a leveled List used in containers like desks).In the editor, you can duplicate forms inside a leveleditem but if injecting the same form twice doesn't have any side effects (like changing the spawn chance) then it's all good. Link to comment Share on other sites More sharing options...
LarannKiar Posted March 18, 2023 Share Posted March 18, 2023 Is there any advantage in injecting modded leveled list to vanilla containers (leveled items) using script instead of editor ? It eliminates the possibility of mod conflicts on the record-level. However, if two mods touch the same vanilla form, funny things can still happen depending on the mods.. And if i do it in a quest script, do i have to flag it as "run once" or i can safely start/stop it mid save if i decide to add more containers in the future. Note that if you set a quest to "Run once", you won't be able to start it again if it's been stopped previously because the game will block it. (Save games hold quest stage, running state, etc. informations in the form of a quest data). Link to comment Share on other sites More sharing options...
lee3310 Posted March 18, 2023 Author Share Posted March 18, 2023 Is there any advantage in injecting modded leveled list to vanilla containers (leveled items) using script instead of editor ? It eliminates the possibility of mod conflicts on the record-level. However, if two mods touch the same vanilla form, funny things can still happen depending on the mods.. And if i do it in a quest script, do i have to flag it as "run once" or i can safely start/stop it mid save if i decide to add more containers in the future. Note that if you set a quest to "Run once", you won't be able to start it again if it's been stopped previously because the game will block it. (Save games hold quest stage, running state, etc. informations in the form of a quest data). Well, i hope i can still stop the quest after disabling the run once flag mid-save (to trigger OnQuestInit event again). Link to comment Share on other sites More sharing options...
LarannKiar Posted March 18, 2023 Share Posted March 18, 2023 (edited) Is there any advantage in injecting modded leveled list to vanilla containers (leveled items) using script instead of editor ? It eliminates the possibility of mod conflicts on the record-level. However, if two mods touch the same vanilla form, funny things can still happen depending on the mods.. And if i do it in a quest script, do i have to flag it as "run once" or i can safely start/stop it mid save if i decide to add more containers in the future. Note that if you set a quest to "Run once", you won't be able to start it again if it's been stopped previously because the game will block it. (Save games hold quest stage, running state, etc. informations in the form of a quest data). Well, i hope i can still stop the quest after disabling the run once flag mid-save (to trigger OnQuestInit event again). Yes, if you uncheck the "Run once" flag mid-playthrough, you can start-stop the quest anytime and as many times as you like because the game won't block it anymore. Edited March 18, 2023 by LarannKiar Link to comment Share on other sites More sharing options...
lee3310 Posted March 18, 2023 Author Share Posted March 18, 2023 Is there any advantage in injecting modded leveled list to vanilla containers (leveled items) using script instead of editor ? It eliminates the possibility of mod conflicts on the record-level. However, if two mods touch the same vanilla form, funny things can still happen depending on the mods.. And if i do it in a quest script, do i have to flag it as "run once" or i can safely start/stop it mid save if i decide to add more containers in the future. Note that if you set a quest to "Run once", you won't be able to start it again if it's been stopped previously because the game will block it. (Save games hold quest stage, running state, etc. informations in the form of a quest data). Well, i hope i can still stop the quest after disabling the run once flag mid-save (to trigger OnQuestInit event again). Yes, if you uncheck the "Run once" flag mid-playthrough, you can start-stop the quest anytime and as many times as you like because the game won't block it anymore. That's good news. Thanks :thumbsup: Link to comment Share on other sites More sharing options...
PJMail Posted March 21, 2023 Share Posted March 21, 2023 Unfortunately the critical flaw in script based leveledlist injection is that leveledlists DO allow duplicates AND you cannot read a leveledlist to make sure you don't add a duplicate.Basically you need to be VERY sure you injection only runs once as every time you run it you will skew the odds/numbers on what the leveledlist will provide.eg. You are injecting a gun at 50% chance. First Injection run you have 50% of the gun from the LL. Second Injection run 50% chance 1 Gun, and 25% chance of 2 guns. etc. I tested this extensively via scripting to prove it.You can 'read' an LL crudely by attaching it to a base container, creating an instance of that container, count its contents, delete instance, repeat, finally compute odds. Some mods don't know this and eventually their injected item floods the vendors inventory. Link to comment Share on other sites More sharing options...
lee3310 Posted March 21, 2023 Author Share Posted March 21, 2023 (edited) Unfortunately the critical flaw in script based leveledlist injection is that leveledlists DO allow duplicates AND you cannot read a leveledlist to make sure you don't add a duplicate.Basically you need to be VERY sure you injection only runs once as every time you run it you will skew the odds/numbers on what the leveledlist will provide.eg. You are injecting a gun at 50% chance. First Injection run you have 50% of the gun from the LL. Second Injection run 50% chance 1 Gun, and 25% chance of 2 guns. etc. I tested this extensively via scripting to prove it.You can 'read' an LL crudely by attaching it to a base container, creating an instance of that container, count its contents, delete instance, repeat, finally compute odds. Some mods don't know this and eventually their injected item floods the vendors inventory. Quote: "In the editor, you can duplicate forms inside a leveleditem but if injecting the same form twice doesn't have any side effects (like changing the spawn chance) then it's all good." unquote That's exactly what i was afraid of. I will see if it's possible to check if the form is already in the LvLitem before adding it. (or maybe set a var to false after adding each LVL) Edited March 21, 2023 by lee3310 Link to comment Share on other sites More sharing options...
DieFeM Posted March 21, 2023 Share Posted March 21, 2023 Unfortunately the critical flaw in script based leveledlist injection is that leveledlists DO allow duplicates AND you cannot read a leveledlist to make sure you don't add a duplicate.Basically you need to be VERY sure you injection only runs once as every time you run it you will skew the odds/numbers on what the leveledlist will provide.eg. You are injecting a gun at 50% chance. First Injection run you have 50% of the gun from the LL. Second Injection run 50% chance 1 Gun, and 25% chance of 2 guns. etc. I tested this extensively via scripting to prove it.You can 'read' an LL crudely by attaching it to a base container, creating an instance of that container, count its contents, delete instance, repeat, finally compute odds. Some mods don't know this and eventually their injected item floods the vendors inventory. Good to know, I was under the impression it worked like a FormList. Link to comment Share on other sites More sharing options...
Recommended Posts