I think I have a corrupt script, how to fix?

Post » Fri Nov 16, 2012 10:41 pm

So, I have an old script that I actually forgot about because it’s not being used by anything any longer in my mod. And I think I did 2 things to start causing me some problems with this script.
  • I deleted the trigger that it was once attached to, and
  • I was poking around in the scripts folder and I may have opened the pex file up with Notepad++
Now, every time I try to attach a script to an object I get an error message telling me the object that my other script is attached to cannot be found. And then when I try to edit that script with the error (the one I opened the pex file in Notepad ++) it says there is a problem with it and it will not be loaded. I’ve even tried to take a script that I know is good, rename it and replace the bad one with the new one, but that won’t work either. I also recreated the trigger it was attached to, and tried to reattach it, and I get the message that the script is bad and will not be leaded.

That’s just what I get for poking around like I shouldn’t be doing, lol. How can I fix this?
User avatar
Stacyia
 
Posts: 3361
Joined: Mon Jul 24, 2006 12:48 am

Post » Sat Nov 17, 2012 8:03 am

Help! Nobody?
User avatar
Hussnein Amin
 
Posts: 3557
Joined: Sun Aug 05, 2007 2:15 am

Post » Sat Nov 17, 2012 5:34 am

Help! Nobody?

I may be misunderstanding what you're saying, but a .pex file is a 'compiled' file; it is generated by creating and editing a source file of the same name with a .psc extension in the source folder. That is what you modify using Notepad++ or whatever, then pass it through the script compiler to get the .pex. You shouldn't be modifying the .pex at all...

Let me know if this isn't what you needed to know, and I'll try to get you squared away.

-HB
User avatar
Rachel Eloise Getoutofmyface
 
Posts: 3445
Joined: Mon Oct 09, 2006 5:20 pm

Post » Fri Nov 16, 2012 11:01 pm

You shouldn't be modifying the .pex at all...

Let me know if this isn't what you needed to know, and I'll try to get you squared away.

-HB

Yes, I think I opened the pex file with notepad ++ and now I believe its corrupted somehow, and I can't figure out a way to fix it. If I try to add the script to a quest or object I get this:

SCRIPTS: Data\Scripts\BalokTriggerScene01a.pex: error. Unable to find object "BalokTrigger01a"

I'm pretty sure I deleted that object which I'm certain is why I'm getting that error. So, I thought if I could just add it to something, then edit the script and remove everything but the script name so it's just an empty script. Then remove it from that object and all should be fine. But them when I try to add it to something I get this:

Script: BalokTriggerScene01a had errors while loading, it will not be added to the object.

I even renamed it, took another pex file I know is not bad, renamed it to my bad file name and tried to load it that way and that won't work either.
User avatar
Rowena
 
Posts: 3471
Joined: Sun Nov 05, 2006 11:40 am

Post » Fri Nov 16, 2012 10:20 pm

Yes, I think I opened the pex file with notepad ++ and now I believe its corrupted somehow, and I can't figure out a way to fix it. If I try to add the script to a quest or object I get this:

SCRIPTS: Data\Scripts\BalokTriggerScene01a.pex: error. Unable to find object "BalokTrigger01a"

I'm pretty sure I deleted that object which I'm certain is why I'm getting that error. So, I thought if I could just add it to something, then edit the script and remove everything but the script name so it's just an empty script. Then remove it from that object and all should be fine. But them when I try to add it to something I get this:

Script: BalokTriggerScene01a had errors while loading, it will not be added to the object.

I even renamed it, took another pex file I know is not bad, renamed it to my bad file name and tried to load it that way and that won't work either.

Why can't you just recompile the source to a new .pex?

-HB
User avatar
Latisha Fry
 
Posts: 3399
Joined: Sat Jun 24, 2006 6:42 am

Post » Sat Nov 17, 2012 10:24 am

Why can't you just recompile the source to a new .pex?

-HB

OK, how do I do that?
User avatar
evelina c
 
Posts: 3377
Joined: Tue Dec 19, 2006 4:28 pm

Post » Sat Nov 17, 2012 1:29 am

