PDA

View Full Version : xpak Tutorial



PiperWilliam
11-28-2004, 11:49
Hope I don't sound like a complete newb, but I can't figure out how to make Vercingetorix's xpak tool work. Will some kind person write a quick tutorial for me, and others like me, that could be pinned here or something?

Thanks very much guys.
PS. If you do it, could you make it as Idiot Friendly as possible!?

Hans Kloss
12-01-2004, 19:12
There is read me files in xpack.Simply extract files to relevent directory and run it

PiperWilliam
12-02-2004, 18:26
No, the readme doesn't help me. It's not Idiot Friendly enough!

Vercingetorix
12-03-2004, 06:46
1) Download xpak.zip (http://www.twcenter.net/downloads/db/index.php?mod=43)
2) Open xpak.zip with winzip
3) Open explorer
4) Goto the harddrive you installed RTW to (c:\ or d:\)
5) Goto Program Files
6) Goto Activision
7) Goto Rome - Total War
8) Goto data
9) Goto packs
10) Select from the winzip window: xpax.exe and xpak.bat
11) Drag those files to the Rome -Total War\data\packs folder you have open in explorer
12) Double click xpak.bat
13) Wait for it do it's stuff
14) Done.

Doesn't get any idiot friendlier ~:)

PiperWilliam
12-03-2004, 22:48
Ok, thanks, that's got me a hell of a lot further than I did before..... but ( :embarassed: ) where does it put the files once it's finished doing it's stuff?

:embarassed: again.

Vercingetorix
12-04-2004, 01:43
In data\packs. Are you looking for certain files?

PiperWilliam
12-04-2004, 12:27
Yeah, I was hoping to do a bit of texture editing. I can see a bunch of files in Data/packs, but they're all .pak.

Please bear with me here - and thanks for the help!

Hans Kloss
12-04-2004, 17:30
I remember vaugly having to move these decompressed files as they were in different folder

Vercingetorix
12-04-2004, 21:19
Once you have extracted the packs the textures for the units will be data\packs\data\models_unit\textures

PiperWilliam
12-04-2004, 23:11
Brilliant! Thanks very much, really.

Now I need to work out how to get the DDS Plugin to work for Paint Shop Pro!

therother
12-05-2004, 01:23
Go here:

http://developer.nvidia.com/object/nv_texture_tools.html

There are simple instructions there.

PiperWilliam
12-07-2004, 18:37
Thanks all!

heruben
02-28-2005, 20:33
Thx to, but now I have done it, I cant open .tga files, a window pops up and says paint couldnt read it :s

(sry bout my english)

Hans Kloss
03-01-2005, 11:57
MS Paint or even older version of Paint Shop can not handle TGA files.You really need Photoshop if you are thinking of editing RTW textures

Myrddraal
03-01-2005, 13:19
You can use a free program you can download.

