******************************************************************************** CHAMPOLLION and CAPRICA issues.
I am not the author or maintainer of either product, just a very early adopter. If you have product issues, post defect reports on the relevant GITHUB site linked in the main description. ********************************************************************************
Hi there :) Thank you SKK50 for such a fast move regarding Papyrus scripts support in Starfield !
I used to script it a lot by the past years, including with SKSE & F4SE added features, thus that's not the first time I am installing and setting Notepad++ for it... However, now, when I either run the compilation from N++, or from the .cmd file, everything just starts fine, but it then always ends with that error msg :
ios_base::failbit set: iostream stream error ( I tried with various simple renamed copies of vanilla .psc files such as testblockactivationscript.psc for exemple )
Please, anyone has an idea of what I could have been doing wrong here ? P.S. As for the record, I am using a recently installed Win11x64 ( I have been on win7x64 since ten years & still on it until the very last days of last month ) - I don't think it is related to that, but I prefer to mention it, just in case... It still could be related to some authorization process to write in folders or IDK ?
********************************************************** EDIT & ANSWER : Hell, I found why it was faulty on my board and how to fix it... Sorry for your time, comrades ; Sharing with you my experience here :
When run as an administrator out of Notepad++, the CapricaCompile.cmd file, instead of that stream error above, was still buggy in the end, but was first indicating Caprica was working from an internal Windows folder, which was kind of unexpected ! ( I am using last Capricav0.3.0 ) Indeed, here is exactly what I had in the console ( I removed the @echo off at the top of the batch file in order to get some more informations, first ): Adding current working directory to import list: C:\Windows\System32 Adding import directory: G:\Starfield\___TOOLS\Papyrus\Scripts\Source\Base Importing files... An error occurred while trying to iterate the files in 'C:\Windows\System32\WebThreatDefSvc\*'! Import failed! ( I might also add here "Caprica.exe" has been added to my env. vars in windows system infos, otherwise it wasn't found... )
Then, to avoid Caprica to weirdly start in "Windows\System32\WebThreatDefSvc\...", at the very top of my "G:\Starfield\___TOOLS\Papyrus\Scripts\Source\Vivec\CapricaCompile.cmd" file, between @echo off & rem [email protected] September 2023 I just added this : G: cd\ cd Starfield\___TOOLS\Papyrus\scripts\Source\Vivec Well, it's ugly, yes, but, now... IT JUST WORKS !!!
Hi all, trying to get into scripting so apologies for the noob question. I followed all the Caprica instructions and am getting:
'Caprica.exe' is not recognized as an internal or external command, operable program or batch file. Unfortunately, my file structure is nonstandard - I am not in :C\Program Files... I should be using the correct version of Caprica (v3). I tried adding Caprica as an environment variable in Windows, but maybe I am doing it wrong? Could someone help me figure out how to fix this? Thanks!
EDIT: I figured it out, posting here for others
Under System Variables (in Environment Variables), edit PATH and add the full path to the parent directory of Caprica.exe, e.g., SCRIPTPATH
Thank you for this!! I think the instructions for compiling are more geared toward if you are making new scripts from scratch. I am modifying a vanilla game script and had placed the modded script in my "USER" folder like the example and was getting errors because the chain of scripts it extended from weren't there. Assuming I am following the folder structure prescribed in the directions, what is best practice for modding game scripts? Do you copy all the game scripts from your "IMPORT" folder (where it CHAMPOLLION decompiled them all) to your 'USER" folder or do modify game files directly in the "IMPORT" folder? I back up all the .psc's immediately to zips do I can get them back if quickly if I mess them up in the "IMPORT" folder.
As long as the IMPORT folder points at the folder full of decompiled source scripts to link the dependencies, you can put your hacked version wherever you want to best suit how you manage information.
Keeping it in the original source folder does not seem like a grand idea for debug, conflict and regression management, but people organsie information in many and varied ways.
Figured it out. Despite being able to set a scriptpath and Caprica saying "Hey, I am looking for your script there", it won't work unless caprica is right next to the psc file.
EDIT: Never mind, I searched the de-compiled game code for examples and saw how Bethesda has changed the syntax for some classic functions that were giving me grief. :)
Remove the flags argument from CapricaCompile.cmd. The author of Caprica added them directly to the .exe it seems: caprica.exe --game starfield --import "%IMPORT%" --flags "%FLAGS%" --output "%OUTPUT%" "%SCRIPTFILE%"
Also if you copied SKK's script below (Thank you, SKK!) you may get a compilation error because of an unusual character in front of "DatumRef.Delete()". Just a heads-up.
46 comments
CHAMPOLLION and CAPRICA issues.
I am not the author or maintainer of either product, just a very early adopter.
If you have product issues, post defect reports on the relevant GITHUB
site linked in the main description.
********************************************************************************
I used to script it a lot by the past years, including with SKSE & F4SE added features, thus that's not the first time I am installing and setting Notepad++ for it... However, now, when I either run the compilation from N++, or from the .cmd file, everything just starts fine, but it then always ends with that error msg :
ios_base::failbit set: iostream stream error
( I tried with various simple renamed copies of vanilla .psc files such as testblockactivationscript.psc for exemple )Please, anyone has an idea of what I could have been doing wrong here ?
P.S. As for the record, I am using a recently installed Win11x64 ( I have been on win7x64 since ten years & still on it until the very last days of last month ) - I don't think it is related to that, but I prefer to mention it, just in case... It still could be related to some authorization process to write in folders or IDK ?
********************************************************** EDIT & ANSWER :
Hell, I found why it was faulty on my board and how to fix it... Sorry for your time, comrades ; Sharing with you my experience here :
When run as an administrator out of Notepad++, the CapricaCompile.cmd file, instead of that stream error above, was still buggy in the end, but was first indicating Caprica was working from an internal Windows folder, which was kind of unexpected ! ( I am using last Caprica v0.3.0 )
Indeed, here is exactly what I had in the console ( I removed the @echo off at the top of the batch file in order to get some more informations, first ):
Adding current working directory to import list: C:\Windows\System32
( I might also add here "Caprica.exe" has been added to my env. vars in windows system infos, otherwise it wasn't found... )Adding import directory: G:\Starfield\___TOOLS\Papyrus\Scripts\Source\Base
Importing files...
An error occurred while trying to iterate the files in 'C:\Windows\System32\WebThreatDefSvc\*'!
Import failed!
Then, to avoid Caprica to weirdly start in "Windows\System32\WebThreatDefSvc\...", at the very top of my "G:\Starfield\___TOOLS\Papyrus\Scripts\Source\Vivec\CapricaCompile.cmd" file, between @echo off & rem [email protected] September 2023 I just added this :
G:
Well, it's ugly, yes, but, now... IT JUST WORKS !!!cd\
cd Starfield\___TOOLS\Papyrus\scripts\Source\Vivec
'Caprica.exe' is not recognized as an internal or external command, operable program or batch file.
Unfortunately, my file structure is nonstandard - I am not in :C\Program Files...
I should be using the correct version of Caprica (v3).
I tried adding Caprica as an environment variable in Windows, but maybe I am doing it wrong? Could someone help me figure out how to fix this? Thanks!
EDIT: I figured it out, posting here for others
Under System Variables (in Environment Variables), edit PATH and add the full path to the parent directory of Caprica.exe, e.g., SCRIPTPATH
Keeping it in the original source folder does not seem like a grand idea for debug, conflict and regression management, but people organsie information in many and varied ways.
Error:
Compiling MBS_selector.psc
ios_base::failbit set: iostream stream error
scriptName MBS_selector extends ObjectReference
;-- Variables ---------------------------------------
;-- Properties --------------------------------------
;-- Functions --
Function SelectMission()
int iSelection = MBS_MissionBoardSelector.Show()
If iSelection == 0
MissionBoardConsole_Constellation.Activate()
EndIf
EndFunction
;-- State -------------------------------------------
State busy
Event OnActivate(ObjectReference akActionRef)
; Empty function
EndEvent
EndState
;-- State -------------------------------------------
Auto State default
Event OnActivate(ObjectReference akActionRef)
If akActionRef == Game.GetPlayer() as ObjectReference ; #DEBUG_LINE_NO:36
Self.GotoState("busy") ; #DEBUG_LINE_NO:37
If AccessConditions == None || AccessConditions.IsTrue(Game.GetPlayer() as ObjectReference, Self as ObjectReference) ; #DEBUG_LINE_NO:39
SelectMission()
ElseIf AccessFailureMessage
AccessFailureMessage.Show(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) ; #DEBUG_LINE_NO:46
EndIf
Self.GotoState("default") ; #DEBUG_LINE_NO:48
EndIf
EndEvent
EndState
Despite being able to set a scriptpath and Caprica saying "Hey, I am looking for your script there", it won't work unless caprica is right next to the psc file.
Fatal Error: Unable to resolve type 'Quest'!
(I'm trying to make a modified copy of an existing pex after creating the psc.)
Copy/Paste the actual error and the actual code that is causing the error.
set IMPORT=C:\Program Files (x86)\Steam\steamapps\common\Starfield\Data\Scripts\Source\Base
For me it looks like this set IMPORT=E:\SteamLibrary\steamapps\common\Starfield\Data\StarfieldBaseScripts\scripts\Decompiled
?? am i supposed to decop\mpile ALL starfields scripts as pex ? just to edit one?
set /p SEARCHSTRING="Starfield script search string: "
cd "C:\Program Files (x86)\Steam\steamapps\common\Starfield\Data\Scripts\Source\Base"
findstr.exe /i /s /n /c:"%SEARCHSTRING%" *.psc
I get the error SKK_CellChangeScript.psc (1, 42:54): Fatal Error: Unable to resolve type 'ScriptObject'!
UPD. Looks like I needed to decompile all Starfield scripts first and write a path to them as IMPORT
caprica.exe --game starfield --import "%IMPORT%" --flags "%FLAGS%" --output "%OUTPUT%" "%SCRIPTFILE%"
Also if you copied SKK's script below (Thank you, SKK!) you may get a compilation error because of an unusual character in front of "DatumRef.Delete()". Just a heads-up.