PDA

View Full Version : Retexturing a module


Miltiades
10-21-2006, 10:41 AM
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?

Darth333
10-21-2006, 11:00 AM
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.

Miltiades
10-21-2006, 11:23 AM
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?

Quatra
10-21-2006, 02:00 PM
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.

Darth333
10-21-2006, 02:29 PM
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.

Miltiades
10-21-2006, 04:21 PM
Of course, I should've known that. Thanks.

Darth InSidious
10-21-2006, 04:51 PM
^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 :)

Miltiades
10-22-2006, 07:54 AM
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?

Darth333
10-22-2006, 10:31 AM
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.

Miltiades
10-22-2006, 10:47 AM
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?

stoffe
10-22-2006, 11:30 AM
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... :)

Miltiades
10-22-2006, 12:06 PM
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?

Master Zionosis
10-22-2006, 12:14 PM
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.

stoffe
10-22-2006, 12:27 PM
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. :))

Miltiades
10-22-2006, 12:30 PM
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.

stoffe
10-22-2006, 12:41 PM
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.

Miltiades
10-22-2006, 12:51 PM
Already found it. Turned out I had to look further. Gosh, I'm stupid :p. 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?

Darth333
10-22-2006, 02:47 PM
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 :headbump:

Miltiades
10-23-2006, 12:50 PM
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?

stoffe
10-23-2006, 01:13 PM
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. :)

Miltiades
10-23-2006, 02:29 PM
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.

Darth333
10-23-2006, 03:21 PM
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)

Miltiades
10-23-2006, 03:31 PM
Yep, it's in the .are file. Thanks ;)

Miltiades
10-26-2006, 03:43 PM
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.

stoffe
10-26-2006, 04:30 PM
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.

Darth InSidious
10-26-2006, 04:58 PM
Is the name of your .lyt still the same as it was for the original module?

Miltiades
10-26-2006, 05:24 PM
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.

I have replaced a large number, yes. And I retextured the TGA textures, not TPC textures. I don't think my graphics card couldn't handle it, I have a Radeon X800 Pro.


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?

Do you mean the info in the Image Viewer when you open a texture? And if that's the info, how do I apply that?


Is the name of your .lyt still the same as it was for the original module?

Uh, doesn't the .lyt file have be renamed?

Darth InSidious
10-27-2006, 08:29 AM
Yes. But if you don't, that black-room thing can happen.

Sorry to ask stupid questions, but it can be something really obvious that causes this kind of thing :)

Miltiades
10-27-2006, 03:28 PM
No, it's good to know, but I have renamed it, so that's not the problem.

Miltiades
10-28-2006, 01:08 PM
Just found something out: the black emptyness between the rooms are actually doors. I can go through every door without opening it because it's just a black emptyness. What have I done wrong?

Darth333
10-28-2006, 02:02 PM
Did you packed the doors within your .mod file? Double check the .utd to make sure the info in there is correct. (Unfortunately I don't have kotor installed at this moment so I can't check all the details. I'm waiting for my new pc to arrive before doing so so the help I can provide is only limited for another few days)

Miltiades
10-28-2006, 02:22 PM
Uh... no. I didn't know that was necessary, because I used an existing module, and I thought everything was in there, including the doors. No other files need to be in the .mod file apparantly, because they are in the module. I also haven't made a new .utd file, because I use the same as in the existing module.

Darth InSidious
10-28-2006, 08:01 PM
Extract the door files and put them in the .mod .

You may have to do that with the placeables, too :)

Miltiades
10-29-2006, 08:19 AM
I placed the door files in the mod and yes, there are doors in my module now. They aren't the retextured once though, I don't know how to link the doors with my retextured files.

And although the doors appeared, once they're open, the blackness reappears. And when the doors are still closed, you can see through the wall close to the door and see the hallway around the corner.

Pavlos
10-29-2006, 11:36 AM
Whereabouts is this blackness in the Harbinger module? To my memory, there is one error with it - near where the broken door is in 151HAR (Right near the entrance). It causes the room models on the other side of the door to disappear until you step over the threshold and upon doing so, the rooms behind disappear too.

Is this what you mean? If so: There is no soultion other than to have a permanently locked door there.

I have no idea what could be causing blackness for all doors. Have you updated the doorhookcount and the list beneath. I'm pretty sure that they have something to do with the internal toolset the developers used but it is worth a shot.

Edit:

For example: If I change all the names of the models within the layout file as follows:

PAHARSB 96.9817 67.7872 0.0
PAHAR16 42.1658 58.3836 -0.060816
PAHAR10 36.9242 81.9698 0.0
PAHAR06 39.5591 98.5296 -0.0395661
PAHAR05 39.1752 81.6386 1.23543
PAHAR04 39.9431 81.6386 1.23543
PAHAR03 51.5617 107.402 1.275
PAHAR02 39.1057 120.741 3.05176e-007
PAHAR01 34.1285 146.727 0.0
PAHAR15 23.6645 54.1265 -0.0395686
PAHAR17 22.0325 41.213 -0.0395668
PAHAR07 7.26811 86.4587 -3.43323e-006
PAHAR08 4.59096 71.0048 -3.43323e-006
PAHAR09 3.23787 52.9573 -3.43323e-006
PAHAR13 27.883 127.639 1.275
PAHAR14 23.6145 98.397 -1.52588e-006
PAHAR11 25.5088 112.311 -1.2207e-006
PAHAR12 23.2973 114.381 1.275

Then I must also edit the doorhooks:

