Hi there, I'm a project lead over at Beyond Skyrim: Cyrodiil. We have been working with version control, but a bug recently came up that led us to believe that there were issues in our merges related to Perforce integration not being functional. That didn't end up being the cause but it led me to research Perforce integration and how it might function if working. Long story short, I figured out how to get it set up and wanted to share the steps with you all.
When set up properly, Perforce works hand-in-hand with the Version Control system to keep backups of previous iterations of scripts, and allow for each individual working on a project to pull the latest versions of all project scripts from the Perforce server. The full functionality of it has not yet been outlined and tested, but with this tutorial, I hope that the community will be able to fully document its features and processes.
With Perforce integration now unlocked, this also opens the path to networked teams working off of a master server using just the Creation Kit and Perforce for version control. With the recent release of Perforce/Git integration, it is possible that we might see a complete change in the way large groups collaborate. We now have access to the complete set of tools that Bethesda did when developing Skyrim and its DLC.
First, set up Version Control per Maefaeger's tutorial.
Download the p4com.dll from this page and add it to your Skyrim folder.
http://public.perforce.com/guest/robert_cowham/perforce/API/p4com/main/
In SkyrimEditor.ini in your Skyrim folder, make sure that, under the [Papyrus] Settings, you have the following set as it is below:
sScriptSourceFolder = "Data\Scripts\Source"
sScriptCompiledFolder = "Data\Scripts\"
sCompilerFolder = "Papyrus Compiler\"
bPerforceEnabled = 1
Perforce Setup
http://gameindustry.about.com/b/2012/07/29/version-control-management-and-games.htm
I worked off of this tutorial by Warren Schultz, with a few changes that are necessary for the Creation Kit to properly read your script backup workspace. I also ignored some of the instructions more geared towards setting up Perforce on a server that would host multiple users. If you are aiming to collaborate over a network, you may want to heed them.
I will outline the steps roughly for now, but for step by step instructions please refer to that tutorial.
From http://www.perforce.com/downloads
Install Perforce Server using the suggested default settings. Make your username the same as your Windows username. You must have administrator permissions.
Set up your Perforce Depot to have the name TESVData. This is important, the depot name and subfolders that we will eventually set up in our workspace are paths that are hardcoded into the Creation Kit.
Next, go back to the Perforce site and install the Perforce Visual Client, also using default settings. You can uncheck the Plug-in for Windows Explorer.
Open up your Perforce Server, ensure it is set up per the tutorial, then open P4V (the visual client). You will need to create a new workspace named Papyrus (not sure if this is hardcoded but it seems like it may be. Feel free to test other workspace names).
The workspace root should be in a new folder anywhere on your computer. I have mine in the folder above my Skyrim directory, since that is where the Source folder needed for LOD generation is kept. Don't add files yet if prompted.
In Windows Explorer, open up the new directory you created and add the following folders:
\current\Source\scripts
Copy all of the contents of your Skyrim/Data/Scripts folder into the Scripts subfolder. This should be thousands of .psc files and the subfolders for each DLC. If you are using a custom prefix for your project, you will need to set it in your Creation Kit preferences as. Do not rename script fragments manually, even through the Creation Kit.
Refresh your Perforce Client and you should see the new subfolders and files. Right click on the scripts folder and click add. It should put your files into a changelist. Then, right click again and click submit to commit those changes to the depot. You will need to add a comment, it can be anything.
Now, the fun part. You should now be able to load up the Creation Kit and go to your preferences. At the very end is a tab for Perforce integration, where you can select your new workspace. Select it and hit apply. You shouldn't get any error messages but if you do one of the steps earlier went wrong.
Properly using Perforce integration is a tutorial of its own, but I haven't had enough experience using the system to write it. I do have a few notes of what I've been able to see below:
Any Creation Kit generated script fragments in the proper format should automatically be loaded by the Creation Kit and have their formids reassigned on merge. Do not alter script fragment names at all if you plan on using Version Control.
For other scripts, you can add them to Perforce by right clicking them in the Papyrus manager. This allows you to check out the scripts from the version control window, alter them, then submit the altered script to your Perforce workspace. If there is a newer version of the script on the Perforce server, you will be prompted to download it.