Kexikus 994 Posted December 19, 2017 I'm currently trying to add a new model to an area, but for some reason that doesn't really work at all and I can't figure out where I'm going wrong. So I'll just tell you what I did and maybe someone can tell me where the issue comes from. First of all I created the model in 3ds Max obviously. Then I used KOTOR Max to create an Odyssey Base, named it 504ONDk (the intended model name), placed it at 0,0,0 and set it's type to "other". Later I also tried "effect" as that's apparently the type of the skybox in this module but that changed nothing. Next I added the Odyssey Trimesh modifier to my model, trying both with the model being converted to an Editable Mesh and without that step, in both cases applying a "Reset X Form" before adding the modifier. Finally I linked my mesh as a child to the base and exported the geometry only. Then I opened the ASCII in mdledit and saved it as a binary file. To get it ingame, I opened the .lyt and .vis file of my module (504OND) and added my model to them. In the .lyt, I added it to the room list with coordinates 0,0,0 (and later other coordinates as well) and also increased the room count by 1. In the .vis I added it to every room, once again increasing the number of adjacent/visible rooms by 1 each time. I also added itself as another room at the very end with no visible rooms, as you won't enter that room ingame and it's only background. Then I dropped the 504ond.lyt, 504ond.vis and my 504ondk.mdl/.mdx into the Override and saw nothing. No changes at all. I thought that maybe I need to load an older save where I had not entered the module before, so I did that and still saw no changes. As I didn't know where the problem comes from, I tried to determine whether it's in the model itself or in the .lyt/.vis by hex-editing my binary model to be 504ondc instead. I also renamed the files accordingly and dropped them into my Override. And now the model actually appeared, but only when I'm inside the (now invisible) original room 504ondc. So I tried replacing some other models and the same thing happened. That left me somewhat confused as I've no idea what's causing this but I figured that I probably screwed something up in the process of getting my model from Max to the game. So I compared it's ASCII to the ASCII of a similar model, the skybox of the same module, namely 504ondg. There I saw that the skybox models type is "effect" which is why I tried changing that but that made no difference. I also noticed that the skybox has a walkmesh. So I copied its walkmesh over to my model, changed the supermodel and created the binary. But my model still wouldn't show up ingame. So once again, I renamed it to another model and there it was in all its glory, visible from all rooms. But now it moves sometimes when going from one room to another... And that leaves me with the conclusion that I really don't know what I'm doing and need some help instead. Thank you very much Quote Share this post Link to post Share on other sites
DarthParametric 3,777 Posted December 19, 2017 Remember from your adventures with the Ravager models that MDLEdit appears to require all meshes in a level model to be children of a dummy object, which is itself a child of the AuroraBase. It doesn't appear to like meshes being direct children of the AuroraBase. Also, how big is your object? Is it smaller or bigger than the existing skybox (504ONDg)? Because world 0 is probably the wrong position, judging by looking at the whole level. 504ONDc is roughly in the middle of the layout, so I would duplicate its co-ords in the LYT for your model. That is assuming you want your object centered to the level of course. Quote Share this post Link to post Share on other sites
Kexikus 994 Posted December 19, 2017 Right. I remember needing that dummy. I'll add that once I get back to working on this and see what it changes. And my object is smaller than the skybox. Otherwise I wouldn't be able to see it when I use it as a replacement for a vanilla model. And you're right, world 0 is the wrong position but I currently don't exactly care about that as long as it appears somewhere (which it doesn't). Edit: I got it to work by importing another model (504ONDg) and using its Odyssey Base and Walkmesh. In addition to that, I also added a dummy object as child to the base and then linked all my meshes to that one. Quote Share this post Link to post Share on other sites
DarthParametric 3,777 Posted December 20, 2017 Hrm, there's certainly something odd going on there. I just encountered mesh visibility issues with a placeable I was making as well. It was exactly the same thing. Putting everything inside dummy objects solved the problem (even though the vanilla model had everything as direct children of the OdysseyBase). And even then, it seems like it is extremely picky about order in the hierarchy. I split the animated and static objects into two different dummies. In order for the animated objects to be visible, their dummy must be above the static object dummy. Bizarre. Ideally, this thread should probably be merged into the MDLEdit bug report thread, so bead-v sees it upon returning from the Outer Rim. Quote Share this post Link to post Share on other sites
bead-v 251 Posted December 23, 2017 so bead-v sees it upon returning from the Outer Rim. I see it through the Force. Any chance I could get your files, Kex? All of them, the initial version, the working version, ... DP, you too with the mesh visibility stuff.. Quote Share this post Link to post Share on other sites
DarthParametric 3,777 Posted December 23, 2017 My issue was twofold. One is apparently an inherent engine issue related to rendering objects behind a texture with transparency, as I describe in this thread. The other I am still uncertain on. The symptom was that same issue, but the cause appeared to be some polys on one side of the object not being set up properly. I have yet to check if this is an inherent issue in the vanilla model, or something resulting from decompiling. The model in question is K1's PLC_KolTank2 if you want to check it yourself. Edit: Oh yeah, I forgot about the hierarchy thing. That was a version of that same model. But yeah, the whole nothing as direct children of the OdysseyBase thing is clearly a compiler problem, as pretty much no vanilla model obeys that rule. The specific problem I had was all the animated bits under one dummy, and everything else under a second dummy. It wouldn't render the animated meshes unless its dummy was above the other in the hierarchy. I don't have a model of the original version any more, but you can experiment with adding the contents of the vanilla one to various dummies. 1 Quote Share this post Link to post Share on other sites
Kexikus 994 Posted December 23, 2017 Any chance I could get your files, Kex? All of them, the initial version, the working version, ... My WIP folders are usually quite a mess but I'll see what I can dig up in the coming days and will send it to you. Edit: I checked my files and for some reason all of them are working now. It seems like the cause of my issue was only the missing walkmesh and possibly not having a dummy between the Odysseybase and the meshes. No idea why the model where I manually added the walkmesh to the ASCII didn't quite work out back then because it does now. Sorry for all of the confusion. 1 Quote Share this post Link to post Share on other sites
Kexikus 994 Posted December 26, 2017 And I'm stuck again. I tried adding lightmaps to my area model following Quanons tutorial. I noticed that I had to set the Aurora trimeshes to be "lightmapped" before rendering the texture but now I have a lightmap texture that looks pretty good. The problem is: It doesn't show ingame. I'm using MDLEdit and KOTORMax of course and they seem to handle lightmaps just fine when decompiling and recompiling a vanilla model. I even compared a decompiled vanilla model with my model and as far as I can tell, everything for the lightmap is present in my model. My files (Max scene, ASCII model, binary model and lightmap texture) are attached to this post and I'd appreciate any help in getting these to work. Lightmap Issues.zip Quote Share this post Link to post Share on other sites
DarthParametric 3,777 Posted December 26, 2017 Have you tried moving the walkmesh into the dummy? Everything else looks fine, aside from your mat override values, which are set at mid-grey. Change those to white. Edit: Also you have self-illum set at max. That could just be overblowing everything. Set that to black. Quote Share this post Link to post Share on other sites
Kexikus 994 Posted December 26, 2017 Have you tried moving the walkmesh into the dummy? Everything else looks fine, aside from your mat override values, which are set at mid-grey. Change those to white. Edit: Also you have self-illum set at max. That could just be overblowing everything. Set that to black. Setting the self-illum values to black fixed the issue. Thanks. No idea why the mat values are at mid-grey though. That is the same value used in the vanilla 504ond models though, so I'll probably keep it. Quote Share this post Link to post Share on other sites
DarthParametric 3,777 Posted December 26, 2017 By default Max sets all new materials to have a mid-grey diffuse. If you don't change that before exporting, and don't enable the override in the trimesh settings, then KOTORMax will set the override at the material's current setting. Quote Share this post Link to post Share on other sites