PAHAR06 door_11 0 39.5629 106.035 0.0 1.0 0.0 0.0 0.0
PAHAR05 door_12 0 39.5508 66.9464 0.0 1.0 0.0 0.0 0.0
PAHAR03 door_09 0 50.1461 115.569 0.0 1.0 0.0 0.0 0.0
PAHAR03 door_10 0 52.8669 99.4203 0.0 1.0 0.0 0.0 0.0
PAHAR01 door_01 0 29.1853 135.627 0.0 1.0 0.0 0.0 0.0
PAHAR01 door_02 0 39.5061 135.627 0.0 1.0 0.0 0.0 0.0
PAHAR15 door_13 0 24.8903 62.2997 0.0 1.0 0.0 0.0 0.0
PAHAR15 door_14 0 22.169 46.1408 0.0 1.0 0.0 0.0 0.0
PAHAR17 door_15 0 22.169 35.8937 0.0 1.0 0.0 0.0 0.0
PAHAR07 door_06 0 8.49093 94.6174 -7.62939e-007 1.0 0.0 0.0 0.0
PAHAR07 door_07 0 5.77494 78.4642 -3.8147e-007 1.0 0.0 0.0 0.0
PAHAR08 door_08 0 3.05781 62.3066 -3.8147e-007 1.0 0.0 0.0 0.0
PAHAR13 door_03 0 26.4597 119.478 0.0 1.0 0.0 0.0 0.0
PAHAR13 door_05 0 23.7505 103.321 0.0 1.0 0.0 0.0 0.0
PAHAR11 door_04 0 18.6092 114.219 -7.62939e-007 0.707107 0.0 0.0 -0.707107

So that the full thing would look like this:

#MAXLAYOUT ASCII
filedependancy 151HAR.max
beginlayout
roomcount 18
PAHARSB 96.9817 67.7872 0.0
PAHAR16 42.1658 58.3836 -0.060816
PAHAR10 36.9242 81.9698 0.0
PAHAR06 39.5591 98.5296 -0.0395661
PAHAR05 39.1752 81.6386 1.23543
PAHAR04 39.9431 81.6386 1.23543
PAHAR03 51.5617 107.402 1.275
PAHAR02 39.1057 120.741 3.05176e-007
PAHAR01 34.1285 146.727 0.0
PAHAR15 23.6645 54.1265 -0.0395686
PAHAR17 22.0325 41.213 -0.0395668
PAHAR07 7.26811 86.4587 -3.43323e-006
PAHAR08 4.59096 71.0048 -3.43323e-006
PAHAR09 3.23787 52.9573 -3.43323e-006
PAHAR13 27.883 127.639 1.275
PAHAR14 23.6145 98.397 -1.52588e-006
PAHAR11 25.5088 112.311 -1.2207e-006
PAHAR12 23.2973 114.381 1.275
trackcount 0
obstaclecount 0
doorhookcount 15
PAHAR06 door_11 0 39.5629 106.035 0.0 1.0 0.0 0.0 0.0
PAHAR05 door_12 0 39.5508 66.9464 0.0 1.0 0.0 0.0 0.0
PAHAR03 door_09 0 50.1461 115.569 0.0 1.0 0.0 0.0 0.0
PAHAR03 door_10 0 52.8669 99.4203 0.0 1.0 0.0 0.0 0.0
PAHAR01 door_01 0 29.1853 135.627 0.0 1.0 0.0 0.0 0.0
PAHAR01 door_02 0 39.5061 135.627 0.0 1.0 0.0 0.0 0.0
PAHAR15 door_13 0 24.8903 62.2997 0.0 1.0 0.0 0.0 0.0
PAHAR15 door_14 0 22.169 46.1408 0.0 1.0 0.0 0.0 0.0
PAHAR17 door_15 0 22.169 35.8937 0.0 1.0 0.0 0.0 0.0
PAHAR07 door_06 0 8.49093 94.6174 -7.62939e-007 1.0 0.0 0.0 0.0
PAHAR07 door_07 0 5.77494 78.4642 -3.8147e-007 1.0 0.0 0.0 0.0
PAHAR08 door_08 0 3.05781 62.3066 -3.8147e-007 1.0 0.0 0.0 0.0
PAHAR13 door_03 0 26.4597 119.478 0.0 1.0 0.0 0.0 0.0
PAHAR13 door_05 0 23.7505 103.321 0.0 1.0 0.0 0.0 0.0
PAHAR11 door_04 0 18.6092 114.219 -7.62939e-007 0.707107 0.0 0.0 -0.707107
donelayout

Miltiades
10-29-2006, 11:59 AM
It happens to all rooms. I don't think it has something to do with the doors after all, because the blackness happens between every room. A hallway which is divided in 2 rooms for example, has a blackness where the second part of the hallway begins.

So what you suggested didn't work. And although the doors are there now, they're not the reskinned ones. I know the reskinned doors can't appear in the module if I don't link them to .mdl files or .lyt files or whatever, like reskinned walls, but I don't know how to do it.

stoffe
10-29-2006, 06:05 PM
I know the reskinned doors can't appear in the module if I don't link them to .mdl files or .lyt files or whatever, like reskinned walls, but I don't know how to do it.

The UTD files have a field called GenericType which links to a line number in genericdoors.2da. This 2DA file contains the name of the Model file used for the door, as well as what sound it makes when it opens/closes and some other things.

If you want to add a new door type you'll need to add a new line to this 2DA file where you set your modified door models and use this line in the UTD files for your doors.

Miltiades
10-29-2006, 06:49 PM
Are all doors included in that 2da file? Because I can only find one Harbinger door with it's mdl file in the 2da file, but if I look into the model list, I find 3 mdl files.

