Jump to content

Going to try again to get CK working. Help?


Recommended Posts

Using MO2. I have both LE and SE working. My SE version is the downgraded SE, (1.5.97) not the AE version.

Originally I had AE. CK would not compile. 

I wiped out the AE install and started over, reinstalling fresh and downgrading. It seems to run better than the anniversary edition which gave me issues.

For the record, on the LE install, I am able to use CK.

 

Now I want to get CK working on the SE side.

I am pretty sure I can manage changing where it looks for source files. Changing source\scripts to scripts\source but is that the way it should be done? Does anyone copy all .psc files into source\scripts? Or do I just make sure the few that are in source\scripts get copied to scripts\source and change the creationkit.ini to look there?

 

I'm looking for a really good step-by-step for this and there are some discrepancies in the several I've read. And NOWHERE is there any mention of having to edit the compiler.bat file to point THAT at the right locations. I really don't want to screw this up and have to start over yet again.

 

Thanks

 

Link to comment

Make a backup. Allways make a backup.

 

I don't use MO2. I easpecialy don't like some "virtual folder" for development.

 

The more you have stuff set/installed in "default", the easier it is. If you are "special", you are on your own.

 

I have source (*.psc) in Data\Source\Scripts. Coz its "default" for SE. New mods tipicaly come with papyrus source here. If its in old folder, I copy/paste.

 

No idea what you mean by "compiler.bat". Sounds fake to me. I don't have any file with such a name.

 

It goes like this:

- install CK. CreationKit.exe should be in C:\Program Files (x86)\Steam\steamapps\common\Skyrim Special Edition\

- unpack data\Scripts.zip to get source of vannila scripts

- get/unpack/install SKSE papyrus source. Order is important, because SKSE overrides some vannila scripts.

- you are done.

- maybe you need to add extra *.bsa inside CreationKit.ini file

 

 

Now compiling:

- you can compile and edit scripts from inside CK

- but CKs script editor is junk

- so people usualy use Notepad++ (or something like that)

- inside Notepad++ i compile with plugin NppExec.

- NppExec comand line is:

Spoiler

"C:\Program Files (x86)\Steam\steamapps\common\skyrim special edition\Papyrus Compiler\dm_NPPScriptCompile.bat" -skse "$(FILE_NAME)" "C:\Program Files (x86)\Steam\steamapps\common\skyrim special edition\data\scripts"

 

Content of my dm_NPPScriptCompile.bat is:

Spoiler

@echo off
SETLOCAL ENABLEDELAYEDEXPANSION

REM ***************************************************
REM You may change the variables at the top of this file
REM to match up with your game settings
REM ***************************************************

REM Set the default game mode FO4/SK.
set GAME_MODE=SK

REM *** Custom script import folders. Uncomment and modify the next line
REM     if you need them.
rem set CUSTOM_IMPORTS="C:\Some\Path;C:\Some\Other\Path"

