Is there a better way to manage the scripts folder?

Post » Mon Jun 18, 2012 1:10 pm

All the scripts (psc files) in the game incl. our own are in the Data/Scripts/Source folder. The intermediary bytecode files (pex files) used by the game are kept in the Data\Scripts folder. As we learn and experiment, create and unlink (remove) code, we will build up a lot of unused junk. Its a shame CK hasn't got basic file deletion in its file management system. Even if they were kept grouped in folders with the same name as the associated plugin would be a great help.

Is there a better way to manage these files?
User avatar
Peter P Canning
 
Posts: 3531
Joined: Tue May 22, 2007 2:44 am

Post » Tue Jun 19, 2012 1:06 am

I'm adopting a convention of making every single new script I make start with "DIME_".
I have "DIM_" set as the prefix to add to all new scripts in the settings, but most scripts, e.g. Quest Fragment scripts can be renamed.

Then I can easily find all of them. Delete unneeded ones, back them up, etc.

If I ever need a complete clean, I can back them up, delete the whole scripts folder, and "Verify Tool Cache" in Steam to only redownload the original ones.

The devs just used a source management tool. To each his own.


Oh, and the pex files I just delete when I stop working on that particular mod - they can always be recompiled. And they are not intermediary bytecode files, btw, they are the final compiled scripts that are added to your bsa when you archive the mod.
User avatar
Tamara Primo
 
Posts: 3483
Joined: Fri Jul 28, 2006 7:15 am

Post » Mon Jun 18, 2012 10:57 am

I recommend setting up version control for your scripts, including vanilla scripts (so you can see what patches change and the history of any changes you make). I'm using http://tortoisesvn.tigris.org/ for this myself, although I think I've heard that Git would be a better candidate for the sort of work you're likely to be doing.

Cipscis
User avatar
sally coker
 
Posts: 3349
Joined: Wed Jul 26, 2006 7:51 pm

Post » Mon Jun 18, 2012 9:28 am

And they are not intermediary bytecode files, btw, they are the final compiled scripts that are added to your bsa when you archive the mod.
They may be final as far as you're concerned, but you can't run them directly, your processor won't understand any of it. The .pex files contain bytecode: instructions that can be interpreted by the game. Bytecode is always intermediate since it's not machine code (processor language).
User avatar
Oceavision
 
Posts: 3414
Joined: Thu May 03, 2007 10:52 am

Post » Mon Jun 18, 2012 10:40 am

Thanks guys
User avatar
saxon
 
Posts: 3376
Joined: Wed Sep 19, 2007 2:45 am

Post » Mon Jun 18, 2012 3:07 pm

I recommend setting up version control for your scripts, including vanilla scripts (so you can see what patches change and the history of any changes you make). I'm using http://tortoisesvn.tigris.org/ for this myself, although I think I've heard that Git would be a better candidate for the sort of work you're likely to be doing.

Cipscis
I second this. TortoiseSVN is great. I'm also using it to manage versions of my plugins too, it's so much easier than creating backups.
User avatar
Jessica Thomson
 
Posts: 3337
Joined: Fri Jul 21, 2006 5:10 am

Post » Mon Jun 18, 2012 11:53 pm

I discovered that trying to rearrange them in folders messes things up :P So, naming conventions and version control are what we got. Interestingly, When you create new voice recordings, the CK creates a new folder with your mod's name on it. I don't see why they couldn't have set up scripts to do the same.
User avatar
natalie mccormick
 
Posts: 3415
Joined: Fri Aug 18, 2006 8:36 am

Post » Mon Jun 18, 2012 4:50 pm

@Qutayba7, What things have messed up? I've just done that for my own edits and wondering if I'm going to hit a gotcha down the line.

I noticed that one of the main source files that I had not touched had somehow become updated (probably as a result of me being a sticky-beak and seeing how other modders are tackling problems.) I had to revert back to Bethesda files with the 'Verify Cache files' option in Steam. If fixed the source files, but also annoyingly undone my edits of ScriptCompile.bat . Be warned.

I've now moved my own scripts to Scripts/_Tuna, and updated the -i option of my copy of the bat file to search that directory before the main Scripts/Source directory.
I'm installing mods manually at the moment. Is there a chance of the automatic installers unpacking loose psc files over the Beth versions?

EDIT:
Ah okay a problem with the extra folder is that the CK compiler doesn't look in there.
User avatar
Nikki Hype
 
Posts: 3429
Joined: Mon Jan 01, 2007 12:38 pm

Post » Mon Jun 18, 2012 9:24 pm

Well, what I found was that after I moved them to a new folder like you did, my mod couldn't find them anymore (until I moved them back, so no catastrophes, thank the Nine). I had been hoping that it could still find them in a subfolder, but no luck. I suppose you might be able to set it to save them to a new folder, but I haven't discovered how to do that yet. If you've had success, please share. I'm about to start my second mod, which will be substantially larger than my first, and I want to keep it neat and organized from the start. (My house mod has separate alchemy jars for animal parts, dried plants, fungi, oils, etc., if you want a sense of how OCD I can be about this sort of thing :P)

