Overwritten .psc irreplaceable? Request for unmodified "

Post » Wed Jun 20, 2012 2:56 pm

Hi guys,

I've accidentally overwritten the "PressurePlate" script. While I was able to replace the compiled script under the ".pex" file extension, I could not locate the source ".psc" portion of the script in the .bsa archives. So, can any of you copy and paste their default source code for "PressurePlate.psc" on here?

Thanks
User avatar
Rachael Williams
 
Posts: 3373
Joined: Tue Aug 01, 2006 6:43 pm

Post » Wed Jun 20, 2012 10:03 am

The file should be saved in the Data\Scripts\Source Directory.
scriptName PressurePlate extends TrapTriggerBase;;;;================================================================weapon property pressEffect autoammo property pressEffectAmmo autoState Active	Event onBeginState()		objectReference selfRef = self		goToState( "DoNothing" )		;pressEffect.fire(selfRef, pressEffectAmmo)		; EFFECT IS HERE ^^^^^ UNCOMMENT ONCE PROJECTILES OR PARTICLES CAN LEAVE A TRIGGER BOX CORRECTLY;		 debug.Trace(self + ": is calling onBeginState Active");		 debug.Trace(self + ": StoredTriggerType = " + StoredTriggerType + ", objectsInTrigger = " + objectsInTrigger)		if (StoredTriggerType == 1)			Type = 3			utility.wait(0.1)			activate(self as objectReference)			utility.wait(0.1)			;Type = 1		else			activate(self as objectReference)		endif		;playAnimationAndWait( "trigger", "reset" )		TriggerSound.play(self)		playAnimation("Down")		if objectsInTrigger == 0			goToState( "Inactive" )			playAnimation("Up")		endif	endEvent		event OnTriggerEnter( objectReference triggerRef )	;		 ;debug.TRACE(self + " has been entered by " + triggerRef)		objectsInTrigger = self.GetTriggerObjectCount()	endEvent		event OnTriggerLeave( objectReference triggerRef );		 ;debug.TRACE(self + " has been exited by " + triggerRef)		objectsInTrigger = self.GetTriggerObjectCount()		if objectsInTrigger == 0			goToState ("Inactive")			playAnimation("Up")		endif	endEventendStateState DoNothing			;Dummy state, don't do anything if animating	event OnTriggerEnter( objectReference triggerRef )	;		 debug.TRACE(self + " has been entered by " + triggerRef)		objectsInTrigger = self.GetTriggerObjectCount()	endEvent		event OnTrigger( objectReference triggerRef )		endEvent		event OnTriggerLeave( objectReference triggerRef );		 debug.TRACE(self + " has been exited by " + triggerRef)		objectsInTrigger = self.GetTriggerObjectCount()		if objectsInTrigger == 0			goToState ("Inactive")			playAnimation("Up")		endif	endEventEndState
User avatar
Ashley Tamen
 
Posts: 3477
Joined: Sun Apr 08, 2007 6:17 am

Post » Wed Jun 20, 2012 4:45 am

THANKS!
User avatar
Kat Stewart
 
Posts: 3355
Joined: Sun Feb 04, 2007 12:30 am

Post » Wed Jun 20, 2012 8:11 am

If you lose or overwrite anything in Data\Scripts\Source (and yeah, I have had to do this) just do a Verify Game Cache in the Steam client (View->Tools, right-click Creation Kit->Properties->Local Files tab) and it will restore them. Make sure to back up your own changed stock scripts there as they will be restored.
I ended up 7-Zipping the whole folder to avoid further issues. :tongue:
User avatar
Motionsharp
 
Posts: 3437
Joined: Sun Aug 06, 2006 1:33 am

Post » Wed Jun 20, 2012 11:36 am

I'm pretty sure that any modifications to vanilla scripts are stored in Data\Scripts separately and do not overwrite the files in Data\Scripts\Source. Simply deleting the version in Data\Scripts will make the Creation Kit load the vanilla script. Might have to restart the CK though.
User avatar
Samantha Wood
 
Posts: 3286
Joined: Sun Oct 15, 2006 5:03 am

Post » Wed Jun 20, 2012 12:36 am

The source files in Data\Scripts\Source are not present until the CK is installed. They are not contained in a BSA. If they are overwritten, they are lost untill restored via cache check.
User avatar
R.I.P
 
Posts: 3370
Joined: Sat Dec 01, 2007 8:11 pm

Post » Wed Jun 20, 2012 8:37 am

The source files in Data\Scripts\Source are not present until the CK is installed. They are not contained in a BSA. If they are overwritten, they are lost untill restored via cache check.
Yep, exactly. This is one pretty annoying aspect of modding Skyrim, because it's easy to duplicate a script and then overwrite the original instead of the copy.
User avatar
Tarka
 
Posts: 3430
Joined: Sun Jun 10, 2007 9:22 pm

Post » Tue Jun 19, 2012 11:33 pm

This is one pretty annoying aspect of modding Skyrim, because it's easy to duplicate a script and then overwrite the original instead of the copy.

If I could change one thing about Skyrim, it would be to revert to the nigh-perfect system the scripts had before where the source code and compiled script is embedded in the ESM/ESP. This new system of the separate files doesn't seem to add any functionality, and introduces a plethora of difficulties in version-tracking all the fiddly files, ie lost source PSC, modders can obfuscate by only distributing compiled PEX (a real unintended boon for joke/malicious mods), compiled and source files getting out of synch, compiled files being generated without the modder's knowledge (ie just by changing a property outside the script editor) and then not included in the mod, and the modder finds it later in the Scripts folder and has to backtrack to find out what it was and whether it's a valid change, loose file compiled PEX scripts persisting in the Scripts folder and still running even when their associated ESP and the rest of the mod has been deleted... it's a mess.
User avatar
Conor Byrne
 
