[Help] Cycrow's Catalogue Packager

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

Post Reply
User avatar
Createse
Posts: 58
Joined: Fri, 20. Mar 09, 23:28
x4

[Help] Cycrow's Catalogue Packager

Post by Createse » Sun, 23. Feb 14, 07:26

I've got this command script that is supposed to build my mod for me but I'm having issues with Cycrow's catalogue packager, it keeps crashing with little to go on. Below is a sample of the expanded parameters it's receiving, and the command script itself. The catalogue I'm trying to populate was created with X3 Editor 2. When the catalogue is empty, I get a generic error and the application crashes, much like some of his other applications do when encountering an empty catalogue. When the catalogue has something in it however in this case a dummy file, I get a message along the lines of: "Unable to add file"

The problem area . . .

Code: Select all

"%Tools%\CatPck" -A "%Assets%\Source\!Asset!.pck" "%Assets%\Build\Addon\05.cat::!Asset!.pck"

Error: Unable to add file: !Asset!.pck
. . . which is the same as . . .

Code: Select all

"C:\Users\User\Projects\X3 - Albion Prelude\Third-party Tools\Plugin Manager\Tools\CatPck" -A "C:\Users\User\Projects\X3 - Albion Prelude\Source\Addon\Types\Jobs.pck" "C:\Users\User\Projects\X3 - Albion Prelude\Build\Addon\05.cat::Addon\Types\Jobs.pck"

Error: Unable to add file: Jobs.pck
The rest is just context . . .

Code: Select all

@Echo Off
SetLocal
SetLocal EnableExtensions
SetLocal EnableDelayedExpansion
Set "Header================================[ Command Script ]==============================="
Set "Footer========================================[]======================================="
Set "Assets=%UserProfile%\Projects\X3 - Albion Prelude"
Set "Tools=%UserProfile%\Projects\X3 - Albion Prelude\Third-party Tools\Plugin Manager\Tools"
Set "X3=%ProgramFiles(x86)%\Steam\SteamApps\Common\X3 Terran Conflict"
<Nul Set /P "=">"ModLog.txt"
ClS
Echo.
Echo %Header%
Echo %Header%>>"ModLog.txt"
If Not Defined "%~1" (
	Set "%~1=-Install"
)
If /I "%~1"=="-Build" (
	Echo  Compiling custom assets:
	Echo.
	Echo  Compiling custom assets:>>"ModLog.txt"
	For /R "%Assets%\Source" %%A In ("*") Do (
		Set "Asset=%%A"
		Set "Asset=!Asset:%Assets%\Source=!"
		Set "Asset=!Asset:%%~xA=!"
		Set "Asset=!Asset:~1!"
		Echo   !Asset!.pck
		Echo   !Asset!.pck>>"ModLog.txt"
		"%Tools%\CatPck" -P "%%A" "%Assets%\Source\!Asset!.pck" >Nul
		If "!Asset!.pck"=="Addon\Scripts\%%~nA.pck" (
			Echo F | XCopy "%Assets%\Source\!Asset!.pck" "%Assets%\Build\!Asset!.pck" /Y >Nul
		) Else (
			"%Tools%\CatPck" -A "%Assets%\Source\!Asset!.pck" "%Assets%\Build\Addon\05.cat::!Asset!.pck"
		)
		Del "%Assets%\Source\!Asset!.pck" /Q
	)
)
If /I "%~1"=="-Install" (
	Echo  Installing custom assets:
	Echo.
	Echo  Installing custom assets:>>"ModLog.txt"
)
If /I "%~1"=="-Uninstall" (
	Echo  Deleting custom assets:
	Echo.
	Echo  Deleting custom assets:>>"ModLog.txt"
	
)
:Exit
Echo.
Echo %Footer%
Echo %Footer%>>"ModLog.txt"
<Nul Set /P "=Press any key to exit . . . "
Pause >Nul
Echo.
EndLocal EnableDelayedExpansion
EndLocal EnableExtensions
EndLocal
. . . and rubbish:

Code: Select all

Problem signature:
  Problem Event Name:	APPCRASH
  Application Name:	catpck.exe
  Application Version:	0.0.0.0
  Application Timestamp:	50103bb1
  Fault Module Name:	spk.dll
  Fault Module Version:	0.0.0.0
  Fault Module Timestamp:	50103b7a
  Exception Code:	c0000005
  Exception Offset:	00017d3a
  OS Version:	6.3.9600.2.0.0.256.4
  Locale ID:	2057
  Additional Information 1:	5861
  Additional Information 2:	5861822e1919d7c014bbb064c64908b2
  Additional Information 3:	80a7
  Additional Information 4:	80a7ccd5015bce3d41120fe057d4f98f
Last edited by Createse on Mon, 3. Mar 14, 13:02, edited 1 time in total.

User avatar
Createse
Posts: 58
Joined: Fri, 20. Mar 09, 23:28
x4

Post by Createse » Wed, 26. Feb 14, 18:30

I gave up on Cycrow's tool and trying to add files to catalogues. I'm doing this instead:

Code: Select all