Here is Irfanview (http://www.tucows.com/preview/194967.html)

Flavius Belisarius
03-14-2005, 04:03
Where do you download the tool from?

Hans Kloss
03-14-2005, 11:10
http://www.twcenter.net/downloads/db/?mod=43

Malachus
03-16-2005, 06:33
I followed the instructions above as to how to unpack the PAK files, and it worked, except that the newly created directories within the Data/packs folder do not contain the files im looking for. I want to edit some unit cards, but there is nothing there for me to select. Anyone know what i did wrong?

Malachus
03-16-2005, 06:35
Nevermind guys, I figured out what I did wrong.

Meneldil
03-19-2005, 07:05
Another question : how do I repack unpacked files ? How do I use the -pf program argument ?

Monkwarrior
03-28-2005, 15:29
Sorry if this is a silly question, but...how can I unpack the patch_0.pak file?
I successfully unpacked the packs in 1.1, but when I try to unpack the 1.2 packs the name of patch_0.pak file does not appear.

Monkwarrior
03-29-2005, 12:39
Another question : how do I repack unpacked files ? How do I use the -pf program argument ?

Perhaps you finally have the solution. In any case I think that finally I have understood the whole thing (my knowledge about computers is too much limited :embarassed: )

In xpak.bat with mouse right click you have a menu. The second option is edit. Then you have something like this:

xpak.exe -mkdir models_building_textures.pak battle_open.pak game_init.pak sprites_1.pak ui_0.pak ui_1.pak models_unit_textures.pak sprites_0.pak
xpak.exe models_building_textures.pak battle_open.pak game_init.pak sprites_1.pak ui_0.pak ui_1.pak models_unit_textures.pak sprites_0.pak
In red it is the argument you have to change in order to pak the files. But remember you need to create a txt file with the directory structure.
My problem is solved by substitution of all the paks in there by only patch_0.pak, in this way:

xpak.exe -mkdir patch_0.pak
xpak.exe patch_0.pak

Sorry again if everybody knew this. :embarassed:

Ragnor_Lodbrok
04-24-2005, 12:06
Hi,
I didn't know where to post this so I searched a thread about xpak.
I got a problem, when I try to start xpak.bat, I get an error "The access on this device, path or file was denied".:/

Myrddraal
04-24-2005, 21:43
Are u using an account with full priviliges, like not a limited account?

And welcome to the forum :smile:

vale
05-23-2005, 01:06
Hey I was wondering after I unpack the pak. file how am I going to repack them again? Thank for the answer first! ~D :help:

Myrddraal
05-23-2005, 09:53
You don't need to:
https://forums.totalwar.org/vb/showthread.php?t=38736

vale
05-23-2005, 17:19
Well thank you for your time, yes I had read the the in the link you showed me before; however, to save space won't I needs to repack it in order to make the game run much more smoother? ~:confused:

King Ragnar
06-11-2005, 12:17
Is there any other place to get the extractor apart from twcenter? it isnt on the downlods page.

Myrddraal
06-12-2005, 00:00
vale, you don't need to repack the files, it won't run any smoother for it. In fact if you want to distribute you mod it saves space not to repack as you can upload only the files you edited...

Ragnar, try google?

Monkwarrior
06-20-2005, 00:11
vale, you don't need to repack the files, it won't run any smoother for it. In fact if you want to distribute you mod it saves space not to repack as you can upload only the files you edited...

It is true that you don't need to repack the files, but if you modify the files included in the packs, those files won't work for the users of the mod having the paks still packed.
This is the case, for example, of the faction symbols appearing in the ui interface.
However, I've just found something really interesting (sorry if this was already known). We can easily make new patches for the game ~D . I asked some time ago about a method for this purpose. But it was too complicated and required several software programs.
I thought: let's try easier! This is the step-by-step procedure:

1) New folder in the desktop (I named it: test) with a copy of xpak.exe, a copy of samplePak.bat, a new txt file named patch_1.txt and another folder named patch_1.
In this folder I put the data subdirectory with the required structure. In my case the test was only: data\ui\captain banners and data\ui\roman\interface.

2) This is the content of patch_1.txt:

patch_1.pak
patch_1\data\ui\captain banners\captain_card_armenia.tga
patch_1\data\ui\captain banners\captain_card_britons.tga
patch_1\data\ui\captain banners\captain_card_carthage.tga
patch_1\data\ui\captain banners\captain_card_germans.tga
patch_1\data\ui\captain banners\captain_card_pontus.tga
patch_1\data\ui\captain banners\captain_card_spain.tga
patch_1\data\ui\captain banners\captain_card_thrace.tga
patch_1\data\ui\roman\interface\sharedpage_01.tga
patch_1\data\ui\roman\interface\stratpage_02.tga


3) I opened samplePak.bat with notepad (I don't know any other method :embarassed: ) and I changed it to this content:

xpak.exe -v -pf patch_1.txt

4) I run samplePak.bat (simply by clicking on it) and patch_1.pak was created almost inmediately.

5) I copied this file in Data\packs and the symbols are now visible in all the user interface positions.

I hope this will be of help to include more easily modifications in the files contained in the packs.

Monkwarrior
06-20-2005, 11:39
Is there any other place to get the extractor apart from twcenter? it isnt on the downlods page.
Try this link:
http://www.twcenter.net/downloads/db/index.php?mod=43

Monkwarrior
06-21-2005, 08:09
Another example of the use of patch_1.pak.
In the case of a reskinned faction, the unit cards were those of the original faction and the only possibility to show the new unit cards was to rename all the units.
Now those new unit cards can be included in patch_1.pak and this is the result:
http://img168.echo.cx/img168/1593/unitcardscartago5pt.th.jpg (http://img168.echo.cx/my.php?image=unitcardscartago5pt.jpg) ~D

Lord Adherbal
06-24-2005, 12:53
thanks matey, this will save me a lot of time

Nigedo
08-25-2005, 18:00
It is true that you don't need to repack the files, but if you modify the files included in the packs, those files won't work for the users of the mod having the paks still packed.
This is the case, for example, of the faction symbols appearing in the ui interface.
This is really very helpful information Monkwarrior, thank you. I have a couple of points to add, resulting from my own experiments with this approach.

- The game engine will only read data from one supplementary .pak archive. It must be named "patch_1.pak".

So it will not recognise additional archives with names like "mymod.pak", or even "patch_2.pak", sadly. This prevents this from being a very useful way of overlaying consecutive data changes, made by several successive mods, for example.

- The game engine does not seem to recognise replacement text files stored in "patch_1.pak".

Adding replacement text files such as "desc_strat.txt" to the archive caused a CTD in my tests. This is a shame, since it would have allowed all of a mod's data to be presented as a single patch archive.