Also, do I have to change something in the mdl files again, and what exactly?

And if I would copy the HarbingerDoor row, what do I have to change of that line?

Finally, do I have to change something in my .utd file?

stoffe
10-30-2006, 07:14 AM
Are all doors included in that 2da file? Because I can only find one Harbinger door with it's mdl file in the 2da file, but if I look into the model list, I find 3 mdl files.

Hmm, which ones are you referring to? Genericdoors.2da line 48 (Hammerhead1), 58 (BrokenDoor) and 78 (HarbingerDoor03) use the models DOR_HAR01, DOR_HAR02 and DOR_HAR03 respectively. Are there any others?

Also, do I have to change something in the mdl files again, and what exactly?

Change the names of the textures and the name of the model inside the MDL files, and rename the MDL (and corresponding MDX) file to something new.


And if I would copy the HarbingerDoor row, what do I have to change of that line?

Change the label column to something unique so you and others knows what it is more easily and change the modelname column to the name of your renamed MDL file.

Finally, do I have to change something in my .utd file?

Yes, as hinted in the previous post you must change the GenericType field to the line number of your new line in genericdoors.2da to make the door template use that door type. :)

stoffe
10-30-2006, 07:27 AM
It happens to all rooms. I don't think it has something to do with the doors after all, because the blackness happens between every room. A hallway which is divided in 2 rooms for example, has a blackness where the second part of the hallway begins.


If no one else has a more informed suggestion about this I'm going to make a wild guess. :) It might be an incorrect assumption, but perhaps the .VIS extension stands for "Visibility"? Have you created a new .VIS file for your renamed area, which properly refers to your renamed rooms etc inside it?

Miltiades
10-30-2006, 07:43 AM
Hmm, which ones are you referring to? Genericdoors.2da line 48 (Hammerhead1), 58 (BrokenDoor) and 78 (HarbingerDoor03) use the models DOR_HAR01, DOR_HAR02 and DOR_HAR03 respectively. Are there any others?

No, I couldn't find the first two. My bad.


Yes, as hinted in the previous post you must change the GenericType field to the line number of your new line in genericdoors.2da to make the door template use that door type. :)

I can't find the GenericType field in the .utd file.

Miltiades
10-30-2006, 07:53 AM
If no one else has a more informed suggestion about this I'm going to make a wild guess. :) It might be an incorrect assumption, but perhaps the .VIS extension stands for "Visibility"? Have you created a new .VIS file for your renamed area, which properly refers to your renamed rooms etc inside it?

I had created a new renamed .VIS file, but I hadn't changed anything inside it. I have now, but it didn't change anything.

Edit: Oh wait, that did work. Made a mistake. Thanks, stoffe. Only need to get those retextured doors in the module now.

stoffe
10-30-2006, 10:18 AM
I can't find the GenericType field in the .utd file.

Are you sure? It should look like this:

http://img50.imageshack.us/img50/8821/generictypeia2.gif.

It should exist in all templates since it determines how the door works. If that field doesn't exist in your UTD templates you could try to add it. Make sure you set the data type correctly.

Miltiades
10-30-2006, 10:34 AM
It worked! I opened the .utd files with Kotor Tool instead of it a GFF Editor. Above that, I worked with the wrong .utd files. So, thank you.

But now that works, I have some other questions. I'll use the Harbinger as an example.

In certain rooms in the Harbinger, there are tables, desks or computers. Can I remove these things or is it impossible? And can I place things like that in the module, such as cages?

Another thing I would like to do, is if you look outside the Harbinger, you can see ships flying in space. How would I need to do that? And because I used the Harbinger modules, I see the Peragus Facility through the windows. How can I make it disappear?

stoffe
10-30-2006, 10:46 AM
In certain rooms in the Harbinger, there are tables, desks or computers. Can I remove these things or is it impossible? And can I place things like that in the module, such as cages?


If you can remove objects depend on if they are part of the area model or if they are placeables. If they are placeables you can delete them from the PlaceableList in the area's GIT file.

If they are part of the model it becomes a lot trickier, since you'd need to edit the room model it's part of and re-import it back into the game, and modify the walkmesh to characters can walk where the furniture used to be. Someone else will have to answer if that's feasible since I'm not very knowledgeable about 3d modeling for the KotOR games.

The same thing applies for adding things, but in reverse. Placeables = easy, area model = not so easy. :)

Miltiades
10-30-2006, 10:54 AM
How do I know what's a placeable and what's a area model? Filenames don't say much, how can I see those files as objects?

Edit: Never mind, I got it. But could someone tell me how to make the Peragus Facility disappear and make ships fly through space when you look thorugh the window?

Pavlos
10-30-2006, 12:26 PM
Hmm...

Theoretically, if you find the name of the skybox model you may be able to replace it with the skybox model from Darth Nihilus' ship - with all the laser shots and a couple of fighters. This can be done with simple editing of the .lyt. I'm not sure if we can create new room animations, perhaps someone else will know more on this matter.

Darth InSidious
10-30-2006, 02:10 PM
^You could do, but in all probability you wouldn't be able to walk from one room to another in that module.

It would be easier to extract the right textures and HEX-edit the skybox model.

Miltiades
10-30-2006, 02:34 PM
And where exactly can I find that model?

Edit: And my "door" problem isn't over yet. It seems I can just walk through them. Any idea how that's possible?

stoffe
10-30-2006, 02:49 PM
Edit: And my "door" problem isn't over yet. It seems I can just walk through them. Any idea how that's possible?