REM *** Set your game path for Skyrim or Fallout 4. Requires double quotes and
REM     trailing backslash ("\").
set SK_GAME_PATH="C:\Program Files (x86)\Steam\steamapps\common\skyrim\"
set SKSE_GAME_PATH="C:\Program Files (x86)\Steam\steamapps\common\skyrim special edition\"
set FO4_GAME_PATH="C:\Program Files (x86)\Steam\steamapps\common\fallout 4\"

REM *** Leave these alone unless you have custom flag files for your game.
REM     If so change the appropriate filename for the game type.
set SK_FLAG_FILE=TESV_Papyrus_Flags.flg
set FO4_FLAG_FILE=Institute_Papyrus_Flags.flg

REM Leave this "no" or get lots of batch script spam in the console.
set SPAM_ME=no

rem ***************************************************
rem ***************************************************
rem ****** don't change anything below this line ******
rem ***************************************************
rem ***************************************************
rem ***************************************************
rem ***************************************************

if .%1 == .-fo4 (set GAME_MODE=FO4 && shift)
if .%1 == .-sk (set GAME_MODE=SK && shift)
if .%1 == .-skse (set GAME_MODE=SKSE && shift)
if %GAME_MODE% == FO4 (
    set GAME_PATH=%FO4_GAME_PATH%
    set FLAG_FILE=%FO4_FLAG_FILE%
    )
if %GAME_MODE% == SK (
    set GAME_PATH=%SK_GAME_PATH%
    set FLAG_FILE=%SK_FLAG_FILE%
    )
if %GAME_MODE% == SKSE (
    set GAME_PATH=%SKSE_GAME_PATH%
    set FLAG_FILE=%SK_FLAG_FILE%
    )

set GAME_SCRIPTS="%GAME_PATH:"=%Data\scripts"
set GAME_SRC="%GAME_SCRIPTS:"=%\source"

rem Special case for SKSE it stores script source in data\source\scripts instead of
rem data\scripts\source.
if %GAME_MODE% == SKSE (
    set GAME_SRC="%GAME_PATH:"=%Data\source\scripts"
    )


rem Sets the path structure for script imports. Add any extra import folders you may need by
rem delimiting with a semi-colon (;). Invalid paths will cause compiler to crash. Default FO4 paths
rem are added automatically later in the script.
set SCRIPT_PATHS="%GAME_SRC:"=%"

if not %spam_me% == no echo on

if %GAME_MODE% == FO4 set SCRIPT_PATHS="%SCRIPT_PATHS:"=%;%GAME_SRC:"=%\base;%GAME_SRC:"=%\user"
if not .%CUSTOM_IMPORTS% == . set SCRIPT_PATHS="%CUSTOM_IMPORTS:"=%;%SCRIPT_PATHS:"=%"

set INPUT_FILE=x
set OUTPUT_FOLDER=x
set PAP_COMPILER="%GAME_PATH:"=%Papyrus Compiler\PapyrusCompiler.exe"

if not exist %PAP_COMPILER% goto pap_error

rem check if our input file exists
:check1
    rem check empty
    if ".%~1" == "." goto usage

    rem check if "as is" exists
    if exist "%~1" set INPUT_FILE="%~1"
    if not %INPUT_FILE% == x goto check2

    rem still no. try output folder.
    if exist "%~2\%~nx1" set INPUT_FILE="%~2\%~nx1"
    if not %INPUT_FILE% == x goto check2

    rem it didn't, try game's sources folder
    if exist "%GAME_SRC:"=%\%~nx1" set INPUT_FILE="%GAME_SRC:"=%\%~nx1"
    if not %INPUT_FILE% == x goto check2

    rem still no. give up and complain.
    goto input_not_found

:check2
    if ".%~2" == "." set OUTPUT_FOLDER="%GAME_SCRIPTS:"=%"
    if not %OUTPUT_FOLDER% == x goto run_it
    if not exist "%~2" goto output_not_exist
    set OUTPUT_FOLDER="%~2"
    if not %OUTPUT_FOLDER% == x goto run_it

:run_it
    ECHO GAME_MODE=%GAME_MODE%
    ECHO GAME_PATH=%GAME_PATH%
    ECHO GAME_SCRIPTS=%GAME_SCRIPTS%
    ECHO GAME_SRC=%GAME_SRC%
    ECHO FLAG_FILE=%FLAG_FILE%
    ECHO PAP_COMPILER=%PAP_COMPILER%
    ECHO SCRIPT_PATHS=%SCRIPT_PATHS%

    ECHO INPUT_FILE=%INPUT_FILE%
    ECHO OUTPUT_FOLDER=%OUTPUT_FOLDER%

    call :input_path %INPUT_FILE%
    ECHO Input_PATH=%INPUT_PATH%

    if %GAME_MODE% == FO4 (
        pushd "%~dp0"
        call :go_base_script_folder
    )
    "%PAP_COMPILER:"=%" %INPUT_FILE% -f="%FLAG_FILE:"=%" -i="%SCRIPT_PATHS:"=%" -o="%OUTPUT_FOLDER:"=%" -op
    if %GAME_MODE% == FO4 popd
    goto :eof

:input_path
set INPUT_PATH=%~dp1
if NOT ."%GAME_SRC:"=%\" == ."%INPUT_PATH%" set SCRIPT_PATHS="%INPUT_PATH%;%SCRIPT_PATHS:"=%"
goto :eof

rem ****
rem Error messages
:usage
    echo.
    echo **** Standard usage:
    echo   %~nx0 {-fo4^|-sk^|-skse} [psc script file] {output folder}
    echo.
    echo Surround paths with double quotes or parsing errors may occur.
    echo.
    echo     {-fo4}   optional - Tells script to use Fallout 4 options.
    echo     {-sk}    optional - Tells script to use Skyrim options.
    echo     {-skse}  optional - Tells script to use Skyrim Special Edition options.
    echo     [psc script file] is required. This should be full path and filename.
    echo         If only a filename is specified, the batch will search the output
    echo         folder, if still not found also the game source folder.
    echo     {output folder} is optional. If not specified then output is
    echo         sent to the game's default scripts folder.
    goto :eof

:pap_error
    echo **** There was an error locating the papyrus compiler.
    echo Check that the settings for the game path are correct in
    echo the batch file. Ensure that you have properly installed
    echo the game's Creation Kit software.
    goto :eof

:input_not_found
    echo **** Unable to locate: "%~1"
    echo Please check that the file exists and that you specified the correct path.
    goto :eof

:output_not_exist
    echo **** Output path does not exist: "%~2"
    echo Please make sure you have created the output folder or spelled it correctly.
    goto :eof

:go_base_script_folder
    rem set temp vars with base path and semi-relative path
    FOR /F "tokens=1,2* delims=^|" %%a in (%INPUT_FILE:\scripts\source=^|%) do (
        set tmp_1_dir="%%a"
        set tmp_2_file="%%b"
    )
    
    rem check if we set a path. if not then just compile with direct filename from wherever we are.
    if .%tmp_1_dir% == .%INPUT_FILE% goto :eof
    
    set tmp_1_dir="%tmp_1_dir:"=%\scripts\source"
    
    rem strip off leading \ and get the first folder in the path for input file
    for /F "tokens=1 delims=\" %%a in (%tmp_2_file%) do set tmp_2_dir=%%a
    
    rem check for user or base pre-fix. otherwise set path.
    if /I .%tmp_2_dir% == .user (
        call :set_new_cwd
    ) else if /I .!tmp_2_dir! == .base (
        call :set_new_cwd
    ) else (
        cd /d %tmp_1_dir%
    )
    goto :eof
    
:set_new_cwd
    cd /d "%tmp_1_dir%\%tmp_2_dir%"
    goto :eof

 

You can also google where to get a nice syntax colorer for Notepad++.

Inside CK, you can use option "Edit in external editor". Yes, CK knows its editor sucks, so it has a command to start something based of file extension.

Notped++ is set to be editor for *.psc.

 

 

Edited by Fotogen
Link to comment

Thanks, @Fotogen.

This helped a lot.

 

I made a copy of my nice clean Data folder. It has the base install plus SKSE. Named it Data-CK. Named the original Data-Real, and renamed Data-CK to Data.

Installed Creation Kit. I let it extract that scipts.zip file, then overwrote with SKSE's files. Then started copying .psc files for stuff I know I'll use a lot into source\scripts if the mod didn't already put them there. 

Now I have a clean Data folder that I can use to play the game in MO2, and I have one set up for running CK with the ability to take that one for CK and duplicate it if needed. Backups of both.

Something in what you said about keeping with the defaults just "clicked". 

Appreciate your help.

 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use