Jump to content

Scripts Not Included in ESP?


Recommended Posts

Hi Everybody! (Hi Dr. Nick!)

 

I've created a small mod (ESP file) that adds a new interior cell. I have written some custom Papyrus scripts as part of the mod.

 

While sharing it here on the forms to get some troubleshooting help (https://forums.nexusmods.com/index.php?/topic/6413086-script-compiles-doesnt-work-as-intended-noob/), the guys were saying that the scripts were not showing up. I know they were there though, attached to the appropriate ObjectReferences.

 

Do I have to do something special to get my scripts to "become part of the ESP file", so I can share the ESP file and the scripts are included?

 

(That was a Simpsons reference above if anyone missed it...)

Link to comment
Share on other sites

New Custom Scripts (at least in Fallout 4) are not included in your .esp when you create them, but are saved in your script folder under Fallout 4 > Data > Scripts > User > *CustomScriptName.pex*. If its a Quest or Perk Fragment Script, it will be found under Scripts > User > Fragments > Perk/Quest/Terminal/ect. > *CustomFragmentName.pex*. You must take a copy of the script there and place them in the same directory that you found them when packaging your mod.

 

So if you made a new winrar/7zip it should look similar to this.

MyMod.esp

Script (Folder)

User (Folder)

CustomScript.pex

Fragments (Folder)

CustomFragment.pex

 

This is all assuming you didn't make a new "Namespace" for your scripts, in which case it would add another folder for you to branch through.

 

This is what's known as a "loose files" mod, versus an archived mod, which you'll use the creation kit to create.

 

Edited as I accidently pressed enter too soon.

Edited twice for clarity.

Edited by JackRob
Link to comment
Share on other sites

Word of caution when using the CK's built in archive creation tool. It will grab any loose file it thinks could remotely be associated with your mod.

 

So for example if you have F4SE installed, which installs replacement base scripts like ObjectReference, when you try to pack with CK if any of your objects use a script that points to ObjectReference it will try to get that script which is part of F4SE and pack that with your mod. You DO NOT want that. If your mod has few files it's pretty easy to track what files belong and which ones do not in order to remove them from the packing list. But as mods grow, like the Mirai mod I'm working on, when it has some 2,000 files to pack it gets a bit hard to manage manually like that.

 

Then there's also the annoying situation where CK fails to find some assets which are actually part of your mod. Yup it does that for Mirai :sad:

 

The 2 options I have for solution are ones I employ depending on the use case. If you do not have textures, or any other assets which have to be specifically modified for use on XB1, or if you do not plan to release for XB1 then only the first would really be applicable.

 

1) Create a staging folder somewhere outside the game folder on your hard drive. It could be on your "Desktop", in "My Documents", it doesn't matter. As you create your mod when you make new scripts, meshes, textures, or whatever. Copy the original sources from the game data folder to your staging folder using the same path structure.

 

So example time:

I'll use one of my FO4 mods to keep the structure naming similar. In my SummonCompanions mod I have a staging folder that looks like this. Names within brackets [] are folders.

 

**Base data folder**
 
SummonCompanions.esl
SummonCompanions.esp
[Scripts]\
    [SummonCompanions]\
        SummonActor.pex
        SummonCurrentCompanion.pex
    [Source]\
        [User]\
            [SummonCompanions]\
                SummonActor.psc
                SummonCurrentCompanion.psc
Reference image

bOb1t78.png

 

Now when I need to publish, I just select it all, make a zip file, and upload. If i want to pack it (which I generally do) I just open up the archive tool manually and drag the folders in. Then save the archive. This ensures I only get files that belong to my mod, as well as making sure I get all the files that do. It requires I am diligent about copying any modified sources from the game folder to the staging folder.

 

2) The other option which I use sometimes (generally only when packing for XB1) is to keep a clean copy of the game folder around. This way the data folder is empty of any loose files and only the base game files are there. Place all the mod required files, meshes, materials, textures, sounds, and scripts back in as loose files. Now if you use the CK archive tool it can only grab your mod's files. However the previously mentioned issue of it not always grabbing everything exists. If you know it misses a file frequently when trying to pack, you can just drag it in and add it to the packing list manually. You can also export the list so you can quickly import it as well if you frequently need to repack things.

Edited by BigAndFlabby
Link to comment
Share on other sites

  • Recently Browsing   0 members

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