The Workshop shouldn't spread files all over because it makes you package your scripts in a BSA. Nexus downloads could potentially have loose files - the Nexus Mod Manager is fairly good, but not perfect, at keeping track of that. Most Good Nexus mods tht I've seen, though, use either BSA's for scripts or something similarly logical for other resources. But eventually you'll run into a messy one, I guarantee.
User avatar
Roisan Sweeney
 
Posts: 3462
Joined: Sun Aug 13, 2006 8:28 pm

Post » Mon Jun 18, 2012 1:02 pm

I think you should be able to put the source wherever you want, so long as you update the command line parameters you're using for the compiler to match the new input path.

Cipscis
User avatar
Stacey Mason
 
Posts: 3350
Joined: Wed Nov 08, 2006 6:18 am

Post » Mon Jun 18, 2012 3:28 pm

@Cipscis, yeah compiling the source in the external editor seems fine.
I had an error editing a fragment within the CK earlier today. It should have had access to the .pex, but maybe that needs the paths of the source files too. Dunno, as that was just before lunch and I may have misinterpreted what was actually going on lol.

Multiple source paths can be used by separating them with a semi-colon. My TunaScriptCompile.bat file...
"%ProgramFiles%\Steam\SteamApps\Common\Skyrim\Papyrus Compiler\PapyrusCompiler.exe" %1 -f="TESV_Papyrus_Flags.flg" -i="%ProgramFiles%\Steam\SteamApps\Common\Skyrim\Data\Scripts\_Tuna;%ProgramFiles%\Steam\SteamApps\Common\Skyrim\Data\Scripts\Source" -o="%ProgramFiles%\Steam\SteamApps\Common\Skyrim\Data\Scripts"Pause

@Qutayba7, yeah I've done nothing spectacular apart from adding the path above.
I'll have to check again to see if the CK compiler path can be changed (if, in fact, it does need access to the psc's)

Re: OCD. I understand that totally lol. My main FNV mod tackled that area. Hoping to eventually make something similar in SkyRim.
User avatar
Margarita Diaz
 
Posts: 3511
Joined: Sun Aug 12, 2007 2:01 pm

Post » Mon Jun 18, 2012 12:30 pm

Update and bump, in case anyone actually thought the separate folder idea was feasible.

The internal CK Compiler DOES need access to the source (psc) files (not just the pex files), and they must all reside in the same folder.

tl;dr version...
Spoiler


Source of Scripts\_Tuna\YourQuestMainScriptName
ScriptName YourQuestMainScriptName extends QuestFaction Property FactionPropertyName Auto

I compiled that externally and Scripts\YourQuestMainScriptName.pex was created.

Within CK
Added the above script to a Quest.
The name appeared in the dropdown list as normal.

Within an Info Topic Fragment, added the following code
Faction foofoo = (GetOwningQuest() as YourQuestMainScriptName).FactionPropertyNameakSpeaker.SetFactionRank(foo, 0)

This would NOT compile. "Unable to cast to unknown type: YourQuestMainScriptName" (or something like that)
Copying the psc file to Scripts\Source solved the problem.

I was unable to add the additional include path to the SkyrimEditor.INI file using the same ';' delimiter as used on the command line.
I didn't find any other related INI settings in the strings of the executable either.

[Papyrus]
sScriptSourceFolder = "Data\Scripts\Source" <-- (aka -i) Also used to save fragment scripts, so only one path is valid.
sScriptCompiledFolder = "Data\Scripts\" <-- (aka -o)
sCompilerFolder = "Papyrus Compiler\"

User avatar
Kelly Tomlinson
 
Posts: 3503
Joined: Sat Jul 08, 2006 11:57 pm

Post » Mon Jun 18, 2012 1:21 pm

Necro Mode Enabled