Posts: 3411
Joined: Wed Jul 11, 2007 3:37 pm

Post » Wed Jun 20, 2012 5:08 am

I just found out the hard way that mod scripts overwrite original files so thanks for these answers!

How do you avoid screwing up someone's game when they uninstall your mod which has changed the original scripts?
User avatar
Kayla Bee
 
Posts: 3349
Joined: Fri Aug 24, 2007 5:34 pm

Post » Wed Jun 20, 2012 10:38 am

I don't change the original scripts at all... If I want to try something with them, I create a new script, copy all the code from the original, and edit the base object so that it uses the new script instead of the old.
User avatar
Laura Simmonds
 
Posts: 3435
Joined: Wed Aug 16, 2006 10:27 pm

Post » Wed Jun 20, 2012 4:21 am

I may need some help with that. I'm changing the dialogue when getting arrested. I've been doing that by altering the CrimeDialogueGuards quest dialogue which worked really well until I tried uninstalling my mod. Could I do it by duplicating it and removing the original from SM Event Node or would that have the same effect?

Also, I've redownloaded the entire CK to try and fix the vanilla scrips that I broke but I'm still getting the error message ";WARNING: Unable to load fragment source from function Fragment_5 in script TIF__000267E1 ;Source NOT loaded" in the CK, even though the source scripts seem to be fine as far as I can tell.

Spoiler

;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment;NEXT FRAGMENT INDEX 2Scriptname TIF__000267E1 Extends TopicInfo Hidden;BEGIN FRAGMENT Fragment_1Function Fragment_1(ObjectReference akSpeakerRef)Actor akSpeaker = akSpeakerRef as Actor;BEGIN CODEpTGRSS.TGArrestedCheck();END CODEEndFunction;END FRAGMENT;BEGIN FRAGMENT Fragment_0Function Fragment_0(ObjectReference akSpeakerRef)Actor akSpeaker = akSpeakerRef as Actor;BEGIN CODEakSpeaker.GetCrimeFaction().SendPlayerToJail();END CODEEndFunction;END FRAGMENT;END FRAGMENT CODE - Do not edit anything between this and the begin commentTGRShellScript Property pTGRSS  Auto  
It's for TIF__000267E1.psc. Getting that error for fragment 0, before and after re-downloading all the scripts and CK
User avatar
Lexy Corpsey
 
Posts: 3448
Joined: Tue Jun 27, 2006 12:39 am

Post » Wed Jun 20, 2012 2:02 pm

That's the same script thing I have in my script. The warning is saying that it can't find the code for fragment 5, which is understandable, since there is no fragment_5. Do you get this warning if you load Skyrim.esm by itself?
User avatar
xx_Jess_xx
 
Posts: 3371
Joined: Thu Nov 30, 2006 12:01 pm

Post » Wed Jun 20, 2012 5:21 am

No, I don't get it with just Skyrim.esm.

I think I must have caused this the first time I ever opened the CK by clicking 'Regenerate' in the advanced tab. Nothing happened so I clicked it a bunch more times. I wasn't planning on saving and didn't know it was overwriting files as I went along! Any idea how I get the fragment index back to 0? I've tried deleting the whole script and re-compiling but it remember the fragment it was on before. I'm now up to fragment 33... (I was thinking it's bound to loop back to 0 when it hits 10... maybe 16... perhaps 32...)

Actually... This problem has just cancelled out with my other problem. Skyrim.esm on it's own looks for fragments 0 and 1, my mod now looks for 33 and 34. All I need to do is add these fragments to the vanilla script and I can modify them as much as I want and it wont affect vanilla Skyrim (I think).

Edit: Nope, thought that was too convenient. It would be nice if it worked that way but when you recompile it deletes unused fragments.

Edit2: Actually, this method can be used to have to mods running different parts of the same script without any issues (so far) as long as always and edit and compile from the source code and never touch the start and end script boxes.
User avatar
Breautiful
 
Posts: 3539
Joined: Tue Jan 16, 2007 6:51 am

Post » Wed Jun 20, 2012 8:10 am

I don't change the original scripts at all... If I want to try something with them, I create a new script, copy all the code from the original, and edit the base object so that it uses the new script instead of the old.

This doesn't always work, though, especially for Activators that have their scripts baked the instant they are first loaded (and being persistent, that means the first time you load a game with them present). You can remove the old script from the Activator, but for all intents and purposes, it's still there in the game. I ran into this with one of my own mods (removed script in CK, tested in game, and it was still active), and counteracted by doing a bait-and-switch, which I really shouldn't have had to do in the first place because Papyrus's storage method is so utterly horribly designed. And the only reason I can see for it is complexity for the sake of complexity.
User avatar
adam holden
 
Posts: 3339
Joined: Tue Jun 19, 2007 9:34 pm

Post » Wed Jun 20, 2012 1:07 pm

I guess I'm lucky that when I was testing the changes, I created a new instance of the base object in a custom cell. And doubly lucky that I was only testing it to figure out how the vanilla script works, instead of making a mod for release.
User avatar
no_excuse
 
Posts: 3380
Joined: Sun Jul 16, 2006 3:56 am


Return to V - Skyrim