If anyone discovers different results to these, I would be very interested to know about it. :)

Monkwarrior
08-31-2005, 08:35
Thanks for the info Nigedo.
Yes, unfortunately this method seems to be a little limited.
I thought that it would be possible to do next patch_2.pak, patch_3.pak and so on. Did you tried patch_2 alone or with a patch_1 present?

About txt files, my idea was that only the files already present in the paks were suitable for patch_1.pak. And your finding confirms my idea.

I have other bad news. I tried to make a large patch_1.pak with all the new unit cards and infos I made. However, the game was showing different cards each time I opened the unit selection pannel. This happened in spite of having revised the directory hundreds of times to confirm all the files were listed properly.

In view of that I'm using patch_1.pak only for a reduced number of files, mainly (or only) those that can't be renamed.

Nigedo
08-31-2005, 21:13
I have other bad news. I tried to make a large patch_1.pak with all the new unit cards and infos I made. However, the game was showing different cards each time I opened the unit selection pannel. This happened in spite of having revised the directory hundreds of times to confirm all the files were listed properly.
Ah. That doesn't bode well.

I was hoping to use this method to tightly package all graphical replacements for a mod I'm working on.

We should try to research thoroughly the limitations of patching and publish them in a new comprehensive guide on the subject, I think. Too busy at the moment to look into it further, but I will at some point. :)

Monkwarrior
09-01-2005, 11:25
I was hoping to use this method to tightly package all graphical replacements for a mod I'm working on.Me too. :cry:


We should try to research thoroughly the limitations of patching and publish them in a new comprehensive guide on the subject, I think. Too busy at the moment to look into it further, but I will at some point. I hope you find time to do it. I imagine the correct method would be to increase step by step the size of the patch_1.pak in order to find the limit.
In any case, take this problem report with caution. Perhaps I made a mistake somewhere. :embarassed:

Nigedo
09-01-2005, 17:06
Sorry, I missed this question previously.


Did you tried patch_2 alone or with a patch_1 present?
I tried it both alone and with a "patch_1.pak" installed.

My guess is that the changes CA made to the game engine with patch 1.2 included an update to a hardcoded pointer that directs the engine to compile data from the current and next numbered "patch_x.pak" archive. Adding "patch_1.pak" does not increment this internal pointer, so further numbered (or named) patches are not compiled. :no:

I think you are quite correct in the approach you outlined for testing the limits of patching. I will surely give it a go when my mod is ready for packing.

Dol Guldur
10-21-2005, 00:01
Which elements of the game in 1.3 and BI now need the use of pak files in order to be modded?

Monkwarrior
12-17-2005, 15:44
Bad news, mates.
The 1.5 patch for RTW has a patch_1.pak in packs folder.
So if you want to include new files, you must unpack this, include the new files and repack.

@Dol Guldur

It is necessary for all the files included in the original packs and whose name cannot be changed.
In my case I'm using it for:
model_strat\textures\#banner_symbol_factionname.tga.dds
ui\ROMAN\INTERFACE\different files
ui\CAPTAIN BANNERS\CAPTAIN_CARD_FACTIONNAME.tga
ui\UNITS\FACTIONNAME\#UNITNAME.tga
ui\unit_info\factionname\UNITNAME_INFO.tga
(these two last cases only for those units that keep the original name, but change the cards)

Dol Guldur
12-17-2005, 16:22
Bad news, mates.
The 1.5 patch for RTW has a patch_1.pak in packs folder.
So if you want to include new files, you must unpack this, include the new files and repack.

Yeah, I noticed - so it so with 1.6 too.


@Dol Guldur

It is necessary for all the files included in the original packs and whose name cannot be changed.
In my case I'm using it for:
model_strat\textures\#banner_symbol_factionname.tga.dds
ui\ROMAN\INTERFACE\different files
ui\CAPTAIN BANNERS\CAPTAIN_CARD_FACTIONNAME.tga
ui\UNITS\FACTIONNAME\#UNITNAME.tga
ui\unit_info\factionname\UNITNAME_INFO.tga
(these two last cases only for those units that keep the original name, but change the cards)

Thx. I'm using it for a lot more than that and I seem to remember reading that the file had some limit as to how much it could contain (?)

Teleklos Archelaou
01-31-2006, 05:37
I'm not very good at this packing procedure, but I've been unsuccessful so far at trying this: Has anyone gotten other interface files to work *packed* other than the roman ones? I can get them to work if they are upacked, but I've not heard from anyone that they have gotten them packed and working.

Dol Guldur
01-31-2006, 11:30
Do you mean battlepage, sharedpage etc? If so, I have not tried. The reason why I packed the roman ones was because they would not work unpacked. I then added some other UI elements of other cultures but not the actual contents of the interface folder - they work.

