PDA

View Full Version : texture/dds converter



alpaca
12-21-2006, 16:11
Well, I "finished" the first version for my texture/dds converter.
Please post any bugs or suggestions here ;)

See the read-me for instructions.

I want to thank Casuir for testing a preliminary version of this tool :)

[12-21-06]
Version 0.1 (http://www.twcenter.net/forums/downloads.php?do=file&id=1347)

Epistolary Richard
12-21-2006, 20:07
:thumbsup:

Four hours, near on the dot!

Works for me

Read inside the spoiler for how it works



Extract .rar file into a folder

https://img48.imageshack.us/img48/3272/texconv1aq9.gif (https://imageshack.us)

https://img382.imageshack.us/img382/1176/texconv2qj8.gif (https://imageshack.us)

https://img382.imageshack.us/img382/9880/texconv3ab1.jpg (https://imageshack.us)

https://img48.imageshack.us/img48/4998/texconv4rt2.jpg (https://imageshack.us)

https://img296.imageshack.us/img296/779/texconv5am7.gif (https://imageshack.us)

https://img48.imageshack.us/img48/9655/texconv6wg3.gif (https://imageshack.us)

https://img382.imageshack.us/img382/5404/texconv7px4.jpg (https://imageshack.us)
Remember to run the game with the:

[io]
file_first = true

lines in your .cfg file, so the game looks at outside files before the packs.

methoz
12-22-2006, 01:20
edit: sry..now i have python....
my bad ;)

alpaca
12-22-2006, 15:46
You have to install python. Read the readme

Rik_Vargard
12-22-2006, 17:13
Wow great job!

Now, I tried to test it and changed the following texture into DDS:

late_northern_captain_england.texture

I put it all black just for fun and then put it back as .texture file.
Now, that's where the changes won't apply :wall:

If I re-convert the changed-and-converted .texture file into .DDS again, it's back to normal again... ! Like I didn't change a thing...!
:sweatdrop:

Any ideas?
And keep up the great work! :beam:

Rik_Vargard
12-22-2006, 17:25
Arr err sorry don't find the "edit" button :oops: :help:

Anyway, I managed to convert the .TGA files into .DDS putting DXT5 in DDS Converter. So when I convert it back, the changes seem to have applied.
So that cool, now the only thing is that changes don't show up in game !!

I need a >:idea2:

:2thumbsup:

alpaca
12-22-2006, 19:16
Yes, the tool only supports DXT1 and DXT5 as virtually all files in the game are one of these two formats.
If somebody asks for another format I might add support for it, but for now it seems to be good enough.

And for the changes to show up you need to use --io.files_first or something, not sure about the syntax.

Epistolary Richard
12-22-2006, 20:52
As I say:

[io]
file_first = true

in the .cfg file.

alpaca
12-22-2006, 21:44
A new entry has been added to Links and Downloads Manager

Description: This tool allows it to convert .texture files that were unpacked with CA's unpacker into the .dds format.
It also works the other way around, but only if the .dds files are in DXT1 or DXT5 format (virtually all files in the MTW2 release use one of these)