Did you copy the .DWK file with the same name as the MDL for the original door and rename it to match your modified door model? DWK files contain walkmesh info for doors, which might cause the problem you describe if it's missing. (Walkmeshes for doors (DWK) and placeables (PWK) describe where creatures/characters cannot move.)

Miltiades
10-30-2006, 03:08 PM
Ah, I forgot that. Now it works. I'm beginning to understand how it all works. :)

Miltiades
10-30-2006, 03:42 PM
If they are part of the model it becomes a lot trickier, since you'd need to edit the room model it's part of and re-import it back into the game, and modify the walkmesh to characters can walk where the furniture used to be. Someone else will have to answer if that's feasible since I'm not very knowledgeable about 3d modeling for the KotOR games.

The same thing applies for adding things, but in reverse. Placeables = easy, area model = not so easy. :)

If something in a room is just standing in the way, how difficult would it be to delete it so that you can walk where that object has been? Because I just opened a room of the Harbinger with gmax and deleted tha part where I want to walk. I assume I still need to do something in gmax? Or is deleting it enough, and do I only need to edit the walkmesh now so that I can walk there?

Darth InSidious
10-30-2006, 04:00 PM
You'd have to edit the .WOK .

Once you've extracted a WOK file you can edit them with your text editor - say, Notepad.

Be warned, though, that they aren't clearly labelled or easy to edit, and my few rudimentary experiments in this direction have tended to have rather peculiar results.

Miltiades
10-30-2006, 04:28 PM
One stupid question about gmax: how do I save my edit room? It seems you can only save it in .gmax, but it is a .mdl file. How do I do that?

Uh, and about the .WOK files, is it normal it's all symbols and such? It's unreadable. How cna you edit such stuff? :p

Darth InSidious
10-30-2006, 04:45 PM
OK. First of all, double-click it. That should open the PWK/DWK editor. I wouldn't bother with it, though, since it's very rudimentary and I'm not entirely sure what it does, myself...Click 'File'. Click 'Save as ASCII'.

Now it's readable.

I haven't tried opening WOK files with NWMAX, but I doubt it would work, TBH.
Also, ANY variations in model have a tendency to screw the lightmaps completely.

Miltiades
10-30-2006, 05:44 PM
No, I want to save my edited mdl file. How do I do that, because if I would save it the normal way it would be in .gmax.

Edit: Hmm, and editing a room isn't easy. I remove more than I want to. I can't just remove a simple pipe, 'cause is I do, I remove a whole part of the room :s

Darth InSidious
10-31-2006, 04:05 AM
Click the AuroraBase, and click the "Mesh Settings" Tab on the side-control panel where you do the get the little list of stuff like 'Aurora Trimesh' et al., and down the bottom their should be a button marked "Export Geom Only". Click it.

Just make sure you know which directory the path leads to, though ;)

Miltiades
10-31-2006, 04:57 AM
Ok, thanks.

Does anyone know how to delete an object in a room without removing a whole part of the room?

And where can I find the skybox model so I can see the stars with ships through the window?

Darth InSidious
10-31-2006, 07:46 AM
You have to figure out which model is the skybox manually, unfortunately :(

Also, AFAIK, any such removals will result in a black patch in game, because the lightmaps will screw up, and the walkmesh won't fit properly.

That said, you might try editing the particular part's editable mesh...

Miltiades
10-31-2006, 07:54 AM
You have to figure out which model is the skybox manually, unfortunately

Skybox model: Do you mean, opening the models in gmax to see if it's the right one? And there's no way you can tell what could be a skybox model?

That said, you might try editing the particular part's editable mesh...

How do I do that?

Darth InSidious
10-31-2006, 07:59 AM
Um, on the first one, yes. I suppose you might be able to tell if it has a sunflare mention, or by the names of the textures if you open it in a HEX editor, but personally I like to be certain.

On the second, I'll be back later with some screenshots from Gmax :)

http://i15.photobucket.com/albums/a362/jimspriggs33/GMAX1.jpg
http://i15.photobucket.com/albums/a362/jimspriggs33/GMAX2.jpg
http://i15.photobucket.com/albums/a362/jimspriggs33/GMAX3.jpg
http://i15.photobucket.com/albums/a362/jimspriggs33/GMAX4.jpg
http://i15.photobucket.com/albums/a362/jimspriggs33/GMAX5.jpg
http://i15.photobucket.com/albums/a362/jimspriggs33/GMAX6.jpg
http://i15.photobucket.com/albums/a362/jimspriggs33/GMAX7.jpg
http://i15.photobucket.com/albums/a362/jimspriggs33/GMAX8.jpg
http://i15.photobucket.com/albums/a362/jimspriggs33/GMAX9.jpg
http://i15.photobucket.com/albums/a362/jimspriggs33/GMAX10.jpg
http://i15.photobucket.com/albums/a362/jimspriggs33/GMAX11.jpg
http://i15.photobucket.com/albums/a362/jimspriggs33/GMAX12.jpg

Hope those help :)

Miltiades
10-31-2006, 09:03 AM
Thanks. About the skybox, I have to look into model.bif and then it could be practically every file in the list?

Darth InSidious
10-31-2006, 09:04 AM
Pictures uploaded :)

Miltiades
10-31-2006, 09:50 AM
At step 4, how do you get only that object in the orange rectangle? When I click on the object I want to delete, the whole room is in the rectangle.

This is what I want to delete, and what I've selected:

http://i141.photobucket.com/albums/r43/Speedhawk7/GMaxMs2.jpg

And this is what's selected:

http://i141.photobucket.com/albums/r43/Speedhawk7/GMaxMs1.jpg

