LucasForums

LucasForums (http://www.lucasforums.com/index.php)
-   JA Coding (http://www.lucasforums.com/forumdisplay.php?f=539)
-   -   automating pk3 creation (http://www.lucasforums.com/showthread.php?t=177350)

Tinny 04-07-2007 11:15 PM

automating pk3 creation
 
How many of you after compiling delete the .dlls and .pk3s from your mod folder, pack the .pk3 of your new dlls and then run your mod? I figured out a way to just simply compiling and then immediately start debugging with the f5 button. Btw, I only know the rules of how to do this with visual c++ express.


First thing you want to do is download Zip 2.32 from this ftp site.

Reason I chose Zip 2.32 is because its the fastest freeware zip program that allows execution through command lines that I know of.

I extracted the contents to:

D:\zip232\ (for instructions later)

Then inside your mod folder which is inside of GameData I created a .bat file called zipdlls. Using the repository for ojp I store the source in another folder and this is where my builds output the new dlls after each recompile:

D:\Jedi Academy\ojpwahoo\ojpbasic

but my mod folder is here:

D:\Jedi Academy\GameData\ojpwahoo\


Using that information this is what my .bat file looked like:

You can omit the 3rd and 4th line if you don't want your mod folder cleaned of text and log files (change code.pk3 or code anything to whatever the name of your pk3 with the dlls is called).

Quote:

del "D:\Jedi Academy\GameData\ojpwahoo\code.pk3"
del "D:\Jedi Academy\GameData\ojpwahoo\*.dll"
del "D:\Jedi Academy\GameData\ojpwahoo\*.txt"
del "D:\Jedi Academy\GameData\ojpwahoo\*.log"

D:\zip232\zip.exe -qj3 "D:\Jedi Academy\GameData\ojpwahoo\code" "D:\Jedi Academy\ojpwahoo\ojpbasic\*.dll"

ren "D:\Jedi Academy\GameData\ojpwahoo\*.zip" *.pk3
The options qj3 after the zip.exe say:

-q - to quiet all outputs
-j - to not zip in directories but the specified files themselves
-3 - balance of speed and size of zipped output, 1 is the fastest, 9 is the smallest

Now to configure Visual C++ I right clicked on jk2game folder in the Solution Explorer and I went to properties then expanded configuration properties then
expanded custom build event -> General

In there for command line I used:

"D:\Jedi Academy\GameData\ojpwahoo\zipdlls.bat"

for description I said "making pk3s" and for some reason it requires an output and i just typed "nothing" without the quotes.

Ofcourse you have to configure the whole thing based on your directories. Apply and you should be able to just compile then start debugging :).

ensiform 04-08-2007 01:56 AM

I personally have:

cgamex86.dll
cgamex86.pdb
jampgamex86.dll
jampgamex86.pdb
uix86.dll

in G:\ensimod\codemp\Final

I copy it manually to G:\games drive\jedi\GameData\ensimod

Overwrite, Compress the dlls and pack again into pk3 without deleting it first.

Most people do their auto creation with a scons script which uses zlib. >.>

Tinny 04-11-2007 04:38 PM

What's a .pdb file?

Oh yeah guys, I updated the bat file so its cleaner and one can change settings easily by changing the variables set at the top:

Quote:

@ECHO OFF

set modDir=C:\Program Files (x86)\LucasArts\Star Wars Jedi Knight Jedi Academy\GameData\ojpwahoo
set dllOut=C:\Program Files (x86)\LucasArts\Star Wars Jedi Knight Jedi Academy\ojpwahoo\ojpbasic
set zipApp=C:\Program Files (x86)\WiZ\command line\zip.exe

del "%modDir%\code.pk3"
del "%modDir%\*.dll"
del "%modDir%\*.txt"
del "%modDir%\*.log"

"%zipApp%" -qj1 "%modDir%\code" "%dllOut%\*.dll"

ren "%modDir%\*.zip" *.pk3
Also if you followed the instructions I had at the top post, be sure to set jk2game depend on jk2cgame and ui in the dependencies option so it doesn't compile jk2game and then zip, but compiles all three libraries then zips them to your mod folder.

ensiform 04-12-2007 02:59 PM

Program Database Files for VC 2003 and 2005 and up.

They hold the debug symbols, etc for the crash log stuff. ;)

razorace 04-12-2007 03:25 PM

I've seen the backtracer work without those files in there. Weird.

ensiform 04-12-2007 03:28 PM

Not needed on linux or if compiled with vc6. It shouldn't show you any actual functions, etc if there are no symbols in the dll itself.

razorace 04-12-2007 06:39 PM

Oh, ok. I was talking about it on a linux system.

Gamall Ida 04-14-2007 06:56 AM

About the original post : personally, rather than zipping everything, I use +set fs_dirbeforepak 1. That way you just have to copy the dlls and that's it.

My batch:
Code:

copy "C:\Documents and Settings\Gamall\Bureau\jka- base fix\codemp\Debug\jampgamex86.dll" "C:\Program Files\LucasArts\Star Wars Jedi Knight Jedi Academy\GameData\Base\jampgamex86.dll"

del "C:\Program Files\LucasArts\Star Wars Jedi Knight Jedi Academy\GameData\Base\jampserver.cfg"

.\jampDed2  +set dedicated 2 +set net_port 21000  +set fs_game base +set fs_dirbeforepak 1 +set com_hunkmegs 64 +set sv_maxclients 14 +set sv_cheats 1 +exec server.cfg

That and a shortcut +connect localhost:21000 make my life easy.

I think that this is simpler than zipping the jampgame every time. But whatever works is good :smash:

edit: typos

Tinny 04-14-2007 01:03 PM

Woah, I didn't know there was a cvar for reading dlls before having them zipped. Well if that's true most of what I said is useless :P. Thanks man.

razorace 04-14-2007 01:44 PM

Err, well, that's great for debugging, but for actual releases, it needs to be in a .pk3 for normal people to use the mod.

Tinny 04-14-2007 02:06 PM

Yeah, but the main reason I made the script is for making debugging much quicker. Packing a .pk3 once for others wouldn't be a problem.

Gamall Ida 04-14-2007 02:07 PM

Quote:

Originally Posted by Tinny
Woah, I didn't know there was a cvar for reading dlls before having them zipped.

Neither did I until I noticed it in the MakeAMod_readme.txt shipped with the JKA SDK :twogun:

Quote:

Originally Posted by Tinny
Thanks man.

I'm a girl actually, but you're welcome nevertheless :)