To check it out, visit Tool: .texture/.dds converter (https://forums.totalwar.org/vb/local_links.php?linkid=312)

will119
12-23-2006, 01:49
I keep on getting a CTD everytime i try and change the files so i dunno what the hell is up.

Rik_Vargard
12-23-2006, 13:12
As I say:

[io]
file_first = true

in the .cfg file.

Oops my legendary distraction made me miss this, thanks ! :embarassed:

So in what .cfg file do you write these lines?

In medieval2.preference.cfg ? ...

When I do this, the changes still don't apply in the game and after exiting the game and checking back that file, those lines just got "erased by the game" or something...somehow, because it's no more in there, like I never wrote it! Started the operation again like three times and still the same result.... :dizzy2:

or did I miss something again :sweatdrop: ...?

Musashi
12-23-2006, 13:18
set file read-only.

Rik_Vargard
12-23-2006, 13:51
set file read-only.

Thank you, that did the trick so far... :2thumbsup:
So far, because... changes still don't apply in the game... :no:
Like you can see here:

I have the [io] file_first = true added and the .texture file is changed...

http://www.rikvargard.com/tw/captain.jpg

What am I doing wrong...?

will119
12-23-2006, 14:26
What am i missing here i followed all the steps?

1. i put the texture file in my new created folder i made too convert.
2. i converted it too DDS(worked)
3. then i reconverted it back to TEXTURE. and i renamed it, then put it back in it's original location.
4. then i put the [io]
file_first = true

in the .cfg file. and saved it
5. then i run the game, i pick the unit i re skinned and when it is loading it CTD on me every time.

So can anyone help me out here?

Casuir
12-23-2006, 14:41
Have you deleted the two geography files?

Sir Robin the Brave
12-23-2006, 15:44
Well it worked for me! :2thumbsup:



The only thing I seem to have done different, is that I run a batch file (.bat) to load the game. Like it said in the unpacker readme.

Rik_Vargard
12-23-2006, 16:23
Mmm you know what? I removed the original loading screens and put a new one name as loading_screen_1 (so there's only one loading screen in game) the game still loads the original ones!

So there's a twist with the

[io]
file_first=true

or what...?

Sir Robin the Brave
12-23-2006, 16:27
https://img242.imageshack.us/img242/4421/aztbrightiy7.png

The brightly coloured aztecs!

Rik I would try to run it with the .bat file, and see if it works :)

Rik_Vargard
12-23-2006, 16:43
Call me stupid, but what .bat file? The only one I see is from the "lands to conquer" mod, not from M2TW... :(

Do I need to make one, and how do I do that?
Could you please explain? :yes:

Sir Robin the Brave
12-23-2006, 16:47
1. open notepad
2. type in "medieval2.exe --io.file_first"
3. save in your "SEGA\Medieval II Total War" directory
as skinstart.bat
4. double click and M2TW should start and use your skins :2thumbsup:

Rik_Vargard
12-23-2006, 17:12
Thanks a lot:) , I created the .bat file and the game loads, but the textures still ain't showing up.... :shame: :skull:

I retextured the "late_northern_captain_england.texture" as you see on the pic above, but it's still the original one that's showing up....

arr...:inquisitive: ?

Sir Robin the Brave
12-23-2006, 17:15
you may have retextured the battle map one instead of the strat map one

Rik_Vargard
12-23-2006, 17:33
heheh lol damn I love you, Sir Robin! :laugh4: :embarassed:
Heh... now to find where the strat map ones are!

But thanks a lot for your time and patience, man! Really appreciated! :2thumbsup: :2thumbsup:

will119
12-23-2006, 20:32
Have you deleted the two geography files?

Where are they located?

Casuir
12-23-2006, 20:43
read the unpacker readme

will119
12-23-2006, 21:11
read the unpacker readme

list me the two files and i can find them myself i do not need no read me.

Sir Robin the Brave
12-23-2006, 21:38
they are in the data section, they are:

datadescr_geography_new.txt
datadescr_geography_new.db

ok? :)

will119
12-23-2006, 21:54
they are in the data section, they are:

datadescr_geography_new.txt
datadescr_geography_new.db

ok? :)]

okay dude thanks

and if i screw up again i will be back:P

alpaca
12-23-2006, 22:05
will119 I hope when you get back you'll have acquired better manners.

will119
12-23-2006, 22:07
I hope when you get back you'll have acquired better manners.

I'll try but no promises

but anyways i got it people:P a lot easier than before.

https://i62.photobucket.com/albums/h90/berserker55/works.jpg

alpaca
12-23-2006, 23:20
or what? If i do not have better manners
Then you will receive a warning by the forum administration ;)

Casuir
12-24-2006, 00:24
list me the two files and i can find them myself i do not need no read me.

I didnt have access to the files or have time to search for them so I told you where to get them, theres no need to be incompatible about it. If you'd have read the thing instead of getting up on your high horse you'd have had your answer an hour earlier and saved someone the bother of typing them out for you.

Lovasìjász
12-24-2006, 09:08
A new entry has been added to Links and Downloads Manager

Description: This tool allows it to convert .texture files that were unpacked with CA's unpacker into the .dds format.
It also works the other way around, but only if the .dds files are in DXT1 or DXT5 format (virtually all files in the MTW2 release use one of these)

To check it out, visit Tool: .texture/.dds converter

Alpaca, your texture converter will convert .texture format files to .dds if i use this in the /data/globallighting - folder (sky textures) , but it won't convert them back to .texture, at least most of them won't convert.

What can be wrong?

(lol, heresy is too high?)

alpaca
12-24-2006, 12:45
Alpaca, your texture converter will convert .texture format files to .dds if i use this in the /data/globallighting - folder (sky textures) , but it won't convert them back to .texture, at least most of them won't convert.

What can be wrong?