@Echo Off
ClS
SetLocal
SetLocal EnableExtensions
SetLocal EnableDelayedExpansion
Set "Header================================[ Command Script ]==============================="
Set "Footer========================================[]======================================="
<Nul Set /P "=">"%~n0.log"
Echo.
Echo %Header%
Echo %Header%>>"%~n0.log"
:Start
If "%~1"=="" (
	Set "Argument=-Build"
) Else (
	Set "Argument=%~1"
)
Set "Assets=%UserProfile%\Projects\X3 - Albion Prelude"
Set "Tools=%UserProfile%\Projects\X3 - Albion Prelude\Third-party Tools\Plugin Manager\Tools"
Set "X3=%ProgramFiles(x86)%\Steam\SteamApps\Common\X3 Terran Conflict"
If /I "%Argument%"=="-Build" (
	Set "Argument=-Install"
	Echo  Compiling custom assets:
	Echo.
	Echo  Compiling custom assets:>>"%~n0.log"
	For /R "%Assets%\Source" %%A In ("*") Do (
		Set "Folder=%%A"
		Set "Folder=!Folder:%Assets%\Source=!"
		Set "Folder=!Folder:%%~nxA=!"
		Set "Folder=!Folder:~1,-1!"
		Echo   !Folder!\%%~nxA
		Echo   !Folder!\%%~nxA>>"%~n0.log"
		If "%%~xA"==".xml" (
			"%Tools%\CatPck" -P "%%A" "%Assets%\Source\!Folder!\%%~nA.pck" >Nul
			Echo F | XCopy "%Assets%\Source\!Folder!\%%~nA.pck" "%Assets%\Build\!Folder!\%%~nA.pck" /Y >Nul
			Del "%Assets%\Source\!Folder!\%%~nA.pck"
		) Else If "%%~xA"==".txt" (
			"%Tools%\CatPck" -P "%%A" "%Assets%\Source\!Folder!\%%~nA.pck" >Nul
			Echo F | XCopy "%Assets%\Source\!Folder!\%%~nA.pck" "%Assets%\Build\!Folder!\%%~nA.pck" /Y >Nul
			Del "%Assets%\Source\!Folder!\%%~nA.pck"
		) Else If Not "%%~xA"==".bak" (
			Echo F | XCopy "%Assets%\Source\!Folder!\%%~nxA" "%Assets%\Build\!Folder!\%%~nxA" /Y >Nul
		)
	)
	Echo.
	Echo. >>"%~n0.log"
)
If /I "%Argument%"=="-Install" (
	Echo  Installing custom assets:
	Echo.
	Echo  Installing custom assets:>>"%~n0.log"
	For /R "%Assets%\Build" %%A In ("*") Do (
		Set "Folder=%%A"
		Set "Folder=!Folder:%Assets%\Build=!"
		Set "Folder=!Folder:%%~nxA=!"
		Set "Folder=!Folder:~1,-1!"
		Echo   !Folder!\%%~nxA
		Echo   !Folder!\%%~nxA>>"%~n0.log"
		If Not Exist "%~n0.installed" (
			If Not Exist "%X3%\!Folder!\%%~nxA.bak" (
				If Exist "%X3%\!Folder!\%%~nxA" (
					Rename "%X3%\!Folder!\%%~nxA" "%%~nxA.bak"
				)
			)
		)
		Echo F | XCopy "%Assets%\Build\!Folder!\%%~nxA" "%X3%\!Folder!\%%~nxA" /Y >Nul
	)
	<Nul Set /P "=">"%~n0.installed"
	Echo Do not delete this file. Use '"%~nx0" -Remove' instead.>>"%~n0.installed"
)
If /I "%Argument%"=="-Remove" (
	If Exist "%~n0.installed" (
		Echo  Deleting custom assets:
		Echo.
		Echo  Deleting custom assets:>>"%~n0.log"
		For /R "%Assets%\Build" %%A In ("*") Do (
			Set "Folder=%%A"
			Set "Folder=!Folder:%Assets%\Build=!"
			Set "Folder=!Folder:%%~nxA=!"
			Set "Folder=!Folder:~1,-1!"
			Echo   !Folder!\%%~nxA
			Echo   !Folder!\%%~nxA>>"%~n0.log"
			If Exist "%X3%\!Folder!\%%~nxA" (
				Del "%X3%\!Folder!\%%~nxA"
			)
			If Exist "%X3%\!Folder!\%%~nxA.bak" (
				If Not Exist "%X3%\!Folder!\%%~nxA" (
					Rename "%X3%\!Folder!\%%~nxA.bak" "%%~nxA"
				)
			)
		)
		For /F "Delims=" %%A In ('"Dir "%Assets%\Build" /A:D /B /S | Sort /R"') Do (
			Set "Folder=%%A"
			Set "Folder=!Folder:%Assets%\Build=!"
			Set "Folder=!Folder:~1!"
			RmDir "%X3%\!Folder!" 2>Nul
		)
		Del "%~n0.installed"
	) Else (
		Echo  Modification not installed or '%~n0.installed' file not found.
		Echo  Modification not installed or '%~n0.installed' file not found.>>"%~n0.log"
	)
)
:Finish
Echo.
Echo %Footer%
Echo %Footer%>>"%~n0.log"
<Nul Set /P "=Press any key to exit . . . "
Pause >Nul
EndLocal EnableDelayedExpansion
EndLocal EnableExtensions
EndLocal
ClS

Post Reply

Return to “X³: Terran Conflict / Albion Prelude - Scripts and Modding”