Compile opens settings dialog instead of starting compiler

Compile opens settings dialog instead of starting compiler

71
NewbieNewbie
71

    Apr 26, 2020#1

    Code: Select all

    [Settings]
    Skyrim = c:\skyrim
    Compiler Options = -q -f="TESV_Papyrus_Flags.flg"
    
    [SettingsInfo]
    Skyrim = Define Skyrim directory
    Compiler Options = Skyrim Compiler options
    
    [Variables]
    SKYRIMDIR = $(Skyrim)
    COPT = $(Compiler Options)
    COMPILER = "$(SKYRIMDIR)\Papyrus compiler\PapyrusCompiler.exe"
    
    [General]
    TargetExt = .PEX
    ReleaseOut = $(SKYRIMDIR)\Data\Scripts
    DebugOut = $(SKYRIMDIR)\Data\Scripts
    UseFullPaths = 1
    UseDosNames = 0
    Excludes = 
    RemoveDot = 0
    ConvertBS = 0
    
    [FileGroups2]
    PSC = .PSC;
    
    [Compile]
    Out = $T
    Cmd0 = $(COMPILER) $I $(COPT) -i=$(SKYRIMDIR)\data\source\scripts -o=$(SKYRIMDIR)\Data\Scripts
    
    [Build]
    Out = $T
    Cmd0 = $(COMPILER) $I $(COPT) -i=$(SKYRIMDIR)\data\source\scripts -o=$(SKYRIMDIR)\Data\Scripts
    
    [.PSC]
    Out = $In.pex
    Cmd0 = $(COMPILER) $I $(COPT) -i=$(SKYRIMDIR)\data\source\scripts -o=$(SKYRIMDIR)\Data\Scripts
    
    I am trying to integrate TESV Papyrus compiler into UEStudio 19.20.0.44 with the settings above. Yesterday it worked fine, but today whenever I press build or compile or create makefile the compiler settings dialog pops up.
    I have changed nothing - I have re-installed UEStudio but it doesn't help as well.

    6,684586
    Grand MasterGrand Master
    6,684586

      Apr 26, 2020#2

      The reason for getting displayed always the Compiler Options dialog is three missing Settings in the configuration file: Target, Working Directory and Command Line Arguments

      It can be read in help of UEStudio on help page [Settings] Compiler Section that these three keys must exist in group [Settings]. Well, there must exist in real only Target and there must be entered something for this setting in Compiler Options dialog as otherwise it is not possible to create the makefile with file name ProjectName.mak in configured directory for Debug or Release build.

      I read about Papyrus Compiler and I think, the best solution for this specific compiler would be creating
      1. a user or project tool for compilation of active file in debug mode and
      2. one more user or project tool for compilation in release mode and
      3. one more user or project tool to run the file compiled from active file and
      4.  perhaps one or two more user or project tools to compile all *.psc in directory of active file in release or debug mode.
      There is no real need for a compiler configuration as there are not multiple source code files which need to be first compiled one after the other and finally linked together to an executable or dynamic linked library. But I have created nevertheless a configuration file which should work although not tested with really using the compiler and one or more .psc files added to active UEStudio project.

      Code: Select all

      # --------- Papyrus compiler configuration ---------
      # --- general --------------------------------------
      # $P  - project name
      # $Pp - path to project directory
      # $Pn - project name
      # --- compile --------------------------------------
      # $I  - input full name
      # $Ip - input path
      # $In - input name
      # $Ie - input extension
      # $O  - output file
      # $Op - path to output file
      # $On - output filename (without path)
      # $Oe - output extension
      # $R  - release/debug setting for compiler
      # --- build ----------------------------------------
      # $T  - target full name
      # $Tp - target path
      # $Tn - target name
      # $Te - target extension
      # $O  - output file
      # $Op - path to output file
      # $On - output filename (without path)
      # $Oe - output extension
      # $R  - release/debug setting for linker
      
      [Settings]
      Target =
      Category&01 = COMPILER CONFIGURATION
      Skyrim Path = C:\skyrim
      Compiler Options =
      Final = no|yes
      Flags File = TESV_Papyrus_Flags.flg
      Optimize = no|yes
      Quiet = no|yes
      Release = no|yes
      Category&02 = RUN CONFIGURATION
      Working Directory = .
      Command Line Arguments =
      
      [SettingsInfo]
      Target = Name of the project or anything else as not really used.
      Skyrim Path = Define Skyrim directory path containing the folder 'Papyrus compiler' with the executable 'PapyrusCompiler.exe'.
      Compiler Options = Papyrus compiler options on not using below options to configure the compiler options. Select value 'no' for compiler options defined here.
      Final = This parameter tells the compiler to remove all 'BetaOnly' function calls from the script, optimizing it and reducing its size slightly. It is always used on release builds.
      Flags File = This parameter specifies the flag (.flg) file to use for processing flag reference in the scripts. You'll almost always want this to be Institute_Papyrus_Flags.flg.
      Optimize = This parameter tells the compiler to perform basic optimizations on the script. It is always used on release builds.
      Quiet = Forces the compiler to be silent, only printing out any errors encountered. The options affects debug and release builds on having selected 'yes'.
      Release = This parameter tells the compiler to remove all 'DebugOnly' function calls from the script, optimizing it and reducing its size slightly depending on how many you use. It is always used on release builds.
      Working Directory = Provides a space for you to specify the directory in which executing occurs. If you do not specify a directory, executing occurs in the directory where the executable is located.
      Command Line Arguments = Provides a space for you to the file name of the PEX file to execute (required) and additional command-line arguments (optional) to pass to the program at startup.
      
      [SettingsReps]
      Final = no=|yes=-final
      Flags File = @-f="%s"
      Optimize = no=|yes=-optimize
      Quiet = no=|yes=-quiet
      Release = no=|yes=-release
      
      [Variables]
      Compiler = PapyrusCompiler.exe
      ImportDirectory = $(Skyrim Path)\data\source\scripts
      OutputDirectory = $(Skyrim Path)\data\scripts
      OptionsDebug = $(Final) $(Optimize) $(Release) $(Quiet)
      OptionsRelase = -final -release -optimize $(Quiet)
      OptionsGeneral = $(Compiler Options) -i="$(ImportDirectory)" -o="$(OutputDirectory)" $(Flags File)
      
      [Environment]
      PATH = $(Skyrim Path)\Papyrus compiler;%PATH%
      
      [General]
      TargetExt = .pex
      ReleaseOut = Release
      DebugOut = Debug
      UseFullPaths = 1
      UseDosNames = 0
      RemoveDot = 0
      ConvertBS = 0
      
      [MakeCommands]
      run = Execute Script
      makef=Show Makefile
      
      [FileGroups]
      FGS = .psc;
      
      [GroupFormats]
      FGS0 = %s
      FGS = + %s
      
      [Build]
      Out = $Tn
      Depends = $FGS
      ReleaseFlag = $(OptionsRelase)
      DebugFlag = $(OptionsDebug)
      Cmd0 = echo Compiled into folder: $(OutputDirectory)
      Cmd1 = echo($FGS
      
      [.PSC]
      Out = $In$Te
      ReleaseFlag = $(OptionsRelase)
      DebugFlag = $(OptionsDebug)
      Cmd0 = $(Compiler) "$I" $R $(OptionsGeneral)
      
      [Execute Script]
      Title = Execute script
      Cmd0 = $(OutputDirectory)\$(Command Line Arguments)
      Depends = $(OutputDirectory)\$In.pex
      ShowWindow = 1
      DisplayConsole = 1
      
      [Show Makefile]
      Title=Show makefile
      Cmd0=uestudio.exe $(UESMAKEFILE)
      ShowWindow=1
      DisplayConsole=0
      
      It is unusual to have import and output directory coded in the compiler configuration file which I named Papyrus Executable in folder Papyrus Compiler which I created in directory configs  in program files directory of UEStudio. It would be better in my opinion to use Target to specify the output directory and let a user of this configuration file type the import directory in the compiler options dialog. However, I applied your configuration with some tweaks.

      The make command Execute script as defined in section [Execute Script] works only with this unusual configuration if Command line arguments in Compiler Options dialog window starts with the name of one of the *.psc files in UEStudio project with file extension .pex appended and optionally additional arguments. I think, it is better here to define a project tool to run the *.pex file according to active *.psc file instead of using make command Execute script which requires modification of *.pex file name in Compiler Options dialog window before execution on testing a different *.pex file created from one of the *.psc files of current project.
      Best regards from an UC/UE/UES for Windows user from Austria

      71
      NewbieNewbie
      71

        Apr 28, 2020#3

        Thank you!

        I finally get it working for single files (active file) with

        Code: Select all

        [Compile]
        Out = $T
        Cmd0 = $(COMPILER) $I $(COPT) -i=$(SKYRIMDIR)\data\source\scripts -o=$(SKYRIMDIR)\Data\Scripts
        
        [.PSC]
        Out = $In.PEX
        Cmd0 = $(COMPILER) $I $(COPT) -i=$(SKYRIMDIR)\data\source\scripts -o=$(SKYRIMDIR)\Data\Scripts
        BTW: Project tool won't work properly with PapyrusCompiler -  neither UE nor UEStudio is able to capture stdout / stderr into the log window - I have to open a DOS window.