This is all in the 1.3 RTW - for the old Fourth Age demo - I have not tried in later versions yet with the additional element as posted previously in this thread.

Teleklos Archelaou
02-01-2006, 06:16
BTW, Epistolary Richard clued me in to this today (though I was sure I had tried it with no luck): you can have GUI's for any other culture (besides roman) by just creating an interface directory, dropping it in that culture's directory (in the UI folder), and then copying all the Roman ones and pasting them into that new interface folder. Then edit them and they show up immediately - nothing else needs be done. Way too simple! :grin:

Dol Guldur
02-01-2006, 11:03
Erm, yep that's right ;) The only problem has ever been the roman ones which need to be repacked. It's the only one that would never show up for us last year which is how we came to realize that.

I thought you wanted them to work packed, and assumed you knew they worked unpacked (in the manner you (ER) stated). Sorry!

Dol Guldur
02-04-2006, 14:42
The patch_1 pak file can be repacked with the original files + your own - it works. If anyone is aware of any limits do let me know.

I assume the patch_1.pak will take precedence over any packed files in other paks?

Cheexsta
04-05-2006, 08:45
Sorry that I'm replying to a slightly old thread, but something I've found by using Filemon.exe (Google it if you want a download link), a program that monitors what files and directories other programs access when they run. I set it to monitor RomeTW.exe, and the game seems to try and find the files mod_0.pak and a mod_1.pak before it looks in the other pak files. I haven't tried it out yet, but could this be the answer? I mean, if the game first looks in pak files before looking in the normal directory for files it doesn't find, would it do the same for paks? Ie, would it not bother loading the files present in patch_1.pak if they're already present in mod_0.pak?

I haven't tested it out yet (still trying to create the pak!), so I don't know...

Edit: I might also add that Filemon is a great program for tracking down error-less CTD's. While it won't tell you what's wrong with a particular file the game doesn't like (or can't find), it will show you what file it stops loading the game on. Just be warned, it can generate log files that are huge...

Monkwarrior
04-05-2006, 10:10
... I set it to monitor RomeTW.exe, and the game seems to try and find the files mod_0.pak and a mod_1.pak before it looks in the other pak files. I haven't tried it out yet, but could this be the answer?
It should be quite easy to test.
Make a mod_0.pak file with only one unit card. Eliminate that unit card from UI folder and try the game. Or even better, rename a wrong unit card in the UI folder. Depending on which card you see in game, you can see which folder is being used by the game.

If this is true, this would make our life easier.:2thumbsup:

Cheexsta
04-06-2006, 14:04
Haven't yet had a chance to test it out. Give me a few days and I'll try it.

Ahmose
01-19-2007, 19:10
I can confirm that the game looks first in mod_0.pak and mod_1.pak files first. I just packed files for Chivalry Total War mod into mod_0.pak file and put it into the Chivalry\data\packs folder. For the info ChivTW uses its own folder separated from the original RTW data folder.

Regards/Ahmose

Dol Guldur
01-19-2007, 19:55
LOL. Thx. I guess we should have updated this sooner ;)

The game will even read loading bars from the mod pack so there's no need for mods to have them outside the modfolder. Same with most other elements too.

Ahmose
01-20-2007, 11:28
Yes you all right, I think that a lot of the work produced by any mod can be put in that pack file. Then It will be easier for different mods installed at the same time on the same copy of RTW. Even until now, some mods conflict with eatch other. Like you said about the loading bar issue.

Regards/Ahmose

Dol Guldur
01-20-2007, 11:37
Mods are mad not to try and get everything into a modfolder - most people want to play more than 1 mod and they do not want to have to set up new installations of their RTW every time or have them overlapping in the vanilla and possibly causing conflict or at least a mess ;)

The Fourth Age - Forth Eorlingas upcoming release has not a single file outside the modfolder. Of course, some few elements modded by other mods are not possible (as far as we know) inside the modfolder but fortunately we have no such elements.

TotalWarVet
03-03-2011, 22:05
Once you have extracted the packs the textures for the units will be data\packs\data\models_unit\textures

Just moved all my TW installations to new Windows 7 box. Lost almost all my RTW mods to a disk crash. Luckily MTW2 was already on disk. Had to reinstall RTW,BI and apply patch 1.6. Now I can't get xpak to work. It runs, but nothing happens. I even copied the data\packs folder to another area but still no luck. I have full admin privs on my box. I've correctly recreated a few of my custom units based on existing ones, but need access to the existing stock unit cards for recruitment/battle display (the grey peasant won't work for me:)). If anyone is still out there, any help would be appreciated. Thanks.

Ok so I ended up manually running xpak 1 line item at a time in command prompt window. Success.