Jump to content

Compiling papyrus in namespaces


Recommended Posts

Thats interesting and feels more right than a simple pathing issue, but:

 

passing DLC01\%1

returns Improperly formed command line argument: Files

 

passing DLC01:%1

returns filename does not match script name: "dlc01:dlc01_mechanistdoorcontrolscript" expected: "DLC01_MechanistDoorControlScript"

 

passing DLC01::%1

returns Unhandled Exception: System.ArgumentException: The path is not of a legal form.

 

passing the full folder path and -all

returns filename does not match script name: "dlc01:dlc01_mechanistdoorcontrolscript" expected: "DLC01_MechanistDoorControlScript"

Link to comment
Share on other sites

This is my standard string, works all day long woth non-name space scripts;

"C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Papyrus Compiler\PapyrusCompiler.exe" %1 -f="%FLAGS%" -i="%IMPORT0%;%IMPORT1%;%IMPORT2%" -o="%OUTPUT%"
So trying the various namespace permutations:

 

"C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Papyrus Compiler\PapyrusCompiler.exe" "DLC01\%1" -f="%FLAGS%" -i="%IMPORT0%;%IMPORT1%;%IMPORT2%" -o="%OUTPUT%"

Unhandled Exception: System.ArgumentException: Illegal characters in path.
"C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Papyrus Compiler\PapyrusCompiler.exe" "DLC01:%1" -f="%FLAGS%" -i="%IMPORT0%;%IMPORT1%;%IMPORT2%" -o="%OUTPUT%"
filename does not match script name: "dlc01:dlc01_mechanistdoorcontrolscript" expected: "DLC01_MechanistDoorControlScript"
"C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Papyrus Compiler\PapyrusCompiler.exe" "DLC01::%1" -f="%FLAGS%" -i="%IMPORT0%;%IMPORT1%;%IMPORT2%" -o="%OUTPUT%"
Unhandled Exception: System.ArgumentException: The path is not of a legal form.
Changing the current working directory to any path level makes no difference, same results every time.
Remove the
Link to comment
Share on other sites

 

Lets stop with the pathing now and see if someone actually KNOWS how to compile namespace scripts

Partial solution might not work.
ok, lets simplify things a bit:
1. Copy content of
C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\DLC01 to
C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\User\DLC01
2. Create papyrus project file. For example, DLC01.ppj with following content -> an example

 

3. Go to the folder where your Papyrus compiler is placed and execute:
PapyrusCompiler.exe path/to/your/DLC01.ppj
Edited by DlinnyLag
Link to comment
Share on other sites

"C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Papyrus Compiler\PapyrusCompiler.exe" "C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\User\DLC01\dlc01.ppj"


...



Compiling "DLC01\DLC01_MechanistDoorControlScript.psc"...

Compilation succeeded.



Thankyou so much !


From this should we infer that the only way to compile namespaces is to use project files ?
Link to comment
Share on other sites

 

From this should we infer that the only way to compile namespaces is to use project files ?

Definetly, no. I was able to compile namespaced scripts form other mods without .ppj.

But papyrus project file makes things easier to manage.

I guess the main problem - attempt to compile files outside of \Source\User\ folder.

Link to comment
Share on other sites

 

I guess the main problem - attempt to compile files outside of \Source\User\ folder.

 

 

Yes, but no thats not the root cause. I put the DLC file in the \User folder and in \User\DLC1 and still got the file name error using the command line parameters.

 

The ACTUAL ROOT issue seems to be the command line parsing or expansion of the passed in file name "DLC01\%1" because ... if I hard code "DLC01\DLC01_MechanistDoorControlScript.psc" into my original command line batchfile it works perfectly:

 

FAIL "C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Papyrus Compiler\PapyrusCompiler.exe" "DLC01\%1" -f="%FLAGS%" -i="%IMPORT1%;%IMPORT2%" -o="%OUTPUT%"

 

FINE "C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Papyrus Compiler\PapyrusCompiler.exe" "DLC01\DLC01_MechanistDoorControlScript.psc" -f="%FLAGS%" -i="%IMPORT1%;%IMPORT2%" -o="%OUTPUT%"

Link to comment
Share on other sites

Did you try to use

 

"C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Papyrus Compiler\PapyrusCompiler.exe" %1 -f="%FLAGS%" -i="%IMPORT1%;%IMPORT2%" -o="%OUTPUT%"

 

and pass full path to compiling file as batch run argument?

 

like:

 

mycompile.bat "C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\DLC01\DLC01_MechanistDoorControlScript.psc"

Link to comment
Share on other sites

Yes mate, thats EXACTLTY where I STARTED FROM at the top of this thread. The ONLY two new things are either

 

(a) HARD CODE the namespace\filename as a passed parameter, or;

 

(b) Use a project file to HARD CODE the namespace\filename.

Link to comment
Share on other sites

 

FAIL "C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Papyrus Compiler\PapyrusCompiler.exe" "DLC01\%1" -f="%FLAGS%" -i="%IMPORT1%;%IMPORT2%" -o="%OUTPUT%"

FINE "C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Papyrus Compiler\PapyrusCompiler.exe" "DLC01\DLC01_MechanistDoorControlScript.psc" -f="%FLAGS%" -i="%IMPORT1%;%IMPORT2%" -o="%OUTPUT%"

Actually, both samples seems wrong. If path to file is not full, then it should be interpreted as relative path. Relative to current directory

So result will depends on what is the current directory when those commands are executed.

For example, executing those commands from C:\ and from C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\ should transform input argument as

C:\DLC01\%1 and C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\DLC01\%1 respectively

Maybe implementation details of compiler allows to succeed second sample. Or you was lucky running it from right directory.

 

 

UPD:

I've tested it with my example of batch file

There is the result of run:

 

C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Papyrus Compiler>mycompile.bat "c:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\User\DLC01\DLC01_MechanistDoorControlScript.psc"

C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Papyrus Compiler>"C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Papyrus Compiler\PapyrusCompiler.exe" "c:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\User\DLC01\DLC01_MechanistDoorControlScript.psc" -f="C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\Base\Institute_Papyrus_Flags.flg" -i="C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\User;C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\Base"
Papyrus Compiler Version 2.8.0.4 for Fallout 4
Copyright © ZeniMax Media. All rights reserved.
Starting 1 compile threads for 1 files...
Compiling "c:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\User\DLC01\DLC01_MechanistDoorControlScript.psc"...
Compilation succeeded.
But it will be failed if place mycompile.bat to C:\mycompile.bat and run from C:\

 

C:\>mycompile.bat "c:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\User\DLC01\DLC01_MechanistDoorControlScript.psc"

C:\>"C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Papyrus Compiler\PapyrusCompiler.exe" "c:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\User\DLC01\DLC01_MechanistDoorControlScript.psc" -f="C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\Base\Institute_Papyrus_Flags.flg" -i="C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\User;C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\Base"
Papyrus Compiler Version 2.8.0.4 for Fallout 4
Copyright © ZeniMax Media. All rights reserved.
Starting 1 compile threads for 1 files...
Cannot use import folder "C:\" - Could not find a part of the path 'C:\Windows\LastGood\system32'.
Compiling "c:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\User\DLC01\DLC01_MechanistDoorControlScript.psc"...
No output generated for c:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\User\DLC01\DLC01_MechanistDoorControlScript.psc, compilation failed.
Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on c:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\User\DLC01\DLC01_MechanistDoorControlScript.psc

 

So it seems that compiler behavior depends on current directory. Something specific in implementation, and it might cause unexpected result
Edited by DlinnyLag
Link to comment
Share on other sites

  • Recently Browsing   0 members

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