Miltiades Posted October 21, 2006 Share Posted October 21, 2006 I'm want to make a new module, using the Harbinger maps. Making the actual module I still need to learn, but I think in the end, I will succeed. To make the module a bit unique, I want to retexture it. My question: Where do I put the actual retextured files, and what do I have to do for the game to use these files for my module and not the original? Link to comment Share on other sites More sharing options...
Darth333 Posted October 21, 2006 Share Posted October 21, 2006 If you don't want to override any other textures, you have to rename the model files for the area and hex edit them to point at the new textures (this may also be possible with MDLops now...I"m not too sure as I'm pretty "old school" with this kind of things). You will also have to rename the .wok and .lyt files and edit the .lyt file to make it point at the renamed area models. Finally, you will have to edit the .git file to refer to your new module and renamed models. Link to comment Share on other sites More sharing options...
Miltiades Posted October 21, 2006 Author Share Posted October 21, 2006 Thanks. But do I need to change every model of that area? And how do I edit that in the hex editor, because all can't see any word in there, only letters? Link to comment Share on other sites More sharing options...
Quatra Posted October 21, 2006 Share Posted October 21, 2006 the hex editor only contains numbers 0 to 9 and letters A to F. If you count the numbers and the letters, you'll get 16. It's a computer code. I think there is a easier way to do what you want cuz changing something in the computer's language will be very long and difficult. Link to comment Share on other sites More sharing options...
Darth333 Posted October 21, 2006 Share Posted October 21, 2006 the hex editor only contains numbers 0 to 9 and letters A to F. If you count the numbers and the letters, you'll get 16. It's a computer code. I think there is a easier way to do what you want cuz changing something in the computer's language will be very long and difficult. In this case it's just a matter of search/replace the name of the texture. Nothing difficult... search for the name of your texture with the hex editor. When you change the name, make sure you use the same number of characters. Per example, if you want to replace a texture named tel_ja09 in an area model, search for tel_ja09 with the hex editor and change the reference for something that has 8 chars, like milt_000 instead of tel_ja09. Don't forget to name your new texture accordingly. Link to comment Share on other sites More sharing options...
Miltiades Posted October 21, 2006 Author Share Posted October 21, 2006 Of course, I should've known that. Thanks. Link to comment Share on other sites More sharing options...
Darth InSidious Posted October 21, 2006 Share Posted October 21, 2006 ^You can do the same with lightmaps, too, but if you do, don't forget to extract and change the accompanying .vis file Also, you will have to do it to every model, AFAIK, and you will have to leave all the room models in the .lyt unless you are using just the one. If you are using more than one you will run into walkmesh difficulties if you start fiddling with the number of rooms listed in the .lyt . Anyhow: Good luck, and post some screenshots Link to comment Share on other sites More sharing options...
Miltiades Posted October 22, 2006 Author Share Posted October 22, 2006 Thanks, and I'll post some later. First, I need to see if I'm going the right way with my mod. If I'm happy with how things are going, I'll set up a WIP and post some screenshots. Edit: So I need to edit files 151har01.mdl, 151har02.mdl,..., 151har17.mdl, 151harsb.mdl, and then again all the .wok files with the same filenames as above, and that one .lyt file? Or do I need to edit specific ones? Link to comment Share on other sites More sharing options...
Darth333 Posted October 22, 2006 Share Posted October 22, 2006 Yes, you have to edit the .mdl and the .mdx (name change only for the .mdx - edit only the files for which you want a custom textures) The .wok only needs a name change if I recall well. You have to rename the .lyt file as well, open it with notepad and change the names of the models listed in it to reflect the names of your edited models. Link to comment Share on other sites More sharing options...
Miltiades Posted October 22, 2006 Author Share Posted October 22, 2006 So the .mdl files I need to edit, but not rename, and the .mdx files I have to rename and edit? And the names for the textures aren't the same as the mdl files, so how do I know which to rename? Anyway, I've tried to edit 151har01.mdl with a hex editor, but I can't find for example HAR_Cr01(.tga). What have I done wrong? Link to comment Share on other sites More sharing options...
stoffe Posted October 22, 2006 Share Posted October 22, 2006 So the .mdl files I need to edit, but not rename, and the .mdx files I have to rename and edit? And the names for the textures aren't the same as the mdl files, so how do I know which to rename? To summarize what has been said so far in this thread You want to make a new module, based on a retextured variant of an existing standard game area, without having the area in the standard game retextured as well. To do this you need to make your own variant of the textures used in the standard area, but name them differently since you don't want to change the look of the standard area as well. An area is made up of several model segments, called "rooms" in game terminology. Each room has a MDL and MDX file (these files always come in MDL+MDX pairs in KotOR; together they make up a 3d model) containing its model, and a WOK file containing a walkmesh specifying where creatures can go in the area. Each model also has a number of textures, specified inside the MDL file. The MDL, MDX and WOK files are named the same (aside from the file extensions) for a room. The different "rooms" are linked together into a complete area with a .LYT (Layout) file. This file contains the names of the different "room" models (MDL/MDX/WOK) that make up the area. The .LYT file is always named the same as the .ARE (Static area info) and .GIT (Dynamic area info) files aside from the file extensions: the "name" of the area. With the above in mind, to make a new copy of an area with different textures, you will need to find the room models you want to change the textures from (likely all of them if you want to give the area a complete makeover). You can find the MDL names in the LYT file named the same as the area. Open the MDL files and locate the names of the textures within, and extract those with KotorTool to use as templates for your new textures so you can get the dimensions right. When you have made your new textures, save them under new, unique names so they won't mess with the textures used for the standard module using this area. Take care to make the names the same character length as the original names. This is very important. Next, open the MDL files again with a hex-editor, find where the names of the textures are specified and replace the names of the old textures with the name of your new modified textures. This is why they must be the same name, they must occupy exactly the same bytes in the MDL file as the old texture names, or you might break the MDL file. You now have new MDL files using your own textures. To avoid having those models override the ones used in the standard games, you will need to rename the MDL file as well, so it won't be used in the standard game area. Give it a new unique name, it doesn't matter what as long as it's a valid ResRef. However, as mentioned above, the model always comes in three files, MDL, MDX and WOK. So you will need to copy the MDX and WOK files as well, and rename them the same as your modified MDL files (even if you haven't modified those files in any other way). You now have separate copies of the area model pieces, named differently so they won't be used by the standard game areas. Since you want to be able to use your modified models however you need to create a separate area layout (.LYT file) which references your renamed MDL/MDX/WOK files. So, make a copy of the LYT file of the original area and give it a unique name. Then open it with a text editor and change the named of the "room" model pieces you have made modified copies of, and replace their standard names with the names of your new MDL/MDX/WOK files. Also make a copy of the .VIS file for the area, and rename it to match your area name. To use this new area layout (LYT file), name the .ARE and .GIT files inside your module's MOD or RIM file the same as the new LYT file. (E.g. myarea.lyt, myarea.vis, myarea.are, myarea.git, or whatever you picked). Hmm, not much of a summary in hindsight... Link to comment Share on other sites More sharing options...
Miltiades Posted October 22, 2006 Author Share Posted October 22, 2006 Wow, that is very helpful. Thank you very much! One question though: Not long ago, I tried to rename the .are and .git files, but then I couldn't open the module in the Module Editor in KotorTool. What did I do wrong? Link to comment Share on other sites More sharing options...
Master Zionosis Posted October 22, 2006 Share Posted October 22, 2006 Well it depends, the files could be corrupt, thats happend to me before, or most likely you dont have the .map file for the module, whitch module is it. Link to comment Share on other sites More sharing options...
stoffe Posted October 22, 2006 Share Posted October 22, 2006 Wow, that is very helpful. Thank you very much! One question though: Not long ago, I tried to rename the .are and .git files, but then I couldn't open the module in the Module Editor in KotorTool. What did I do wrong? If you rename the ARE/GIT/LYT files you have essentially created a new Area Layout, and thus you'd need a KotorTool module editor map for that layout. KotorTool Module editor maps correspond to area layouts/area names. Unless there is a way to copy&paste&rename the KotorTool map so it recognizes the new area layout you'd have to do your KT Module Editing before you apply your new area layout (i.e. before you rename the area definition files). (And if you just rename the ARE/GIT without having a .LYT file with the new name your area will just be a black void in-game. ) Link to comment Share on other sites More sharing options...
Miltiades Posted October 22, 2006 Author Share Posted October 22, 2006 Well it depends, the files could be corrupt, thats happend to me before, or most likely you dont have the .map file for the module, whitch module is it. No, I have the .map file, and it worked before I renamed the files. But I have to rename them so I don't overwrite the original module. Open the MDL files and locate the names of the textures within, and extract those with KotorTool to use as templates for your new textures so you can get the dimensions right. In a .MDL file of 151har, I found HAR_01_tc01, though in Kotor Tool, I can't find a file with that exact name. However, I did find this: Har_tc01. Is this the file, or am I looking at the wrong place. There are some, like HAR_01_wall_03, I can't find in KotorTool, but I can find Har_wall_02. Help, please. Link to comment Share on other sites More sharing options...
stoffe Posted October 22, 2006 Share Posted October 22, 2006 In a .MDL file of 151har, I found HAR_01_tc01, though in Kotor Tool, I can't find a file with that exact name. (SNIP) Which MDL file did you find HAR_01_tc01 in? Also keep in mind that all human-readable text in a MDL file is not necessarily texture names. There may be model object names, lightmaps and other things in there as well. Also, when looking for textures, keep in mind that KotorTool doesn't sort the file lists alphabetically in the treeview. I think it lists the content in the order it appears inside the KEY/BIF/ERF/RIM files. If you click on the treeview and quickly begin typing a file name a matching entry in the treeview will be selected. Link to comment Share on other sites More sharing options...
Miltiades Posted October 22, 2006 Author Share Posted October 22, 2006 Already found it. Turned out I had to look further. Gosh, I'm stupid . Anyway, I find one texture filename multiple times in the MDL file, and I practically find every texture file in that one MDL file. Does this mean, if I want to apply my new textures to every new room in my module, I need to edit every MDL file? And do I have to rename all those texture filenames in the MDL file? Link to comment Share on other sites More sharing options...
Darth333 Posted October 22, 2006 Share Posted October 22, 2006 Does this mean, if I want to apply my new textures to every new room in my module, I need to edit every MDL file? And do I have to rename all those texture filenames in the MDL file? If you want your textures to be used only in your custom module and not in the original one, then yes, you have to edit every .mdl you want to use. Btw, if you are working with KT's module editor, I suggest you backup your .git file regularly. I once made a mistake by typing something in the wrong field and KT erased all the contents of my .git file... I wanted to throw my PC out of the window when it happened : Link to comment Share on other sites More sharing options...
Miltiades Posted October 23, 2006 Author Share Posted October 23, 2006 Thanks for the advice. If you rename the ARE/GIT/LYT files you have essentially created a new Area Layout, and thus you'd need a KotorTool module editor map for that layout. KotorTool Module editor maps correspond to area layouts/area names. Unless there is a way to copy&paste&rename the KotorTool map so it recognizes the new area layout you'd have to do your KT Module Editing before you apply your new area layout (i.e. before you rename the area definition files). (And if you just rename the ARE/GIT without having a .LYT file with the new name your area will just be a black void in-game. ) There's one problem with that: you can build your .MOD file on two different ways. You can build it in the Module Editor, but then I can't rename my files (.LYT and .vis, .git and .are), because I can't open the map then. The second way is using the ERF/MOD builder. Then I can rename my files with no problem, but then the things I done (added NPCs, Items etc.) in the Module Editor won't be saved, because I have to put every file that is in the module (for example an NPC) in the ERF Builder. Am I right, or horribly wrong, and what to do? Link to comment Share on other sites More sharing options...
stoffe Posted October 23, 2006 Share Posted October 23, 2006 There's one problem with that: you can build your .MOD file on two different ways. You can build it in the Module Editor, but then I can't rename my files (.LYT and .vis, .git and .are), because I can't open the map then. Do your KT Module Editor editing first, before changing the area layout of your area (This doesn't mean you can't create your area layout already, since it won't be used by your new area until you rename the ARE/GIT files anyway). When you've placed everything where it should be and saved your module, extract the 151HAR.ARE, 151HAR.GIT (assuming that's your base area) and module.ifo files from the MOD file. Rename the ARE and GIT file to match the name of the LYT file containing your new area layout. Then open the module.ifo file with a GFF editor and change the Mod_Entry_Area field and Mod_Area_list\0\Area_Name field to match the new area name. Then use an ERF editor to delete the old ARE and GIT file from the MOD file, add your renamed variants and the modified module.ifo file back into it and save it. Link to comment Share on other sites More sharing options...
Miltiades Posted October 23, 2006 Author Share Posted October 23, 2006 Thanks. One more thing: Darth333 mentioned editing the .git file to refer to my new module and renamed models. I can't find the fields in the .git file to do that. Link to comment Share on other sites More sharing options...
Darth333 Posted October 23, 2006 Share Posted October 23, 2006 Argh! Sorry, I made a mistake. I believe it's in the .are or the .ifo file, not the .git. You should see a list of of the models used for your area (it's called rooms "something"...I don't have the game with me and can't give you the exact name and location) Link to comment Share on other sites More sharing options...
Miltiades Posted October 23, 2006 Author Share Posted October 23, 2006 Yep, it's in the .are file. Thanks Link to comment Share on other sites More sharing options...
Miltiades Posted October 26, 2006 Author Share Posted October 26, 2006 Okay, I've tested it, and it worked. Of course, I have some little problems. When I'm in one room, the other rooms are black, but when I get into one of those rooms, they become normal, but the one I came from is now black etc. Also, when I wanted to quit, the game crashed. I hope it doesn't have anything to do with the module, but you never know. Link to comment Share on other sites More sharing options...
stoffe Posted October 26, 2006 Share Posted October 26, 2006 When I'm in one room, the other rooms are black, but when I get into one of those rooms, they become normal, but the one I came from is now black etc. A couple of random ideas: Did you check the TXI information for the original textures, in case there was something in there that needs to be applied to your new textures as well? Have you replaced a large number of textures, and/or very large textures? Keep in mind that since TGA textures aren't DXTC compressed, unlike TPC textures, they will take up more memory on your graphics card, and if your card doesn't have a lot of VRAM you might run out of memory and the game might decide to clear out far-away textures to free up memory. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.