Jump to content

Recommended Posts

Posted (edited)

Hi, I'm learning modding for Skyrim SE/AE and am just messing around to see what does what. I've gotten to papyrus scripting now. I've set notepad++ up, compiling works, .pex files get created. As a test case to see if it works, I've tried to edit SL matchmaker spell notification. Currently, it says "[name] has an irresistible aura about them". I changed the text in it to "[name] has an irresistible aura about them TEST TEST TEST" in "sslMatchMakerMagicEffect.psc", compiled it, replaced it in the scripts folder, to see if the change would take effect, but it doesn't. The message remains the same.

 

I use Vortex to manage mods. In case that was the issue, I created a .zip file with the correct structure to replace the file and installed it as a mod. The file gets replaced. I compare the files hashes for the file in the "scripts" folder to the file I compiled, the hashes match. That seems to to indicated that the .pex file is replaced correctly, but the game seems to ignore it.

 

I've also tried other changes in the magic effect file, nothing seems to affect it, it looks like it just uses the original script.

 

Is there a cache somewhere? Do I need to do something more than just replace the .pex file to make changes take effect?

 

Any help would be appreciated.

 

Thanks!

 

Edited by Grey Fox
Resolved.
Posted

Scripts get baked into save files in some cases. I do not know of a list of things that do get baked and things that don't. I suppose you can always assume active scripts to be in the save, ie. a script attached to an enchantment on a weapon you're currently holding. But at the same time, you can update the script of a quest that is also running, you'll get a notification in the papyrus log about a thread trying to run code that has been changed but that's about it. Sometimes quests can't be updated on the fly.

 

ReSaver is your friend during development. Remove script instances and for the most part the game will be oblivious to the script ever existing, allowing you to push updates. Always test from a clean save or an entirely new game before concluding your script works however.

Posted (edited)

In ReSaver there's a search function you can use. Simply type the script name into it and remove everything is pretty much how that goes.

 

You can archive up the entire mod you've modified, scripts and plugins included and I'll have a look at it.

 

Edit: Had a look at the original mod from the link you provided. There's nothing weird going on there. Changing sslMatchMakerMagicEffect.psc will be enough.

Edited by traison
Posted

Tried ReSaver, deleting related stuff caused CTD in that save. I'm testing on new saves now, so ReSaver isn't needed at this point I think.

 

But there is a new twist now. Just throwing things at the wall and seeing what sticks, I ended up with just adding random "!" in the string. The I decided to replace the files in the original matchmacker mod in the Vortex folder, and reinstall the mod.

 

And now, instead of the new string with "!" in it, it displays the old "TEST TEST TEST" message I couldn't get before :\

 

I'm confused. Is this Vortex related? Does Papyrus compiler cache something somewhere? I can't get new changes appearing again.

 

Perhaps it is related to how I compile? I copy the .psc files to a new folder, compile there, and them copy the .pec and .psc files out (or create a .zip to install). I don't compile and edit directly in the Skyrim/Data/Scripts directory. Perhaps it conflicts with the existing file with the same name there when I compile? ?

 

Time to tinker some more.

Posted

I'd blame Vortex but I'm biased, I don't like the way it does things. It's been too unreliable in the past so I dumped it. I however assumed that was not the issue here since you said you did hash checks on the installed file compared to the compiled file. I must say that is a breath of fresh air, as most of the time we start off at "what is md5?".

 

Do you know are the files that Vortex creates in the actual game data directory (i.e. ...\SteamApps\common\Skyrim Special Edition\Data) symbolic links or hardlinks?

Posted (edited)
2 minutes ago, traison said:

I'd blame Vortex but I'm biased, I don't like the way it does things. It's been too unreliable in the past so I dumped it. I however assumed that was not the issue here since you said you did hash checks on the installed file compared to the compiled file. I must say that is a breath of fresh air, as most of the time we start off at "what is md5?".

 

Do you know are the files that Vortex creates in the actual game data directory (i.e. ...\SteamApps\common\Skyrim Special Edition\Data) symbolic links or hardlinks?

 

Hardlinks. At least that's what Vortex settings say, I'll check what Windows thinks.

Edited by Grey Fox
Posted

In that case it will be enough to do a binary hash comparison between the compiled file in the Data directory and the compile file you know was created by the papyrus compiler.

 

You can also test a hardlink like this: Open the pex file in notepad and replace its contents with "lol", then open the same pex file in the matchmaker mod directory. If it also contains "lol" you know it's correct.

Posted

Windows agrees that the files are hardlinked.

 

Your loltest confirms it.

 

And now for some reason it displays one my other testing texts, but not the latest. It now seems to be lagging a few versions behind.

 

The compiled .pex hash matches the one in the mod directoy.

Posted

What does vortex do if you delete the pex file it places in the data directory and replace it with an "actual" file. Like for instance, install your edited script manually, bypassing vortex. Then whether it works or not, do another "loltest" afterwards to see if vortex replaced the manually installed file with a link to matchmaker.

Posted (edited)

Was doing what you suggested, but noticed that the text strings in .pex files are visible when opened in a text editor. And the compiled file in the end that I get has the wrong (old) string. Something is up with my compiling process. So I started going down that rabbit hole instead.

 

It get's messy.

 

The short version - since I have the source .psc file outside the game directory, and the game directory (one of the includes to the compiler) has a file of the same name, the compiler compiles the file in the game directory instead, but outputs it to the correct location (outside the game directory). So my file more or less got ignored until some version of my edits ended up in the game folder instead. 

 

If I edited the .psc file in the game directory, but compile a file with the same name outside the game directory, it still uses the game dir .psc in the end for the result.

 

I think I have an idea how to sort this all out as it's starting to make more sense to me now.

 

I'll see if I can sort this out and get to a "clean" solution, and post an update here.

 

And thanks for the help!

Edited by Grey Fox
Posted
12 minutes ago, Grey Fox said:

game directory (one of the includes to the compiler) has a file of the same name, the compiler compiles the file in the game directory instead, but outputs it to the correct location

 

If you're compiling through the CK then you should keep the folder structure the game uses. Don't do anything fancy, because you have no control over the arguments passed to the compiler. Script sources go where CreationKit.ini specifies where they should be. Output is wherever the CK wants it. Your ini is most likely different, I set mine back to the LE path because I'm old fashioned like that:

[Papyrus]
sScriptSourceFolder = ".\Data\Scripts\Source"

 

Posted

I do not compile directly from CK. I use the notepad++ plugin from the notepad++ plugin registry.

 

But I did figure it out. The issue is with how I wanted to do things, and I doubt many will face it, but here is what was going on, just in case:

 

What I wanted:

1. Use Vortex.

2. Copy mod .psc files to a work folder outside the game/mod folder (to keep things neat and tidy).

3. Edit them.

4. Compile them.

5. Create a new .zip with the new files, so I can install them via Vortex to replace the orginal files, without affecting original mod files directly (so Vortex features continue to work).

 

What actually happened:

In step 4, the compiler compiled the file from the game folder instead of the work folder. Thus, my work .psc had changes, but the resulting .pex did not.

 

Solution includes jumping though hoops:

Between step 3 and step 4, I needed to add another step: copy the .psc files from the work folder to the game folder and overwrite them. Then the rest works as I wanted.

 

Perhaps the main issue was step 1, and other mod managers would not need this jumping through hoops for this workflow. Or my compiling process has issues.

 

I might want to automate this if I'll do this a lot.

 

In any case, I got it working!

 

Thanks traison!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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