Jump to content

PSA: Finding code in Papyrus scripts


SKKmods

Recommended Posts

I spend a lot of time trying to find code in papryrus scripts.

 

How a papyrus function is used in context in the base game, which script is setting ShaunChild to Ghost, where is COMCuriePlayerKnowsDoctorAmari set, which of my (over 1000) scripts uses "Event OnEnterBleedout" & many, many more.

 

Since google stopped indexing creationkit.com and Windows search does not include embedded strings or string fragments, my solution in a simple dos/windows batchfile. Enjoy !

 

 

 

rem Fallout4ScriptSearch.bat
@echo off
cls
echo. 
set /p SEARCHSTRING="Fallout4 script search string: "
set /p SOURCE="[B]ase game or [U]ser scripts: " 
set /p OUTPUT="Output to [S]creen or [F]ile: "
echo.

:SOURCE
 If /i %SOURCE%==U goto SOURCEUSER

:SOURCEBASE
 rem default to base
 cd "C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\SOURCE\Base"
 goto OUTPUT

:SOURCEUSER
 cd "C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\SOURCE\User"

:OUTPUT 
 If /i %OUTPUT%==F goto OUTPUTFILE

:OUTPUTSCREEN
 rem default to screen
 findstr.exe /i /s /n /c:"%SEARCHSTRING%" *.psc
 echo.
 pause
 goto END

:OUTPUTFILE
 findstr.exe /i /s /n /c:"%SEARCHSTRING%" *.psc > "%TEMP%\%SEARCHSTRING%.txt"
 start notepad.exe "%TEMP%\%SEARCHSTRING%.txt"

:END

 

 

 

 

Fallout4 script search string: COMCuriePlayerKnowsDoctorAmari
ase game or ser scripts: b
Output to creen or [F]ile: s
Fragments\Quests\QF_COMCurieQuest_0016454E.psc:313:GlobalVariable Property PCOMCuriePlayerKnowsDoctorAmari Auto Const
Press any key to continue . . .

 

Of course you need to set the source paths to your system.

The #1 frustration for which there is no automated solution are scripts which use properties with totally different variable names to the actual form/object they are linked to. GRRRR especially in TopicInfo fragments.
Link to comment
Share on other sites

For those who dont know what PSA in the title means = Public Service Announcement

I just googled it because question and the #1 result is, errrr ... Prostate-specific antigen

 

For the avoindace of doubt, my batchfile is for Papyrus issues NOT Prostates :nuke:

Link to comment
Share on other sites

  • Recently Browsing   0 members

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