Darth InSidious
10-31-2006, 10:09 AM
Hmmm...In that case I recommend selecting and carrying on as the pictures suggest, if possible?

re: models: well, it's going to be one of the ones in the 85#NIH range for the Ravager. Harbinger it'll be one of the 15#HAR ones... :)

EDITH: Have you tried pressing 'delete'? You can always Ctrl+Z afterwards...

Miltiades
10-31-2006, 10:47 AM
Well, that's just it. When I select it, and press delete, I've removed a big part of the room. Maybe it's only that room that is the problem. I'm using 151har01.mdl, and that's the bridge.

re: models: well, it's going to be one of the ones in the 85#NIH range for the Ravager. Harbinger it'll be one of the 15#HAR ones...

Aren't those all rooms? Or is the skybox mdl also a room?

Darth InSidious
10-31-2006, 02:05 PM
The skybox is also listed as a room-model, yes. In order that it can be put in the .lyt .

Miltiades
10-31-2006, 02:36 PM
Ah, okay.

About deleting objects in rooms: Could it be the part I want to delete (as seen in the picture I showed in one of my previous posts) is part of a wall, because most of the time when I click on it it says Wall_07 or Wall_08. If that's true, is it even possible of deleting that part?

Darth InSidious
10-31-2006, 03:29 PM
Uh, that was what I was trying to show you...

Miltiades
10-31-2006, 06:28 PM
I can't seem to follow. You showed how to delete an object in a room, yes. But if an object is, in fact, not a single object, but part of the infrastructure, is it possible to delete it without deleting a quarter of he room?

On one of your pictures, you had selected the object you wanted to delete. A rectangle surrounded it. When I select the object I want to delete, the whole room, or at least a quarter of the room is surrounded by a rectangle. Is it possible to select only that which I want to delete, or will it always remain part of a bigger object?

Sorry if I'm bothering you with this, but if it's possible, I would like it to work. The more differences there are between the original module and the new one, the better. If it can't be done, so be it.

Darth InSidious
11-01-2006, 05:38 AM
I selected a part and then the orange box surrounded it. A large thing than the bit I deleted, in fact. I then selected a few bits and deleted them, as the pictures show.

You've just got a bigger orange box.

I'm sorry, but I don't see what you don't get...?

Miltiades
11-01-2006, 05:55 AM
Well, when I select the part I want to delete, a large box surrounds the whole room or part of the room. When I press delete, there's a lot removed I didn't want to remove, for example the chairs are gone though I never selected them. When I deleted most parts of the object I wanted to delete, almost everything in the room has been deleted!

Edit: Oh wait, I got it. I was just walking too far ahead. I'm just plain stupid. :toilet1:

I'm currently at picture 7-8, but I don't know what you did there. Could you explain?

Darth InSidious
11-01-2006, 01:27 PM
Um, I drag-selected some of the little blobs, pressed the move button (the 4-way arrow), and switched to the directional moving method I find easiest (you can toggle the directional movement control with 'x'. Don't get it confused with Ctrl+x, though, which makes the perspective box go fullscreen :) ). Then I clicked 'delete'.

Miltiades
11-01-2006, 01:43 PM
Ah. About saving it, I've found the AuroraBase button, which i find under Create -> Helpers, but when I click on it, nothing happens. I can't find the Mesh Settings Tab. What did happen was, when I clicked on the AuroraBase Button, and then clicked on the model, the options to export came up. The problem is that it'll probably only save what I have selected.

Darth InSidious
11-01-2006, 01:55 PM
Nonono. You can either save the whole thing as a .gmax - as a scene, which Gmax can open, or you can export it as a mdl. You have to select the existing Aurora Base -the little blue rectangle underneath the room model.

Also which Mesh Settings? The one on the right, which I have open in the screenshots, or the one on the NwMax console, on the left-hand side, where you click ResetXForm?

Miltiades
11-01-2006, 02:10 PM
Oh, yes, I found it.

About the model itself, I delete a whole bunch of those blue things, but parts of the objetc is still there. Together with the poles, which apparently doesn't have much of those little thingies.

Darth InSidious
11-01-2006, 02:40 PM
There may be bits which you need to select separately...

Try rotating your view or using a different viewport to find one where you can select those bits...

Miltiades
11-01-2006, 07:32 PM
After a lot of fiddling, I have finally deleted the part I wanted to delete. However, I think it will still be in vain. The object will be removed, but I doubt it'll be possible to walk on that place.

Darth InSidious
11-02-2006, 06:30 AM
Not without .WOK editing. Which is still very rudimentary...

Also, beware, the lightmaps may be screwy as a result of your editing...

Miltiades
11-02-2006, 06:57 AM
Well, I think I made a mistake in saving, because the .mdl file has another name than the original and when I hex-edit, there's only numbers, no more texture names to be seen. I think it's best to put this aside and go on with what is certain to work. For the time being, I'll work around this problem.

I only have to find a way to have a one-to-one fight on the Bridge of the Harbinger and having enough space to do it.

Anyway, still have a question: Because the module 152Har isn't supported by the Module Editor in Kotor Tool, I'll need to do everything manually. Like placing items on certain places, using the Where_Am_I armband. Could it be that some placeables don't ork, because I wanted to place a Terminal somewhere, but it didn't spawn. I used the plc_comppnl file. Also, I'm not sure what to type in in the 'Bearing' field of a placeable in the .git file.

stoffe
11-02-2006, 07:13 AM
Could it be that some placeables don't work, because I wanted to place a Terminal somewhere, but it didn't spawn. I used the plc_comppnl file. Also, I'm not sure what to type in in the 'Bearing' field of a placeable in the .git file.

Should work. Make sure you set the Z coordinate properly or the placeable might end up below the floor or above the ceiling. Unlike creatures a placeable can be placed anywhere in an area, even in "the void" outside the area model.

If I remember correctly the whereami armband should calculate bearings for you, though it's not completely accurate for all areas for some reason. If I remember correctly you get it by doing something like (Angle - 90.0) * (PI / 180.0), but that's from memory so it's most likely wrong. :)

Miltiades
11-02-2006, 07:40 AM
Oh, I think that'll be the problem. I just copied the Bearing number from another item. :lol:

Edit: Two more questions:

-Is it possible with the Module Editor to place custom made NPCs in a module?

-Some lights in the module are off. How can I turn these on?

Darth InSidious
11-02-2006, 02:06 PM
What do you mean, 'off'?

Miltiades
11-02-2006, 02:37 PM
Heh, yeah, I know, it sounds stupid. I mean, in the Harbinger, you got like two sorts of lights. The flickering red lightbulbs, and the yellow lines. It's the yellow that are sometimes off.

Here's a picture with the lights on:

http://i141.photobucket.com/albums/r43/Speedhawk7/inv_1.jpg

And off:

http://i141.photobucket.com/albums/r43/Speedhawk7/inv_2.jpg

Darth InSidious
11-02-2006, 03:52 PM
Looks like it's to do with lightmaps...in which case, nothing that can be done, AFAIK :(

Sorry :(

Nice retexture though :)

I was gonna ask you to post some screenshots ;)

