BSA's and altering script files?

Post » Wed Jun 05, 2013 9:47 pm

I have read through similar discussions, but I'm still unclear about what should be done here.

Do I need to leave the BSA as is, or can I extract the scripts, structure them in a FOMOD and use a mod manager (NMM) to install them as part of a package with the esp file?

I want to alter a script within the BSA to increase a light intensity of a candle.

It was suggested that I extract the associated psc file from the BSA, change the line that calls for the light source to something brighter, like DefaultTorch01NS ( for ex ). And place that directly into the Data folder. However, it's not doing anything.

I can only assume it's because the mod is running the unmodified script from the BSA and thus overriding the modified script of the same name.

Now, couldn't I just extract all the script files and restructure them into a Data folder, with the modified light script, and repackage that with the esp?

User avatar
Syaza Ramali
 
Posts: 3466
Joined: Wed Jan 24, 2007 10:46 am

Post » Wed Jun 05, 2013 5:43 pm

Loose files override those contained within a BSA file.

Did you recompile your amended script? You need to compile into a PEX before the game will recognise it. Then place it in the Data/Scripts folder.

There were reports that scripts contained within a compressed BSA wouldn't fire properly, and for a while the recommendation was that BSA files with scripts should be uncompressed - although if that were the case the official BSA files (plus USKP etc.) wouldn't work correctly. AFAIK Arthmoor debunked this issue - as long as you make sure the file is compressed properly using official tools.

User avatar
Penny Wills
 
Posts: 3474
Joined: Wed Sep 27, 2006 6:16 pm

Post » Wed Jun 05, 2013 7:43 pm

Actually, it was suggested that I extract the pex and the psc from the BSA, change the psc and place both of those in the data folder. It wasn't suggested that anything be done with the pex file or to create another one.

So, once the psc file is altered, I should then create a new pex file using the modified psc file?

I'm not sure how to do that, I'm afraid.

Can the existing pex file be modified with notepad++?

User avatar
Angus Poole
 
Posts: 3594
Joined: Fri Aug 03, 2007 9:04 pm

Post » Wed Jun 05, 2013 4:14 pm

I don't think you can edit a PEX file as it's already been compiled.

A psc file is the original source of the script - provided by Bethesda purely for modding purposes, as psc files are not used by the game itself - they need to be compiled in order to work.

All you need to do is put the psc file into data/scripts/source, then load up the Creation Kit and compile it from there.

http://www.creationkit.com/Papyrus_Compiler_Reference

"The easiest way to run the compiler is to have the Creation Kit do the compilation for you via the Papyrus Script Manager. Simply right-clicking on a script and selecting "Compile" will compile the script and show you any errors reported."

User avatar
Nitol Ahmed
 
Posts: 3321
Joined: Thu May 03, 2007 7:35 am

Post » Wed Jun 05, 2013 11:20 am

I haven't actually used the Skyrim editor yet so I could very well be wrong, but you shouldn't need to extract any script from the BSA archive. They will all be loaded up by the editor on startup, and you can just make your changes from there. At least that's how it works in all the other Bethesda editors I've worked with.

User avatar
meghan lock
 
Posts: 3451
Joined: Thu Jan 11, 2007 10:26 pm

Post » Wed Jun 05, 2013 12:21 pm

Yep, that's correct - but Senor Cinco has already edited the psc in Notepad so it'll save him having to make the edit again.

User avatar
Cheville Thompson
 
Posts: 3404
Joined: Sun Mar 25, 2007 2:33 pm

Post » Wed Jun 05, 2013 6:15 pm

Thanks you for your expert guidance, my friend. I was digging and found the CK bit a moment ago. I just replaced the newly edited psc file into the Data folder... without the old pex file.

It seems simple enough. I'm not 100% on where to find the script to execute the compiler command.

*loads up CK*

User avatar
Richard Dixon
 
Posts: 3461
Joined: Thu Jun 07, 2007 1:29 pm

Post » Thu Jun 06, 2013 1:03 am

From the top menu, Gameplay->Compile Papyrus Scripts should do it :)

User avatar
Lalla Vu
 
Posts: 3411
Joined: Wed Jul 19, 2006 9:40 am

Post » Wed Jun 05, 2013 7:50 pm

Ok... I found the psc in the Papyrus Manager, I right clicked and selected 'Compile".

It opened a working window, ran a blue bar across it and listed "failed" in the status line. :bonk:

Here is the script...

Scriptname aaaMRlightGenActScript extends ObjectReference  Bool BlockActivationForm Property MyBase AutoForm Property MyNewBase AutoFormList Property aaaMRlightONFLST AutoFormList Property aaaMRlightOffFLST AutoFormList Property aaaMRlightMiscFLST AutoFormList Property aaaMRlightMiscIIFLST AutoInt Property DoOnce AutoInt Property NumInList AutoLight Property DefaultCandleLight01NS AutoObjectReference Property MyLight AutoImport FormListImport UtilityEvent OnLoad()BlockActivation(True)MyBase = Self.GetBaseObject()If aaaMRlightMiscFLST.HasForm(MyBase)NumInList = aaaMRlightMiscFLST.Find(MyBase)MyNewBase = aaaMRlightMiscIIFLST.GetAt(NumInList)Wait(0.1)Disable()PlaceAtMe(MyNewBase)Delete()ElseEndIf;If aaaMRlightOnFLST.HasForm(MyBase) && DoOnce == 0MyLight = PlaceAtMe(DefaultTorch01NS)DoOnce = 1ElseEndIfEndEventEvent OnActivate(ObjectReference akActionRef)If aaaMRlightMiscIIFLST.HasForm(MyBase)NumInList = aaaMRlightMiscIIFLST.Find(MyBase)MyNewBase = aaaMRlightOffFLST.GetAt(NumInList)ElseIf aaaMRlightOffFLST.HasForm(MyBase)NumInList = aaaMRlightOffFLST.Find(MyBase)MyNewBase = aaaMRlightOnFLST.GetAt(NumInList)ElseIf aaaMRlightOnFLST.HasForm(MyBase)NumInList = aaaMRlightOnFLST.Find(MyBase)MyNewBase = aaaMRlightOffFLST.GetAt(NumInList)MyLight.Disable()MyLight.Delete()ElseEndIfPlaceAtMe(MyNewBase)Disable()Delete()EndEventEvent OnGrab()If aaaMRlightOffFLST.HasForm(MyBase)NumInList = aaaMRlightOffFLST.Find(MyBase)MyNewBase = aaaMRlightMiscFLST.GetAt(NumInList)Disable()Delete()MyLight.Disable()MyLIght.Delete()Game.GetPlayer().AddItem(MyNewBase)ElseIf aaaMRlightOnFLST.HasForm(MyBase)NumInList = aaaMRlightOnFLST.Find(MyBase)MyNewBase = aaaMRlightMiscFLST.GetAt(NumInList)Disable()Delete()MyLight.Disable()MyLIght.Delete()Game.GetPlayer().AddItem(MyNewBase)ElseEndIfEndEvent

I'm only trying to change the lightsource at line 32 - MyLight = PlaceAtMe(DefaultTorch01NS)

It originally read MyLight = PlaceAtMe(DefaultCandleLight01NS)

Now, it has the old light source referenced in line 12 where it reads...

Light Property DefaultCandleLight01NS Auto

You think that needs to be changed as well? I'll try that and see what happens. :confused:

Not sure how to debug this. It's all a scripting learning experience for me.

User avatar
Naughty not Nice
 
Posts: 3527
Joined: Sat Nov 04, 2006 6:14 am


Return to V - Skyrim