Quote:

Originally Posted by razorace
Err, well, that's great for debugging, but for actual releases, it needs to be in a .pk3 for normal people to use the mod.

Yep. Debugging was the core of the thread I think: (edit: oops, Tinny beat me to it)

Quote:

How many of you after compiling delete the .dlls and .pk3s from your mod folder, pack the .pk3 of your new dlls and then run your mod? I figured out a way to just simply compiling and then immediately start debugging with the f5 button.

razorace 04-14-2007 04:30 PM

Quote:

Originally Posted by Tinny
Yeah, but the main reason I made the script is for making debugging much quicker. Packing a .pk3 once for others wouldn't be a problem.

Oh, well, that's why you run everything to the debugger in VS. You only need to make .pk3s when you're packing things for release. :)

razorace 05-08-2007 04:41 PM

Not to be out done, I've come up with an automated .bat that handles pk3 creation AND packages everything up with a Windows installer.

- This is still a beta. :)
- You still have to compile the .dlls yourself.
- Live Link to Latest version of this stuff on the OJP repository.

Needed Tools:
7-Zip
Inno Setup

Batch File:
Code:

ECHO OFF

rem ****************
rem VARIABLE DEFINES
rem ****************

set PK3DLL=ojp_enhanceddlls
set PK3ASSETS=ojp_enhancedstuff
set ASSETSFOLDER=ojpenhanced

rem Installer Script Variables
set INSTALLSCRIPT=ojp_enhanced_installscript.iss
set OUTPUTFILENAME=InstallOJPEnhanced



rem ***************
rem START OF SCRIPT
rem ***************

ECHO =================
ECHO Creating New Pk3s
ECHO =================
ECHO

..\Utilities\zip\7za.exe a -tzip %PK3ASSETS%.pk3 .\%ASSETSFOLDER%\* -xr!.svn\ -x!*.dll -x!*.so -mx9
..\Utilities\zip\7za.exe a -tzip %PK3DLL%.pk3 .\%ASSETSFOLDER%\*.dll -mx9

ECHO ===========================
ECHO Building Windows Setup File
ECHO ===========================
ECHO

..\Utilities\InnoSetup\iscc.exe %INSTALLSCRIPT% /O"." /F"%OUTPUTFILENAME%"

ECHO =====================
ECHO Cleaning Up Temp Pk3s
ECHO =====================
ECHO

del %PK3ASSETS%.pk3
del %PK3DLL%.pk3

ECHO =========
ECHO FINISHED!
ECHO =========
ECHO

Windows Installer Script:
Code:

; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

[Setup]
AppName=OJP Enhanced
AppVerName=OJP Enhanced v0.0.9v
AppPublisher=OJP Team
AppPublisherURL=http://ojp.jediknight.net/
AppSupportURL=http://ojp.jediknight.net/
AppUpdatesURL=http://ojp.jediknight.net/
DefaultDirName=C:\Program Files\Lucasarts\Starwars Jedi Knight Jedi Academy\
DefaultGroupName=OJP Enhanced
AllowNoIcons=yes
OutputBaseFilename=setup
Compression=lzma
SolidCompression=yes
UninstallFilesDir={app}\GameData\ojpenhanced

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked

[Files]
Source: "ojp_enhanceddlls.pk3"; DestDir: "{app}\GameData\ojpenhanced"; Flags: ignoreversion
Source: "ojp_enhancedstuff.pk3"; DestDir: "{app}\GameData\ojpenhanced"; Flags: ignoreversion
Source: "docs\*"; DestDir: "{app}\GameData\ojpenhanced\docs"; Flags: ignoreversion
Source: "..\Basic\docs\*"; DestDir: "{app}\GameData\ojpenhanced\docs"; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{group}\OJP Enhanced"; Filename: "{app}\GameData\jamp.exe"; Parameters: "+set fs_game ojpenhanced"
Name: "{group}\{cm:ProgramOnTheWeb,OJP Enhanced}"; Filename: "http://ojp.jediknight.net/"
Name: "{group}\{cm:UninstallProgram,OJP Enhanced}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\OJP Enhanced"; Filename: "{app}\GameData\jamp.exe"; Tasks: desktopicon; Parameters: "+set fs_game ojpenhanced"

[Run]
Filename: "{app}\GameData\jamp.exe"; Description: "{cm:LaunchProgram,OJP Enhanced}"; Flags: nowait postinstall skipifsilent; Parameters: "+set fs_game ojpenhanced"


Tinny 05-09-2007 11:00 PM

That's sweet, and it also looks like the script gets rid of .svn files. I just made a script for packaging the other assets too but its not nearly as elegant :P.

razorace 05-10-2007 11:54 AM

To be fair, I probably spent a lot more time on it too. :)


All times are GMT -4. The time now is 03:35 PM.

Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
LFNetwork, LLC ©2002-2011 - All rights reserved.