(lol, heresy is too high?)
Well yeah, those are pretty much the files it can't convert. They are 32bit, and I was too lazy to check out what i need to read in about them...
Will maybe work on a new version later.

kaya
12-24-2006, 14:06
finally got it, guys thanks to you all and Casuir,Alpaca and last but not least E.R you guys are great, gentlemen i saloot you

kaya
12-24-2006, 14:12
i cant post the image thats strange

AliAS
12-24-2006, 14:17
Great it worked.
only test :laugh4:
https://img412.imageshack.us/img412/7373/1kn6.th.jpg (https://img412.imageshack.us/my.php?image=1kn6.jpg)

Rik_Vargard
12-24-2006, 15:02
Great it worked.
only test :laugh4:
https://img412.imageshack.us/img412/7373/1kn6.th.jpg (https://img412.imageshack.us/my.php?image=1kn6.jpg)

LOL nice job! :yes:

Casuir
12-24-2006, 15:09
Alpaca, your texture converter will convert .texture format files to .dds if i use this in the /data/globallighting - folder (sky textures) , but it won't convert them back to .texture, at least most of them won't convert.

You can convert them by hand though, in fact you're better off doing this for that whole folder as one of the textures in there causes a problem with environmental lighting when re-converted. Some of the textures in there arent dxt and some of he ones hat are are cube maps so be careful when you're saving them.

vlad 1
12-25-2006, 19:09
https://img300.imageshack.us/img300/4359/1211mf6.jpg
my first reskin in medieval 2 ))))))))
test model
yes it's working:smash:
https://img251.imageshack.us/img251/4087/111132pz3.jpg

ShadowStriker
12-25-2006, 19:48
would we be able to convert textures from RTW now?

alpaca
12-25-2006, 20:09
would we be able to convert textures from RTW now?
Probably not, because the actual skinning process is different than in RTW. You could use them as a base though.

Savage_German
12-26-2006, 16:49
The link isn't working, I can't download Python 2.5

alpaca
12-26-2006, 18:01
Yes indeed, it's http://www.python.org/download instead of /downloads

sto123
12-28-2006, 23:41
i cant use it.. when i start it with the .bat file the python file opens itself and nothing happens... HELP

(i m a noob)

alpaca
12-29-2006, 00:44
Where did you put the script?

sto123
12-29-2006, 13:40
i put the script and the bat file in the medieval directory; double click; an the script opens itself. and nothing happans

Rik_Vargard
12-29-2006, 14:52
i put the script and the bat file in the medieval directory; double click; an the script opens itself. and nothing happans

Try putting the .bat and .py files into a folder with *.texture files in it :2thumbsup:

sto123
12-29-2006, 15:53
Try putting the .bat and .py files into a folder with *.texture files in it :2thumbsup:

into the medieval direktory i put ALSO some texture files

im not stupid ^^

Rik_Vargard
12-29-2006, 16:33
into the medieval direktory i put ALSO some texture files

im not stupid ^^

I'm not saying that, but since I am very distracted myself :sweatdrop: ... oh well :laugh4:

Mmm well then I dunno... it should work if everything is in the same folder and you hit convert all textures.bat ... :no:

alpaca
12-29-2006, 20:07
Well the window shouldn't close itself no matter what.
Try opening a command prompt, going to your mtw2 directory and entering the name of the batch file and see if that gives you any error message or something.

Edit: I hope you're using convert_all_textures.bat ;)

scsscsfanfan
12-29-2006, 23:40
sorry, wrong place
how do I delet my reply?

mgallear
12-30-2006, 12:13
I would love to have ago with this program and have an idea for a simple but useful mod. However I have only managed to download the first few KB and I also failed to get the Rome Battle Editor manual from this site.

I have tried downloading with Explorer and Freedownload manager, my security settings with Explorer may be messing things up but this does not explain why the download manager only gets a few Kb before it thinks it is complete.

Can anybody expert in these things explain what is going wrong?:skull:

Sahran
12-31-2006, 02:56
I managed to convert a texture file into DDS, but I cannot seem to manage to convert it back into a texture. No specific error comes up, it just says:

https://img138.imageshack.us/img138/3818/ddserrorta5.th.jpg (https://img138.imageshack.us/my.php?image=ddserrorta5.jpg)

Nevermind, I fixed it. I was saving in DXT3 instead of 1 or 5.

L_Hybride
12-31-2006, 11:26
Hi all, and thanks for all yours Python scripts alpaca, great job.

