Jump to content

Possible to enumerate a mods added items via script?


RoyBatterian

Recommended Posts

So I've had an idea... Is it possible to write a script or set of scripts which can enumerate every item added by any mod and put them in containers?

 

I was thinking of doing such a project for my first large mod. Making a warehouse in Goodsprings and adding a bunch of containers in it to place items into as like a giant cheat bin. My intention of such a mod is for Video Makers (including me) to check out items, armor, weapons, clutter, chems, food, etc added by ANY mod without using any assets from that mod. I really want do such a thing procedurally rather than having to manually add items to containers, and making a separate version or patch for each mod which would just be a giant waste of time and effort.

 

I realize cheaters are going to use it too to just cheat... but cheaters will find a way to cheat anyways so I don't really think it's an issue for me.

Edited by RoyBatterian
Link to comment
Share on other sites

There is currently no script-able way to compile a list of all the items added by a specific/every mod currently loaded.

The only option is to compile that list manually, using the NVSE BuildRef command - a method far too tedious to be practical.

Link to comment
Share on other sites

There is currently no script-able way to compile a list of all the items added by a specific/every mod currently loaded.

The only option is to compile that list manually, using the NVSE BuildRef command - a method far too tedious to be practical.

Gribble and I have talked about doing this in loops just to test the performance impact and to see if pointing to a non-existent FormID would cause problems. I expect IsFormValid or GetType to crash either the script or the game (because I have so much faith in it) at some point, but I haven't tried it yet.

Link to comment
Share on other sites

I expect IsFormValid or GetType to crash either the script or the game (because I have so much faith in it) at some point, but I haven't tried it yet.

From my experience, all NVSE functions include some form of assertion procedure (which most vanilla functions obviously lack) and are 100% safe to use, even when fed with bad input.

Link to comment
Share on other sites

 

Gribble and I have talked about doing this in loops just to test the performance impact and to see if pointing to a non-existent FormID would cause problems. I expect IsFormValid or GetType to crash either the script or the game (because I have so much faith in it) at some point, but I haven't tried it yet.

 

 

Well that sounds promising if as jazzisparis says, that there is sanity checks/failure assertions. So then it could be possible with the BuildRef function and then checking the type with GetType in a loop? Hrm... wouldn't that take a crazy amount of time and memory to iterate the entire formid list?

Link to comment
Share on other sites

Well that sounds promising if as jazzisparis says, that there is sanity checks/failure assertions. So then it could be possible with the BuildRef function and then checking the type with GetType in a loop? Hrm... wouldn't that take a crazy amount of time and memory to iterate the entire formid list?

That's negligible. The real problem is the sheer amount of work it would entail. You will have to open each and every mod you want supported by your mod, check the Form ID of every single item it adds, convert the Form ID to decimal and add a BuildRef code line. This is what I meant by "far too tedious to be practical". Such mod, given the existing scripting options, cannot be made to universally support every mod out there. Ultimately, it's up to you, but if you ask me - it's not worth the effort.

Link to comment
Share on other sites

yes that doesn't seem worth the effort at all.. especially converting stuff to decimal (yuck!). Seems to be less effort to just make containers by hand with all the stuff, and then check if the mod is loaded or not.

Edited by RoyBatterian
Link to comment
Share on other sites

 

Well that sounds promising if as jazzisparis says, that there is sanity checks/failure assertions. So then it could be possible with the BuildRef function and then checking the type with GetType in a loop? Hrm... wouldn't that take a crazy amount of time and memory to iterate the entire formid list?

That's negligible. The real problem is the sheer amount of work it would entail. You will have to open each and every mod you want supported by your mod, check the Form ID of every single item it adds, convert the Form ID to decimal and add a BuildRef code line. This is what I meant by "far too tedious to be practical". Such mod, given the existing scripting options, cannot be made to universally support every mod out there. Ultimately, it's up to you, but if you ask me - it's not worth the effort.

 

That doesn't sound too bad.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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