Miltiades
11-02-2006, 05:23 PM
Aww, that's too bad. Anyway, glad you like the retextures.

Still have a question though: I've placed a few placeables in module 152HAR, which isn't supported in the Module Editor. This means I had to place them manually, using the Where_Am_I Armband and fiddling in the .GIT file. The problem is, the placeable isn't facing to where it should, although when I was using the armband, I was facing correctly, and I filled in the number in the bearings field correctly.

Darth InSidious
11-03-2006, 05:33 AM
Some placeables go about 90 degrees off. Try facing to the right or to the left of where you were before, and using those bearings.

Also, make sure you are using the latest version of the Wherami armband...

Miltiades
11-03-2006, 06:27 AM
Yep, that did the trick. Thanks. :)

One last question (I hope): I've succesfully placed some force cages. When closed, how can I make them go open if I want to open them with a terminal?

Tupac Amaru
11-03-2006, 07:56 AM
One last question (I hope): I've succesfully placed some force cages. When closed, how can I make them go open if I want to open them with a terminal?They are turned off and on by having the cage play its open and close animation:
// Turn off force cage.
AssignCommand(oForceCage, ActionPlayAnimation(ANIMATION_PLACEABLE_OPEN, 1.0, 0.0));
// Turn on force cage again.
AssignCommand(oForceCage, ActionPlayAnimation(ANIMATION_PLACEABLE_CLOSE, 1.0, 0.0));You should also destroy the force cage blocker if you have used one. In case you want to have sound effects as well, that should be done with sound objects. The blueprints can be found in 208TEL (elc_holding_cell.uts and elc_holding_off.uts).

Miltiades
11-03-2006, 08:11 AM
Is the blocker necessary, what exactly does it do?

And I have a little problem with the cages. I have placed 4 of those in a room, and used the same .utc file for all four (which shouldn't be a problem). The cages should be locked, but only one of them is locked. How can that be?

Tupac Amaru
11-03-2006, 08:36 AM
The blocker is an invisible placeable that prevents passage. It's not required, but looks more realistic. Without it, any character can freely go through the activated force field of the cage which kind of beats its purpose. :) The template name is plc_forcecageblk, its tag is ForceCageBlocker. It should be placed near the location of the cage itself and has to be manually destroyed when the cage is open.

Miltiades
11-03-2006, 09:08 AM
What's the difference between this and just locking the cage by editing the .utc file (which is fairly easy with Kotor Tool)?

Tupac Amaru
11-03-2006, 10:11 AM
Does that really block passage? It didn't work when I tried this.

Miltiades
11-03-2006, 10:26 AM
No, it didn't. The NPC who was standing in it, and blocked the way. That's why the other cages where not locked. The ForcecageBlocker worked though.

Anyway, I'm not a scripter, so how to implement a the line to open a shut off a cage is beyond me. I tried searching in another module for such a script, but couldn't find any.

stoffe
11-03-2006, 10:55 AM
Anyway, I'm not a scripter, so how to implement a the line to open a shut off a cage is beyond me. I tried searching in another module for such a script, but couldn't find any.

A script like this could probably be used to toggle the state of a force cage like an on/off switch. Replace the part in yellow with the tag of the Force Cage in question:


void main() {
object oCage = GetObjectByTag("MyForceCage");
int bActive = GetLocalBoolean(oCage, 140);

// Cage is active, turn it off...
if (bActive) {
AssignCommand(oCage, PlayAnimation(ANIMATION_PLACEABLE_OPEN));
DestroyObject(GetNearestObjectByTag("ForceCageBlocker", oCage));
SetLocalBoolean(oCage, 140, FALSE);
}
// Cage is inactive, turn it on...
else {
AssignCommand(oCage, PlayAnimation(ANIMATION_PLACEABLE_CLOSE));
CreateObject(OBJECT_TYPE_PLACEABLE, "plc_forcecageblk", GetLocation(oCage));
SetLocalBoolean(oCage, 140, TRUE);
}

}


If you have sound objects playing a humming sound when the force fields are active you can make it stop and restart as well by adding SoundObjectPlay() and SoundObjectStop() function calls with the sound object as parameter.

Note the probably since this is untested, but in theory it should work. :)