My question is about the "mymod folder" users, what should I do in that case ? I still have to put the Io file first or I just have to convert the .texture, edit and put it back in .texture in my unit_sprit folder whiteout adding Io first in my "mymod.cfg" ?

I hope, for my first post, that I was understandable, I m belgian (from the french side) and it's hard for me to write in english (but not to read it :clown: ).

alpaca
12-31-2006, 14:07
Hi all, and thanks for all yours Python scripts alpaca, great job.

My question is about the "mymod folder" users, what should I do in that case ? I still have to put the Io file first or I just have to convert the .texture, edit and put it back in .texture in my unit_sprit folder whiteout adding Io first in my "mymod.cfg" ?

I hope, for my first post, that I was understandable, I m belgian (from the french side) and it's hard for me to write in english (but not to read it :clown: ).
Unfortunately, you can't use the .modelsdb file in a mod folder.

ShadowStriker
01-02-2007, 23:24
Do i just put the whole folder into M2TW/data?

alpaca
01-03-2007, 19:04
That depends. I would unpack the converter into some directory, copy all files you want to convert into that and then run one of the appropriate .bat files. That way you can control more easily what is converted, which has some advantages.
You can theoretically convert all files in all subfolders, but that might have undesirable effects.

Knochen
01-09-2007, 05:31
hope this isnt too late for this thread....okay, so i'm following through Epistolary Richard's wonderful 'spoiler' and im done the second step, but adobe photoshop wont open the dds files, whats wrong, any help would rock, thanks.

alpaca
01-09-2007, 16:58
You need NVidia's dds plugin for Photoshop (you can find it somewhere on their homepage, just do a search for dds there).

Knochen
01-10-2007, 03:10
You need NVidia's dds plugin for Photoshop (you can find it somewhere on their homepage, just do a search for dds there).
hey, thanks, didn't know that, new to the modding scene :D

mmarekk11
01-10-2007, 23:19
I ve got this problem.I did everything like on the pictures is.However when i want to open my .dds file in photoshop it shows this error :
https://img481.imageshack.us/img481/289/photofg0.th.jpg (https://img481.imageshack.us/my.php?image=photofg0.jpg)

It is in Czech language so i translate: Can not open ......... because it is not right type of document.

Do i have a bad photoshop or what? :wall:
:help:

mmarekk11
01-10-2007, 23:26
:oops: :embarassed: sry i didnt see post before me. So i need Nvidias dds plugin for Photoshop. OK

mmarekk11
01-12-2007, 17:58
Ok it works for me :2thumbsup: .But i have got one question.Where can i find textures of for example england peasants,town militia or dismouted feudal knights?I didnt find it anywhere.I am blind maybe.


And when do i cease to be junior member?

DukeofSerbia
01-12-2007, 21:17
It works! :balloon2: :balloon2: :balloon2: My new beautiful work...

https://img469.imageshack.us/img469/8131/bizantjf7.jpg (https://imageshack.us)

mmarekk11
01-13-2007, 15:38
Ok it works for me .But i have got one question.Where can i find textures of for example england peasants,town militia or dismouted feudal knights?I didnt find it anywhere.I am blind maybe.


And when do i cease to be junior member?

thelonewolf40
01-14-2007, 16:52
Well, I "finished" the first version for my texture/dds converter.
Please post any bugs or suggestions here ;)

See the read-me for instructions.

I want to thank Casuir for testing a preliminary version of this tool :)

[12-21-06]
Version 0.1 (http://perso.wanadoo.fr/solo.mt/texture_converter_0_1.rar)

Hi Everybody! Thanks to all of you for all your work to make modding so exciting. All the directions are very clear and easy to follow. I have done all that is described here and it works just fine. My problem is using Photoshop. I can not make anything happen there, can not figure out what controls to use to change color values etc... I find that in the game, in battle mode, it is very difficult to tell my units from others, and would like to make my units more identifiable. I have searched all the forum for a little Photoshop tutorial on this topic but have not found on. Can anyone PLEASE write a simple little tutorial, even just telling what controls to use. This seems to be one of my biggest obstacles.
Thanks in advance.:wall: :help: :dizzy2:

alpaca
01-14-2007, 17:58
Hi Everybody! Thanks to all of you for all your work to make modding so exciting. All the directions are very clear and easy to follow. I have done all that is described here and it works just fine. My problem is using Photoshop. I can not make anything happen there, can not figure out what controls to use to change color values etc... I find that in the game, in battle mode, it is very difficult to tell my units from others, and would like to make my units more identifiable. I have searched all the forum for a little Photoshop tutorial on this topic but have not found on. Can anyone PLEASE write a simple little tutorial, even just telling what controls to use. This seems to be one of my biggest obstacles.
Thanks in advance.:wall: :help: :dizzy2:
Sorry, but I think that would go right outside the scope of modding. You'll have to learn that somehow different (there are probably quite a few good books about Photoshop out there) I guess.

thelonewolf40
01-14-2007, 18:32
Thanks just the same!:embarassed:

thelonewolf40
01-15-2007, 22:30
Hello People!

:2thumbsup: :laugh4: ]~:cheers: ~:smoking: :jumping:

