I'm not sure how to get the hot-loading to work. I already have a mod folder so I ran the script with -n, the symlink is created, but then ? I have my mod in the mod folder, now how does the game load it ? My mod is not loading. I tried to pack it because I think that's how the game usually load mods (I believe it's not the way you want the game to load the mod but I tried anyway) How can I check if the symlink is correct ? Are there any steps after running the line ? If there are maybe you could add them in the usage tutorial ?
Yeah, you still pak the folder and install it to your mod folder/mod list as usual.
The utility creates up to three symlinks (in your bg 3 Data folder), based on how you answer the questions:
Public/<your mod name>/ (if you answered yes to create items)
Mods/<your mod name>/ (if you answered yes to create scripts)
Generated/Public/<your mod name>/ (if you answered yes to create icons/assets)
btw, it didn't work smoothly for me either. I got some error about a folder already existing, and the paths in the error were funky (they had forward and back slashes). If that happens to you, check to see which of the above symlinks were not created, and run the script again answering yes only to the questions relating to any symlinks that you still need.
You may already know this, but there's another way to hotload files. SE has a command to load a stats file while playing, so you can set up a listener on reset that reloads all your stat files, for example something like this:
local function on_reset_completed() for _, statPath in ipairs(StatPaths) do Ext.Stats.LoadStatsFile(statPath,1) end _P('Reloading stats!') end What's nice is that you don't need to reload a save, which is very time consuming. It's not as time consuming as a full restart obviously, but still pretty cumbersome. The SE approach reloads the files almost instantly. Unfortunately, it relies on SE to parse the reloaded files as opposed to the native bg3 parser, so it's not as robust. It works, but I have noticed issues. And, you still need the files to be in the child of the main Data directory.
TBH, I initially assumed this mod used that technique. I figured your python script that would write the SE function that reloads the files, but I can see that you're using symlinks to simulate a loose file mod, which seems like a more robust solution. I've tried to do it manually in the past, but I couldn't get it to work, so I'm excited to try your script and see what I did wrong!
P.S. Ya know what, the SE technique might actually be a nice addition to your script. If you populated that StatPath array with your symlinks, you'd give users an option to hotload with either a fast SE reset call or a slower, but more reliable save reload.
Nvm on my question. I see that this already lets you hotload your SE code when reloading the save! Nice.
btw, changing the above SE code to point to the symlinked ones works as expected, so I guess I have 2 hotloading options now. Thanks for putting this together. This will definitely shave a lot of time off of testing/tweaking.
hello. i may be stupid. but basically, i run the program, and once I get it to work, I can't find the single unified folder for the mod? I'll go into the game's data folder and the sub-folders will be scattered everywhere. I don't know if I'm just being dumb but um. please help.
New to modding, like 6 days new. I learned to make a class and now trying to learn to make spells,passives for my custom class. Will this tool help? If not, which tools would help me on this adventure. Never knew modding would be so satisfying and frustrating at the same time. Thanks in advance guys.
Yes it's helpful to streamline the creation of new mods and to make your mods have hotloading so you don't have to restart the game for changes to appear. This tool is just for initializing the mod, you'll need a lot of other tools for making the mod (VS code), and packing the mod (multitool).
Wanted to let some people know that may have had this little hiccup:
If PowerShell somehow tells you Python doesn't exist, it is more than likely you do not have the latest Python installed. Just head to the Microsoft store, get and install Python 3.12 (or whatever new one there may be), and re-do the steps detailed in the description section.
This might be a dumb question here, but ive made everything as i want it and converted the files into lsf and loca but the game wont recognize my loca file nor icons so what am i doing wrong?
It's meant to be combined with use of the multitool. The steps involve: 1. use this mod builder to create your mod and set up hot-loading (symlinks) 2. use the multitool to pack the mod since the .lsf.lsx and .loca.xml files can't really be hot-loaded 3. in game, can edit the other files and hotload them (GR2, DDS, script)
Funny enough that is the same issue I have too. I just can't get the bigger custom icon to load. The small one works perfectly fine. I also checked other unpacked mods to make sure the cross links are set up correctly.
But I don't think the Mod Builder is at fault here cause all it does is setting up the folder structure and some files. Maybe the DXT3 format isn't suited for the bigger custom icon? Otherwise I have no idea.
Yeah, my dumb ass commented when I saw there was no video, and while I scrolled up and down on the desc page, it was to look for a video- I thought "tutorial" referred to installing it like so many mods have.
Long story short, I didn't read and then complained that something that was fully provided wasn't there. Got no defense for that.
32 comments
I have my mod in the mod folder, now how does the game load it ?
My mod is not loading.
I tried to pack it because I think that's how the game usually load mods (I believe it's not the way you want the game to load the mod but I tried anyway)
How can I check if the symlink is correct ?
Are there any steps after running the line ? If there are maybe you could add them in the usage tutorial ?
The utility creates up to three symlinks (in your bg 3 Data folder), based on how you answer the questions:
btw, it didn't work smoothly for me either. I got some error about a folder already existing, and the paths in the error were funky (they had forward and back slashes). If that happens to you, check to see which of the above symlinks were not created, and run the script again answering yes only to the questions relating to any symlinks that you still need.
You may already know this, but there's another way to hotload files. SE has a command to load a stats file while playing, so you can set up a listener on reset that reloads all your stat files, for example something like this:
StatPaths={
"HotLoad/FrostControlSorcerer/Public/FrostControlSorcerer/Stats/Generated/TreasureTable.txt",
"HotLoad/FrostControlSorcerer/Public/FrostControlSorcerer/Stats/Generated/Data/ColdEquipment.txt",
"HotLoad/FrostControlSorcerer/Public/FrostControlSorcerer/Stats/Generated/Data/ColdPassives.txt",
"HotLoad/FrostControlSorcerer/Public/FrostControlSorcerer/Stats/Generated/Data/ColdSpells.txt",
"HotLoad/FrostControlSorcerer/Public/FrostControlSorcerer/Stats/Generated/Data/ColdStatus.txt",
"HotLoad/FrostControlSorcerer/Public/FrostControlSorcerer/Stats/Generated/Data/DamageNeutering.txt",
"HotLoad/FrostControlSorcerer/Public/FrostControlSorcerer/Stats/Generated/Data/ColdInterrupts.txt",
}
local function on_reset_completed()
for _, statPath in ipairs(StatPaths) do
Ext.Stats.LoadStatsFile(statPath,1)
end
_P('Reloading stats!')
end
What's nice is that you don't need to reload a save, which is very time consuming. It's not as time consuming as a full restart obviously, but still pretty cumbersome. The SE approach reloads the files almost instantly. Unfortunately, it relies on SE to parse the reloaded files as opposed to the native bg3 parser, so it's not as robust. It works, but I have noticed issues. And, you still need the files to be in the child of the main Data directory.
TBH, I initially assumed this mod used that technique. I figured your python script that would write the SE function that reloads the files, but I can see that you're using symlinks to simulate a loose file mod, which seems like a more robust solution. I've tried to do it manually in the past, but I couldn't get it to work, so I'm excited to try your script and see what I did wrong!
P.S. Ya know what, the SE technique might actually be a nice addition to your script. If you populated that StatPath array with your symlinks, you'd give users an option to hotload with either a fast SE reset call or a slower, but more reliable save reload.
btw, changing the above SE code to point to the symlinked ones works as expected, so I guess I have 2 hotloading options now. Thanks for putting this together. This will definitely shave a lot of time off of testing/tweaking.
If PowerShell somehow tells you Python doesn't exist, it is more than likely you do not have the latest Python installed. Just head to the Microsoft store, get and install Python 3.12 (or whatever new one there may be), and re-do the steps detailed in the description section.
1. use this mod builder to create your mod and set up hot-loading (symlinks)
2. use the multitool to pack the mod since the .lsf.lsx and .loca.xml files can't really be hot-loaded
3. in game, can edit the other files and hotload them (GR2, DDS, script)
I also checked other unpacked mods to make sure the cross links are set up correctly.
But I don't think the Mod Builder is at fault here cause all it does is setting up the folder structure and some files. Maybe the DXT3 format isn't suited for the bigger custom icon? Otherwise I have no idea.
Anyway thanks. That was indeed the solution. :)
Long story short, I didn't read and then complained that something that was fully provided wasn't there. Got no defense for that.