Miltiades
11-03-2006, 11:09 AM
And I can just put the SoundObjectStop () under the SetLocalBoolean(oCage, 140, FALSE), and it should work?

And to have to cage shut off via a terminal, I just have to attach this script to a dialog? And if I don't want the cage to be turned on agin, can I safely remove the second part of the script?

stoffe
11-03-2006, 11:48 AM
And I can just put the SoundObjectStop () under the SetLocalBoolean(oCage, 140, FALSE), and it should work?

And to have to cage shut off via a terminal, I just have to attach this script to a dialog? And if I don't want the cage to be turned on agin, can I safely remove the second part of the script?

Another version that uses sound objects and is meant to be used from a dialog. On the dialog node you assign the script as action script, set the P1 parameter to 0 to turn the cage off, or to 1 to turn the cage on, and the String Param parameter to the tag of your force cage.

This script makes the assumption that the sound object is placed very near the force cage. No changes to the script itself should be needed since you set the necessary data as parameters in the dialog node.


void main() {
object oCage = GetObjectByTag(GetScriptStringParameter());
object oSound = GetNearestObject(OBJECT_TYPE_SOUND, oCage);
object oFF = GetNearestObjectByTag("ForceCageBlocker", oCage);

if (GetScriptParameter(1) == FALSE) {
SoundObjectStop(oSound);
AssignCommand(oCage, PlayAnimation(ANIMATION_PLACEABLE_OPEN));

if (GetIsObjectValid(oFF) && (GetDistanceBetween(oCage, oFF) <= 1.0))
DestroyObject(oFF);
}
else {
SoundObjectPlay(oSound);
AssignCommand(oCage, PlayAnimation(ANIMATION_PLACEABLE_CLOSE));

if (!GetIsObjectValid(oFF) || (GetDistanceBetween(oCage, oFF) > 1.0))
CreateObject(OBJECT_TYPE_PLACEABLE, "plc_forcecageblk", GetLocation(oCage));
}
}

Miltiades
11-03-2006, 03:26 PM
Got a little problem with that. There are four cages which all bare the same name, tag, resref, everything. So I made (read: copied :) ) the script and attached it to my dialog. Result: Only one cage was turned off. On top of that, the sound didn't work, but that's normal because I haven't included the sound file in the .mod. But I don't know what sound file I have to include, because it should be the same as in the script, though I don't see any reference to a sound file in the script.

stoffe
11-03-2006, 04:15 PM
Got a little problem with that. There are four cages which all bare the same name, tag, resref, everything. So I made (read: copied :) ) the script and attached it to my dialog. Result: Only one cage was turned off.


So give the four placeable cages unique tags? :) That's the easiest solution IMHO, since you will need some way to uniquely identify each one if you are going to operate them independently. Sure, you could iterate through all objects with the same tag in the area, but then you'd need to keep track of in which order they are listed. Just giving each an unique tag is much easier.



On top of that, the sound didn't work, but that's normal because I haven't included the sound file in the .mod. But I don't know what sound file I have to include, because it should be the same as in the script, though I don't see any reference to a sound file in the script.

The script is working with a sound object, not a WAV or MP3 file directly. Sound objects are essentially sound emitters, placed in a specified location within an area and are created from .UTS template files. The .UTS files then keep track of things such as looping, sound volume, pitch, sound radius and which WAV/MP3 file(s) should be played. If you aren't familiar with how to create one I'd suggest opening one of the modules with existing force cages and grabbing the relevant .UTS file from there to use in your own module.

The script grabs the sound object closest to the specified force cage and makes it start/stop playing its sound. Thus it doesn't matter what the sound object is called, so long as it's placed in the same spot as the force cage it belongs to (which it should be anyway since the sound will seem to come from that location).

Darkkender
11-03-2006, 04:26 PM
I know this is detouring the thread in a miniscule fashion but has anybody thought about trying the new NWN Toolset that ships with NWN2 for the SWK area models? The reason I ask is because from all of the screenshots I've seen of NWN2 it looks like it is using 3d graphics that are about on par with the SWK games. I haven't had a chance to try it myself yet as I'm lacking Win XP untill I break down and buy it in a week.

Miltiades
11-03-2006, 07:31 PM
So give the four placeable cages unique tags? :) That's the easiest solution IMHO, since you will need some way to uniquely identify each one if you are going to operate them independently. Sure, you could iterate through all objects with the same tag in the area, but then you'd need to keep track of in which order they are listed. Just giving each an unique tag is much easier.

The problem with that is that I would need four different scripts, and if I want the cages to be turned off simultaneously, how can I have the four scripts to be activated in that one dialog node, which has only space for 2 scripts?


The script grabs the sound object closest to the specified force cage and makes it start/stop playing its sound. Thus it doesn't matter what the sound object is called, so long as it's placed in the same spot as the force cage it belongs to (which it should be anyway since the sound will seem to come from that location).

Okay, thanks.

stoffe
11-03-2006, 07:38 PM
The problem with that is that I would need four different scripts, and if I want the cages to be turned off simultaneously, how can I have the four scripts to be activated in that one dialog node, which has only space for 2 scripts?