I have two questions - I wonder if someone with a bit more recent Beth Modding experience can help?
  • On Day-1 of the CK release (or maybe before release?!) I was obviously a bit too eager to mess about with things. I have noticed that I have made an amendment to one of the Vanilla Script Files. Before I start work on my modQuest proper, I wanted to get the game back into a Vanilla State. So, I moved the Scripts Directory to a safe place and did "Verify Integrity of Game Cache Files". I assumed this would place a Vanilla copy of all scripts back in the DATA/SCRIPTS folder. It does not. So, is there any way of getting back the Vanilla Scripts (other than an uninstall and re-install of the game ... which I'm prepared to do ... reluctantly, if there is no other way)? Ignore me, I is stoopid
  • Would anyone using tortoise be so kind as to give a more full explanation of how they have tortoise configured to manage - in particular - their script folder? I'm not quite sure I understand how it is being used to manage changes ... What do you have setup as the MASTER, where is your working copy and - if you are placing your working script files in a new directory - how are you telling the compiler where to look? (I may just be being a bit thick, here!?)

The scripts do - from all I can tell - run in game (tested by checking on a Khajiit Caravan, which was functioning as expected ... And I don't see how those would function without the scripts?). So I assume the Scripts directory contains uncompiled copies of the scripts, which are actually in the ESM file ... Or something else is happening, which I don't understand.

If I leave the Scripts directory in my safe-location, and open the CK, it will report, for example in MQ101 that "CODE IS NOT LOADED" in place of script fragments.



Many thanks if you can point this sometime-idiot in the right direction(s)
User avatar
Lewis Morel
 
Posts: 3431
Joined: Thu Aug 16, 2007 7:40 pm

Post » Mon Jun 18, 2012 9:15 am

1. Did you verify the Creation Kit? I'd moved out 1 psc file from the and it replaced it for me. That was when I discovered it also overwrote my ScriptComplie.bat file lol.

2. I've never used Tortoise, but what I've done answers some of what you asked.
I persisted with the 'keep my code in a separate folder' idea. For that I had to make a few tweaks to Notepad++ and MyScriptComplie.bat
In short, it warns me if I am editing in the source folder and aborts the compile.
It copies the psc file from whatever dev folder I'm in to the source file before compiling.

Notepad Run shortcut is now using the FULL pathname.
"E:\Steam\steamapps\common\skyrim\Papyrus compiler\MyScriptCompile.bat" $(FULL_CURRENT_PATH)

The contents of MyScriptCompile.bat are now...
Spoiler

@echo offREM %1 Is the full pathname and filenameecho:setlocal enableextensionsrem if errorlevel 1 echo Unable to enable extensionsset ckc_exe=E:\Steam\SteamApps\Common\Skyrim\Papyrus Compiler\PapyrusCompiler.exeset ckc_psc=E:\Steam\SteamApps\Common\Skyrim\Data\Scripts\Sourceset ckc_pex=E:\Steam\SteamApps\Common\Skyrim\Data\Scriptsif /i "%~dp1"=="%ckc_psc%\" (echo EDITING IN SOURCE FILES DIRECTORY - Aborting) else (echo Copying and Compiling %1echo:copy "%1" "%ckc_psc%" 2>&1 >NUL"%ckc_exe%" %~nx1 -f="TESV_Papyrus_Flags.flg" -i="%ckc_psc%" -o="%ckc_pex%")ECHO:Pause

The GAME doesn't need access to the PSC files, but it does need the PEX files.
The default game script PEX files are in one of the BSA files. (Not in the ESM)
But yeah, if you are doing any modding in the CK or external compiler then they need access to the PSC files.

Hope that is clearer.
User avatar
Reven Lord
 
Posts: 3452
Joined: Mon May 21, 2007 9:56 pm

Post » Mon Jun 18, 2012 11:30 am

1. Did you verify the Creation Kit? ...
ssshhh :wink:

2. I've never used Tortoise, but what I've done answers some of what you asked.
I persisted with the 'keep my code in a separate folder' idea. For that I had to make a few tweaks to Notepad++ and MyScriptComplie.bat
In short, it warns me if I am editing in the source folder and aborts the compile.
It copies the psc file from whatever dev folder I'm in to the source file before compiling.

Notepad Run shortcut is now using the FULL pathname.
"E:\Steam\steamapps\common\skyrim\Papyrus compiler\MyScriptCompile.bat" $(FULL_CURRENT_PATH)

The contents of MyScriptCompile.bat are now...
Spoiler

@echo offREM %1 Is the full pathname and filenameecho:setlocal enableextensionsrem if errorlevel 1 echo Unable to enable extensionsset ckc_exe=E:\Steam\SteamApps\Common\Skyrim\Papyrus Compiler\PapyrusCompiler.exeset ckc_psc=E:\Steam\SteamApps\Common\Skyrim\Data\Scripts\Sourceset ckc_pex=E:\Steam\SteamApps\Common\Skyrim\Data\Scriptsif /i "%~dp1"=="%ckc_psc%\" (echo EDITING IN SOURCE FILES DIRECTORY - Aborting) else (echo Copying and Compiling %1echo:copy "%1" "%ckc_psc%" 2>&1 >NUL"%ckc_exe%" %~nx1 -f="TESV_Papyrus_Flags.flg" -i="%ckc_psc%" -o="%ckc_pex%")ECHO:Pause

The GAME doesn't need access to the PSC files, but it does need the PEX files.
The default game script PEX files are in one of the BSA files. (Not in the ESM)
But yeah, if you are doing any modding in the CK or external compiler then they need access to the PSC files.

Hope that is clearer.
Thanks for the info - I'll try and mirror the setup :smile:
User avatar
Steve Fallon
 
Posts: 3503
Joined: Thu Aug 23, 2007 12:29 am


Return to V - Skyrim