OK, how do I do that?

Pardon me for asking, but noticing your post count, and seeing that you're posting in the CK forum, I'm not being egged on here, am I? :)

In any case; before starting the CK, rename the .pex that's giving you problems, find the source file for it in the source folder, and make a copy of it somewhere. Enter the CK and load up your mod. Go to where the offending script is attached (activator, etc.), Right-click on the script and select Edit Source. At this point, what you might want to try is removing or commenting out all the script in the source, leaving only the name at the top, and press Ctrl-S to save and compile it. That should get you a .pex with no code or properties in it, essentially a blank slate. Save your mod and you should be good to go. I'd run it and make a save at this point, then load up the mod in the CK and uncomment the code and properties, removing any that no longer refer to anything valid in your mod.

I'm thinking this should get you going.

-HB
User avatar
Maeva
 
Posts: 3349
Joined: Mon Mar 26, 2007 11:27 pm

Post » Fri Nov 16, 2012 10:00 pm

Pardon me for asking, but noticing your post count, and seeing that you're posting in the CK forum, I'm not being egged on here, am I? :smile:

No, not egging you on in the least. I was just unsure of exactly what you meant. And, as I said above, I already tried that. Currently, the script is not attached to anything that I can find. I was hoping I could attach it to something so I could edit it and remove the offending line as I also said above - even just leaving it blank. But it will not allow me to attach it to anything to be able to do that.

Anyway, I just tried simply deleting the pex and psc files for this script, and I'm not getting the errors anymore, obviously since it's no longer in there, lol. I didn't get any warnings when I loaded the CK, so hopefully that won't cause any problems. Like I say, the script isn't even used by anything, and I don't really need it as I did something different for that scene. (crosses fingers)

Do you think that was OK to do?
User avatar
N Only WhiTe girl
 
Posts: 3353
Joined: Mon Oct 30, 2006 2:30 pm

Post » Sat Nov 17, 2012 12:46 pm

No, not egging you on in the least. I was just unsure of exactly what you meant. And, as I said above, I already tried that. Currently, the script is not attached to anything that I can find. I was hoping I could attach it to something so I could edit it and remove the offending line as I also said above - even just leaving it blank. But it will not allow me to attach it to anything to be able to do that.

Anyway, I just tried simply deleting the pex and psc files for this script, and I'm not getting the errors anymore, obviously since it's no longer in there, lol. I didn't get any warnings when I loaded the CK, so hopefully that won't cause any problems. Like I say, the script isn't even used by anything, and I don't really need it as I did something different for that scene. (crosses fingers)

Do you think that was OK to do?

:smile: Once I noticed I wasn't taking to a neophyte modder, it got to feeling a little like an acolyte lecturing a sensei...thanks for being so graceful about it!

I doubt that a missing script for an object that no longer exists will cause issues. if the non-existent code is no longer called, and the object to which it was attached is itself gone, I can't see a way in which it could be a problem. I'd certainly let a few brave souls test it, though; truth be told, as a developer for a lotta years, I've found that a coder should never be the one to test their own stuff.

Best to you!
-HB
User avatar
Alessandra Botham
 
Posts: 3440
Joined: Mon Nov 13, 2006 6:27 pm

Post » Sat Nov 17, 2012 7:33 am

There are instructions for setting up a command in NotePad++ to compile scripts you have opened directly (No need for it to be attached to an in game object). Just FYI:

http://www.creationkit.com/Notepad%2B%2B_Setup
User avatar
Mari martnez Martinez
 
Posts: 3500
Joined: Sat Aug 11, 2007 9:39 am

Post » Sat Nov 17, 2012 3:52 am

There are instructions for setting up a command in NotePad++ to compile scripts you have opened directly (No need for it to be attached to an in game object). Just FYI:

http://www.creationkit.com/Notepad%2B%2B_Setup

I understand that; thanks! I use UltraEdit Pro. Appreciate the tip! :)
User avatar
Chris Guerin
 
Posts: 3395
Joined: Thu May 10, 2007 2:44 pm


Return to V - Skyrim