Ah, why didn't you say so earlier? ;) I thought you wanted a control panel type of dialog where you could turn on/off cages individually. Here is another variant of the same script that will go through all force cages with the specified Tag in the area and turn them on/off.
void main() {
string sTag = GetScriptStringParameter();
object oCage = GetObjectByTag(sTag);

int iIdx = 0;
while (GetIsObjectValid(oCage)) {
object oSound = GetNearestObject(OBJECT_TYPE_SOUND, oCage);
object oFF = GetNearestObjectByTag("ForceCageBlocker", oCage);

if (GetScriptParameter(1) == FALSE) {
SoundObjectStop(oSound);
AssignCommand(oCage, PlayAnimation(ANIMATION_PLACEABLE_OPEN));

if (GetIsObjectValid(oFF) && (GetDistanceBetween(oCage, oFF) <= 1.0))
DestroyObject(oFF);
}
else {
SoundObjectPlay(oSound);
AssignCommand(oCage, PlayAnimation(ANIMATION_PLACEABLE_CLOSE));

if (!GetIsObjectValid(oFF) || (GetDistanceBetween(oCage, oFF) > 1.0))
CreateObject(OBJECT_TYPE_PLACEABLE, "plc_forcecageblk", GetLocation(oCage));
}

oCage = GetObjectByTag(sTag, ++iIdx);
}
}


Same dialog parameters as before, i.e. P1 determines if the cages should be turned on(1) or off(0), and String Param should be set to the Tag of the cage(s).

Miltiades
11-03-2006, 07:48 PM
Oh, goody! :) Thanks. How you people can understand these scripts is beyond me.

Anyway, compiling with Kotor Tool doesn't seem to work. It says the nwnnsscomp.exe isn't in the same folder as KT. I tried it when I saw it was possible with KT.

@darkkender: Is that possible? NWN2 is using a new engine, isn't it? Or doesn't that change a thing?

Darkkender
11-03-2006, 08:29 PM
@darkkender: Is that possible? NWN2 is using a new engine, isn't it? Or doesn't that change a thing?

I don't know since I can't even fake it on my computer by changing registry entries I can't get it to install. I was looking at the graphics and how similiar they seemed to the SWK games that I was thinking maybe the Model format is closer to SWK. Since modding has never been officially supported that means there are elements like the model format that might be compatible between the 2 games that they just won't or can't mention for legal reasons. Maybe I'm just being hopeful that some of our dedicated modders would try to break it open to see if anything can be useful to us. Especially since the SWK 1 engine was a 3d upgraded version of NWN and the SWK 2 game developed by OE was an upgraded version of SWK 1 when it comes to the models and some of the other graphics. I figure maybe they used a new name on it for NWN2 as a way of protecting there legal rears from Lucasarts.

Miltiades
11-04-2006, 09:10 AM
I'll get my copy of NWN2 soon, but I'm no expert at these kind of things. I'll keep my eyes open though.

Anyway, I've got another question. I want to start from another location in the module than normal. With a map that is supported by KT, it isn't that difficult. But I can't seem to make it work.

stoffe
11-04-2006, 09:22 AM
Anyway, I've got another question. I want to start from another location in the module than normal. With a map that is supported by KT, it isn't that difficult. But I can't seem to make it work.

You can set the default starting location within a module in the module.ifo file by setting coordinates in the Mod_Entry_X, Mod_Entry_Y and Mod_Entry_Z fields. You can set which way the player faces when they enter the area by putting a direction vector in the Mod_Entry_Dir_X, Mod_Entry_Dir_Y and Mod_Entry_Dir_Z fields as well.

Miltiades
11-04-2006, 09:54 AM
Didn't work. It still starts from the original starting location. Maybe I have to add/delete a waypoint or something?

Edit: Wait. It did work, after I deleted all waypoints. Thanks ;)

Miltiades
11-04-2006, 05:23 PM
Okay, little problem. All NPCs I've placed in my module all look in exactly the same direction, although almost every orientation number is different. I tried both in the X-Orientation and Y-Orientation field. Can't seem to find what I've done wrong.

Darth InSidious
11-04-2006, 05:51 PM
The Orientation number has to be made into two numbers - the X-Orientation and the Y-Orientation. Unfortunately, I have no idea which is which, myself...

stoffe
11-04-2006, 06:07 PM
Okay, little problem. All NPCs I've placed in my module all look in exactly the same direction, although almost every orientation number is different. I tried both in the X-Orientation and Y-Orientation field. Can't seem to find what I've done wrong.

What values have you been using in the X and Y orientation? As far as I know you do not specify the angle here directly, but rather a directional vector of a kind, from which the angle is derived. The range of values in those two fields go from -1.0 to 1.0.

Imagine a coordinate system, where the character sits in the center. To specify which way they face, you specify a point on this coordinate system (where the character should face), where the Y value is the north facing and X value is the east facing. So for each basic 90 degree direction you get something like:

X Y Facing
--- --- -------------
0.0 1.0 = North
1.0 0.0 = East
-1.0 0.0 = West
0.0 -1.0 = South


And with this in mind you get 45 degree directions something like:

X Y Facing
--- --- -------------
1.0 1.0 = NorthEast
1.0 -1.0 = SouthEast
-1.0 1.0 = NorthWest
-1.0 -1.0 = SouthWest


From this you get your exact facing by specifying a relation between N/S and E/W in the X and Y fields. See the attached image for an example, if you want the character to face slightly to the northnorthwest (the blue line marks the facing direction), you could set the values (x,y) to -0.5, 1.0 (the red dot represents the character):

(I don't know the proper math terms in English, but hopefully you can understand what I mean :))

Miltiades
11-04-2006, 06:33 PM
Oh, I used the orientation number that appeared when using the 'Where Am I' armband. This is much easier, IMO. Thanks. (I immediately thought of Trigonometric, and I've got some bad memories of it :p)