I would like to celebrate, because I have figured out Photoshop (somewhat??) and would Like to share what I have done thus far, (Thanks to alpaca for the texture/dds converter) and everybody else's efforts.

Where there's a will there's a way!

Someone please give an opinion, good or bad, so that I may know how I'm doing.

https://img393.imageshack.us/img393/9153/generalbj6.th.jpg (https://img393.imageshack.us/my.php?image=generalbj6.jpg)

Rafaelinho
01-18-2007, 21:49
Red and Green is portuguese republican colors.
Royal portuguese colors are blue and white.

Icue
01-18-2007, 22:01
Red and Green is portuguese republican colors.
Royal portuguese colors are blue and white.

That is not true. The flag in 1385 is the next:

Rafaelinho
01-18-2007, 22:10
Yes, but this is a flag.
But the royal national colors was always the Blue and White until the Republican Revolution.

Icue
01-18-2007, 22:15
http://www.enchantedlearning.com/europe/portugal/Flagbig1385.GIF

Rafaelinho
01-18-2007, 22:33
Yes that's what I told you, this flag have red and gold, but the royal colors stay white and blue.

http://www.tuvalkin.web.pt/terravista/Guincho/1421/bandeira/pt_1830g.gif

alpaca
01-18-2007, 23:01
Can you guys please resolve that via PM instead of hijacking my thread?
Thanks.

Icue
01-19-2007, 00:46
Can you guys please resolve that via PM instead of hijacking my thread?
Thanks.

Sorry :(

-----------------------

i need help. Can somebody help me? the changes won't apply :help:

https://img122.imageshack.us/img122/773/0mc5.jpg (https://imageshack.us)

https://img122.imageshack.us/img122/3761/1ni3.jpg (https://imageshack.us)

https://img262.imageshack.us/img262/5536/2yt3.jpg (https://imageshack.us)

i launch the game with the batch file but the changes won't apply :/

alpaca
01-19-2007, 14:33
Those screenshots are no help. Please describe exactly what you did.

Icue
01-19-2007, 15:43
i have deleted these files:

-- data\descr_geography_new.txt
-- data\descr_geography_new.db

In the cfg file i have this line:

[io]
file_first = true

+ i put the texture file that i want reskining in my new created folder i made too convert.
+ i converted it to DDS
+ i open it with photosho+ when i have finished, i reconverted it back to TEXTURE. and i renamed it, then put it back in it's original location. (delete the original?)

+ i run the game with the batch file with this line :

medieval2.exe --io.file_first

thelonewolf40
01-19-2007, 18:35
i have deleted these files:

-- data\descr_geography_new.txt
-- data\descr_geography_new.db

In the cfg file i have this line:

[io]
file_first = true

+ i put the texture file that i want reskining in my new created folder i made too convert.
+ i converted it to DDS
+ i open it with photosho+ when i have finished, i reconverted it back to TEXTURE. and i renamed it, then put it back in it's original location. (delete the original?)

+ i run the game with the batch file with this line :

medieval2.exe --io.file_first

HI Icue, looking at your screenshots it looks like your working with a models_strat unit, did you put it back in the models_strat folder or the
unit_ models folder?

Icue
01-19-2007, 19:07
in the units_model folder...

i dont saw the models_strat folder... Is there? :/

Icue
01-19-2007, 19:17
Ohh Thank You !!! ;)

Icue
01-19-2007, 19:28
My first skin :

https://img261.imageshack.us/img261/8554/0000copiark5.jpg (https://imageshack.us)



Thank you thelonewolf40 !!!

Rain_Saberhagen
01-24-2007, 16:38
Hello,

please someone help me, I am totally new in modding and I wanted to change some unit colours, I have photoshop, I got those texture/ddl converters, I tested them on some textures that I downloaded from internet and they work. The only problem is that I cant find the textures in my Medieval 2 total war folder. How can I come to those texture files? For example, how do I find texture file for general's unit? Do I have to have another program that can extract those texture file from some other files?

