#Best way to Incorporate Optional Files For Mod?

11 messages · Page 1 of 1 (latest)

unreal nymph
#

Summed up, I have variants of a file that contextually need to get loaded by Persona Essentials, and I want to choose which variant is loaded based on user choice in the "Configure Mod" menu of my mod.

My naive attempts of simply copying the respective file to the appropriate location is causing Reloader-ii to crash. Seems like it read locks files. I can successfully create
new files in the mod directory, but File.Copy throws exceptions. Not sure if there's proper ways to use the API or swapping files at specific times where it's safe to do so.

Does anyone know of a sane way to do something like this? I'm guessing I will likely need an entirely different approach here, but wanted to check before going that route.

Thanks in advance.

jade fox
#

this hasn't been looked at in a while so it's probably not the cleanest but it works well enough at showing how you would set something like that up
https://github.com/MadMax1960/Reloaded-2-Persona-Config-Template/blob/master/NaoSmiley/Mod.cs

you'll need to set project references to those respective dependencies (crifsv2 for itself, file emulation framework for PAK/BF/etc, BGME framework for itself, etc)

GitHub

Template for options in r2 related to persona game mods and frameworks - MadMax1960/Reloaded-2-Persona-Config-Template

#

you could also look at any open source code from other mods to get an idea of how config options are handled (I'd look at animatedswine's github for example)

bitter roost
#

Yeah following along with that should get you what you need, it's basically just a matter of using the API to add files from different locations, definitely don't use stuff like File.Move or copy

unreal nymph
#

Ya'll rock. Looking at it now, thank you!

#

This is the best

bitter roost
#

lol

jade fox
#

that one was max's doing lol

unreal nymph
#

I love it.

unreal nymph
#

😤 Finally

bitter roost
#

Nice