Jump to content

Editing an ESP while the game is running?


Recommended Posts

Good morning everybody!

 

Is it possible to modify an ESP file while the game is running?

 

You might think now "No, why would you want to do that?"

Let me explain:

 

A while ago I saw a "mod request" here that basically asked if it was possible to make a mod that lets you take screenshots in the game and make those screenshots into craftable "pictures" (for like settlements).

Initially you would think "No, not possible", but I think it could be done.

 

So, what would it take to make this work?

  • Taking a screenshot
    This is already possible ;-)
  • An external application (external to FO4, something that runs in the background) that does these things:
    • Scan the "screenshot folder" for new screenshots (or maybe respond to the "screenshot key beeing pressed")
    • If a new screenshot gets taken, do some image processing (change size, ...) and convert it to a .DDS textures file
    • create a material file with that screenshot.dds
    • Edit the ESP file of the mod (add a new material swap based on that created material file, create a new craftable object, add that material swap to that)

 

Could something like this be done?

Link to comment
Share on other sites

None that I know of, usually trying to edit an esp with the CK or Xedit, you would probably get the "This file is open in another application", and you wouldn't be able to write the file

Oh, yeah ...

I completley forgot that that was a thing that computers do ...

Link to comment
Share on other sites

It is possible:

 

- First, use the fcf console command to force the game to close all open file handles.

- Next, save the plugin.

- Finally, use the hlp <pluginname> console command to hot load the plugin you've been editing.

 

Telling from experience, it doesn't work very well though and I've gotten many of the weirdest CTDs out of trying to use it.

 

But to answer your underlying question: Yes. It could be done, best with an F4SE DLL but other ways to achieve it are certainly possible (even though ultimately lacking in elegance). The hotloading mechanism may actually be suitable for this purpose (solely adding new records to a plugin on the fly, never editing anything that's already there).

Link to comment
Share on other sites

It is possible:

 

- First, use the fcf console command to force the game to close all open file handles.

- Next, save the plugin.

- Finally, use the hlp <pluginname> console command to hot load the plugin you've been editing.

 

Telling from experience, it doesn't work very well though and I've gotten many of the weirdest CTDs out of trying to use it.

 

But to answer your underlying question: Yes. It could be done, best with an F4SE DLL but other ways to achieve it are certainly possible (even though ultimately lacking in elegance). The hotloading mechanism may actually be suitable for this purpose (solely adding new records to a plugin on the fly, never editing anything that's already there).

Interesting, thanks for letting me know.

Link to comment
Share on other sites

Also, if you use Mod Organizer, be aware that new files won't show up in an app's virtual filesystem until that app restarts. That means Fo4 may not see meshes and textures you add while the game is running.

 

It also means that if you've kept the Creation Kit open for some time, it won't see new files either. Or rather it will see the filenames, but if you try and use them in the editor, it will tell you that they don't exist. Which can be incredibly frustrating.

Link to comment
Share on other sites

Be super careful with FCF & HLP I have caused much frustration with content issues trying to use them to speed up debug workflows so use them no longer.

 

ReloadScript is solid tho, drops a log error if there are state/stack inconsistencies.

Link to comment
Share on other sites

I've found ReloadScript to behave erratically with a script that uses inheritance and implements events from a base class.

If I change and reload it, the Game will claim that all related scripts have been reloaded, but it is lying and it will not have reloaded the base class script.

Because if I also change the base class script, those changes will not reflect in-game after the reload.

Reloading the base class script separately offers no remedy either.

 

It works fine otherwise and is a great time saver.

Link to comment
Share on other sites

,,, which is why I avoid script namespaces, inheritence and extensions. All clever cereberal stuff that adds complexity. Complexity is orthogonal to maintainability*. Just sayin'

 

(*) Infact simplicity and elegance in exection has become more important than actual large breasted raw functionality for me.

Link to comment
Share on other sites

I find that carefully planned inheritance, together with the "fake" polymorphism the script system offers, can save me many a headache, simplify maintenance significantly and improve reusability.

For example, I have one script in my EEE mod that concerns itself with renaming a reference. Any renameable part uses it, and I have to maintain the code only once.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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