Roman_Man#3
01-24-2007, 16:59
I'm new to modding M2tw, but did you unpack everything? If you are having problems, I would suggest you look at the Setting up M2tw for modding guide. If you do everything in that, it should work.



welcome to the Org.

ratbarf
02-03-2007, 00:00
Do you need winrar to download the converter? I can't seem to be able to extract it and was wondering if this was the case?

Pharnakes
02-12-2007, 14:46
Hi can anyone tell me why it is imposable to extract the texture converter once I have downloaded it. Thanks.

MAX274bm
03-12-2007, 21:00
Alpaca u r a genious ...... just what I've been searching 4 will post a screeny when I do my thing... I'm a newbie :smash: so dont expect it tomorrow.
thanks !!!!

IrishArmenian
04-03-2007, 23:47
Hello everyone,

I'm having a problem with the texture converter. Everytime I try to run it, it gives me the "Press any key to continue" command. As instructed, I press any key (normally the enter key) and the window closes, without any changes.

More information (I assume this can help): I am running convert_all_textures.bat, I have python, and the file is texture_converter_01 in my data file.

alpaca
04-04-2007, 00:11
Ideally, you'd set up a working folder in which you copy the tool and the textures you want to convert.
I'm not 100% sure what could happen for you, if it doesn't present you with an error message it should run fine. Are you sure you don't have any converted files in your subfolders (where the appropriate .texture files are)?

IrishArmenian
04-04-2007, 00:38
Got it to work!
Is there a .dds plug in for GIMP?

S+ORM8R!NG3R
04-30-2007, 06:11
Totally new to the MTW world and I am trying my hand at modding since I seem to have a knack for graphics and photoshop..

But first and most importantly, I have to say THX to Alpaca for all of his unheralded work and advice(as well as patience....I have been reading these forums and I am shocked at the rudeness and selfishness of some people.) Love ya for all your time and creativeness:2thumbsup:

My question is.....Does it matter which dxt1 format I save in? One is 'no alpha' and the other '1 bit' I believe. My attempts at texture overlay editing renders me an 'all or nothing' kinda look. The changes are too subtle or the units look like they were wrestling in paint. I was wondering if this was a particular way that DX renders it's overlays or what was really happening....

Any advice or suggestions would be greatly appreciated and rewarded anyway I can.

Thx again,
~=]o Storm

alpaca
04-30-2007, 10:39
Totally new to the MTW world and I am trying my hand at modding since I seem to have a knack for graphics and photoshop..

But first and most importantly, I have to say THX to Alpaca for all of his unheralded work and advice(as well as patience....I have been reading these forums and I am shocked at the rudeness and selfishness of some people.) Love ya for all your time and creativeness:2thumbsup:
Awww, shucks ~:mecry:


My question is.....Does it matter which dxt1 format I save in? One is 'no alpha' and the other '1 bit' I believe. My attempts at texture overlay editing renders me an 'all or nothing' kinda look. The changes are too subtle or the units look like they were wrestling in paint. I was wondering if this was a particular way that DX renders it's overlays or what was really happening....

Any advice or suggestions would be greatly appreciated and rewarded anyway I can.

Thx again,
~=]o Storm
I don't really know. The converter only does what some people did manually before which is strip the file header and rewriting it when you reconvert.
I think you should always use the version that contains an alpha layer, but you can also try with DXT5

kungfuserge
09-29-2007, 08:43
Hi
I need to know ; (after editing the original dds file with adobe) ...and saving the file to a new dds (modified), which option to check in nvdia box option :dizzy2:

where it says by default DXT1 RGB 4 bpp | no alpha (is that correct ?)

because the file I save is Half smaller than the original one .

thanks

alpaca
09-29-2007, 16:33
Hi
I need to know ; (after editing the original dds file with adobe) ...and saving the file to a new dds (modified), which option to check in nvdia box option :dizzy2:

where it says by default DXT1 RGB 4 bpp | no alpha (is that correct ?)

because the file I save is Half smaller than the original one .

thanks
If you need the alpha (transparency) information, save as DXT5 - otherwise save as DXT1
The game understands both formats, as does the converter.

Monkwarrior
11-10-2007, 07:37
Hi.
Thanks Alpaca by this great tool.
I've used it several times with no problems, but now when I try to convert a texture I get an error message like this (it is translated from Spanish and perhaps it is not exact):

Unable to find MSVCR71.dll
Perhaps the reinstallation of the application would solve this problem.

Which application? Python?

I don't remember what I did from the last time I used the converter, but probably I installed the last Nvidia plugins (dds and nomal maps). Can it be the origin of the problem? How can I solve this?

Thanks in advance. :2thumbsup:

Edit: I've solved this problem by copying this file in system32 from other directory.

Vasileiosthe2nd
12-14-2007, 20:25
Hi.
I cant dl the " texture/dds converter" file from the link.
Consideringits been a while since the file "release" date, Id like to know if you have deleted it. Can I find it anywhere else pls? Or is it my fault I cant dl it? :help:

alpaca
12-14-2007, 21:04
Hi.
I cant dl the " texture/dds converter" file from the link.
Consideringits been a while since the file "release" date, Id like to know if you have deleted it. Can I find it anywhere else pls? Or is it my fault I cant dl it? :help:
Yeah looks like the link is down. I updated the first post with a link to the TWC:
http://www.twcenter.net/forums/downloads.php?do=file&id=1347

Vasileiosthe2nd
12-14-2007, 21:49
Dammit, you are almost always here and there to help others. Many kudos for ya alpaca, I really appreciate what you "efforts" and thank you.

Rhyfelwyr
12-17-2007, 14:42
How would I add a banner to the Normans, rather than editing the one they already use, as that would mean changing the English banner ingame as well?

EDIT: I've made a new banner for the normans, converted it to texture file, put it in the right folder. But how do I set the normans to use this rather than the English banners?

EDIT: Never mind got that working. Now I need to sort out how to edit the faction icon that appears when selecting a faction for campaign/custom battles...

Luciano B
02-24-2008, 16:02
Hi

I'm converting some of my old RTW models to M2TW.
It seems that there's something wrong with alpha channels, since it remains a sort of black border around the pieces cut with alpahs ...do you know a way to resolve that problem? ...maybe something related to the options to check using nvidia dds plug-in?

Thanks in advance.

alpaca
03-04-2008, 15:38
Sorry, I have no idea really. I didn't work with graphics a lot.

Methyl Orange
06-04-2008, 14:30
doesn't work for me! i have python and after running any of the bats it says pause and press any key to continue. :help:

FiltheeFoxx
08-21-2009, 20:52
I have the same problem as Methyl Orange. I have no .py file in the directory either, how do I create / find that?

FiltheeFoxx
08-21-2009, 20:58
I can't edit posts for some reason, but anyway, scratch the last post, I do have the .py document, but when I run the batch file, python doesn't open, and it just says pause and press any key to continue... What do I do!?!?!?! D:

salocin
10-07-2012, 20:03
Hello everyone,

I'm having a problem with the texture converter. Everytime I try to run it, it gives me the "Press any key to continue" command. As instructed, I press any key (normally the enter key) and the window closes, without any changes.

More information (I assume this can help): I am running convert_all_textures.bat, I have python, and the file is texture_converter_01 in my data file.

I have the same problem! How did you solve it? Can somebody help?

coffins
08-22-2015, 20:09
I have the same problem! How did you solve it? Can somebody help?

I'm not sure whether this thread is abandoned or not, but I figured out how to fix this issue.

Problem is related to path in Python script used by Batches in order to either convert to DDS or to texture. Argument which represents path is initialized with '' and that gives no sense during execution, so you get an error.

I edited script and fixed everything. Grab it:



# texture_converter.py version 0.1 (c) 2006 Stefan Reutter (alpaca)

import sys
import struct
import os
import math

def convertTextureToDDS(path):
f = open(path + '.texture', 'rb')
fw = open(path + '.dds', 'wb')
content = f.read()
fw.write(content[48:])
f.close()
fw.close()

def convertDDSToTexture(path):
f = open(path + '.dds', 'rb')
content = f.read()

init = [0x01000000, 0x30000000, 0x00000000]

# note: attachment sets don't seem to be used
normHeader = [0x0044E212, 0x00986212, 0x03C0DA12]
fill = [0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x65, 0x56, 0x3A, 0x7C, 0x03, 0x00, 0x00, 0x00]

dxt = -1

size = content[12:16]
if content[84:88] == 'DXT5':
dxt = 16384
elif content[84:88] == 'DXT1':
dxt = 4096

if dxt == -1:
print 'File '+path+' could not be converted'
else:
fw = open(path+'.texture','wb')
for i in init:
fw.write(struct.pack('>i', i))
fw.write('dds')

for i in normHeader:
fw.write(struct.pack('>i', i))
fw.write(struct.pack('h',dxt))
for i in fill:
fw.write(struct.pack('>b', i))
fw.write(size)
fw.write(content)
fw.close()
f.close()






# Main script code

convertAll = False
subdirectories = False
verbose = False

files = []

for i in sys.argv[1:]:
if i.startswith('-'):
i = i.strip('-')
if i.lower().find('type') > -1:
type = i.lower().split('=')[1]
elif i.lower() == 'all' > -1:
convertAll = True
elif i.lower() == 'sub' > -1:
subdirectories = True
elif i.lower() == 't' or i.lower() == 'texture':
type = 'texture'
elif i.lower() == 'd' or i.lower() == 'dds':
type = 'dds'
elif i.lower() == 'v' or i.lower() == 'verbose':
verbose = True
elif i.lower() == 'h' or i.lower() == 'help':
print """alpaca''s MTW2 .texture converter, version 0.1

usage: texture_converter.py [options] files

options:
-all: Converts all files, if this option is supplied, filenames can be omitted
-d,--dds: Convert .dds to .texture
-h,--help: Display this page
-sub: Also convert all files in all subfolders, can only be used with -all
-t,--texture: Convert .texture to .dds (default, can be omitted)
-v: Verbose option, extra output"""
else:
files.append(i)

if type == 'dds' or type == 'd':
if convertAll:
if subdirectories:
# Changed os.walk() arg from '' to os.getcwd() to get working directory.
for tup in os.walk(os.getcwd()):
for filepath in tup[2]:
if filepath.find('.dds') > -1:
files.append(os.path.join(tup[0], filepath.split('.dds')[0]))
else:
# Changed os.walk() arg from '' to os.getcwd() to get working directory.
for filepath in os.listdir(os.getcwd()):
if filepath.find('.dds') > -1:
files.append(filepath.split('.dds')[0])
i = 0
perc = 0
perc2 = 0
for filepath in files:
if math.floor(i*100/len(files)) > perc:
perc = math.floor(i*100/len(files))
if verbose:
print 'Converting file '+filepath+'.dds('+str(i+1)+' of '+str(len(files))+') - '+str(perc)+'%'
elif perc > perc2:
print str(perc)+'% done'
perc2 = perc
convertDDSToTexture(filepath)
i += 1
else:
i = 0
perc = 0
perc2 = 0
x = 0
for filepath in files:
if math.floor(i*100/len(files)) > perc:
perc = math.floor(i*100/len(files))
if verbose:
print 'Converting file '+filepath+'.dds('+str(i+1)+' of '+str(len(files))+') - '+str(perc)+'%'
elif perc > perc2:
print str(perc)+'% done'
perc2 = perc
convertDDSToTexture(filepath)
i += 1
else:
if convertAll:
if subdirectories:
# Changed os.walk() arg from '' to os.getcwd() to get working directory.
for tup in os.walk(os.getcwd()):
for filepath in tup[2]:
if filepath.find('.texture') > -1:
files.append(os.path.join(tup[0], filepath.split('.texture')[0]))
else:
# Changed os.walk() arg from '' to os.getcwd() to get working directory.
for filepath in os.listdir(os.getcwd()):
if filepath.find('.texture') > -1:
files.append(filepath.split('.texture')[0])
i = 0
perc = 0
perc2 = 0
for filepath in files:
if math.floor(i*100/len(files)) > perc:
perc = math.floor(i*100/len(files))
if verbose:
print 'Converting file '+filepath+'.texture('+str(i+1)+' of '+str(len(files))+') - '+str(perc)+'%'
elif perc > perc2:
print str(perc)+'% done'
perc2 = perc
convertTextureToDDS(filepath)
i += 1
else:
i = 0
perc = 0
perc2 = 0
x = 0
for filepath in files:
if math.floor(i*100/len(files)) > perc:
perc = math.floor(i*100/len(files))
if verbose:
print 'Converting file '+filepath+'.texture('+str(i+1)+' of '+str(len(files))+') - '+str(perc)+'%'
elif perc > perc2:
print str(perc)+'% done'
perc2 = perc
convertTextureToDDS(filepath)
i += 1
print 'Done'


Then replace contents of your script with this one and use converter as usual.
I also commented what has been changed.

Enjoy I suppose. ~;)

Ludens
08-23-2015, 09:17
Welcome to the .Org, and thanks for letting us know your solution.

:bow: