General Barron 0 Posted August 5, 2005 Hey all, I want to take a .p3d model (a weapon in this case) from one addon, and put it into my own addon (with permission of course). I've had some success with this in the past, but I think it was with MLOD models. Now I'm trying with ODOL, and I'm having trouble. Here is what I'm doing: ------ 1) Convert original .p3d model from MLOD->ODOL via OdolExplorers 2) Move model and appropriate textures into my addon 3) Use texture swapping utility to change texture paths from old addon to my addon 4) copy all relevant portions of old config.cpp to my config.cpp (changing classnames to avoid conflicts) 5) .pbo it up and try to use the weapon -------- The problem is, when I try to add the weapon in a mission, I get an error that says the .p3d has an unsupported version (216535 or something insane). What am I doing wrong? The config should be working fine, because I ran into and solved a lot of little config errors before I got the above error. Do I have to binarize the model again? If so, I have no idea how to do it, because I couldn't seem to get binarize to work. Any help is greatly appreciated . Share this post Link to post Share on other sites
raedor 8 Posted August 5, 2005 did you try loading the model in o2, saving, packing pbo? after working with external tools on p3ds it helps sometimes. Share this post Link to post Share on other sites
General Barron 0 Posted August 5, 2005 did you try loading the model in o2, saving, packing pbo? after working with external tools on p3ds it helps sometimes. Nope. I'll have to try that out, although I've never used o2 before... Share this post Link to post Share on other sites
korax 4 Posted August 5, 2005 As someone who's done alot of this, I can say that the easiest way is to download the shareware version of search and replace, which will let you change the texture paths while the model is still in ODOL form (doesnt always work in MDOL). If you still get some sort of error, open the model in O2 and hit CTRL-A (select all) and F5 (recalculate normals) in every LOD. (that fixed a few errors for me) Share this post Link to post Share on other sites
sanctuary 19 Posted August 5, 2005 If the addon is in ODOL format, you don't need to convert it back to MLOD (i suppose you used ODOL Explorer ? : it will make some bad things with the selections with most of the re-converted in MLOD addons (so basically you will have to correct this yourself in O2)) With your ODOL .p3D, you have two possibilites that i used myself without any problems. You can use , instead of TexPathSwap the program P3D Texture Swap Utility v1.0.2 , it does the same as TextPathSwap for MLOD , but for ODOL . Another alternative , and it is what i use now as i find it a lot quicker, but -only with ODOL models- (it will lead into lots of errors if used for MLOD models) is to open the .p3d with the excellent sourceforge text editor Notepad++ and use the Replace tool, like if you wanted to replace words in a word document , this way you can re-assign in no time new texture paths. But P3D Texture Swap Utility v1.0.2 stay very good when you need to know the texture paths with the ODOL models, but for replacing it is better to use Notepad++ Share this post Link to post Share on other sites
raedor 8 Posted August 5, 2005 as we are speaking about replace tools, here are two more: this tool by vektorboson replaces the entire path before the texture's names. problem: textures in subdirectories. but if you don't use subdirectories, this tool is perfect. this tool by feersum.endjinn replaces single texture paths but in all LODs. very useful if you want to change a certain texture. but the problem of General Barron seems to be something else, as he already has converted the paths. Share this post Link to post Share on other sites
sanctuary 19 Posted August 5, 2005 Actually, his problem is that : Quote[/b] ]1) Convert original .p3d model from MLOD->ODOL via OdolExplorers (in fact he should have wrote : Quote[/b] ]1) Convert original .p3d model from ODOL->MLOD via OdolExplorers Because for a lot of model, converting an ODOL model in MLOD with ODOLexplorer will create problems with the selections. While for some p3d , it has never made any problems for me, i ran into some addons where it leads finally to some errors after in OFP. And i already met this error with such kind of models Quote[/b] ]the .p3d has an unsupported version So the best solution, when you have an ODOL model and want to rexture it , or repath it is to make the work without converting it back to MLOD format. Share this post Link to post Share on other sites
General Barron 0 Posted August 8, 2005 Err..... oops. I should point out that I know nothing about modelling, so bear with me. Quote[/b] ]1) Convert original .p3d model from MLOD->ODOL via OdolExplorers Um... I think I got the formats swapped up here. ODOL is the encrypted/binarized version that addons are usually distributed in, right? ------- The last time I did this whole texture swapping bit, I ended up opening the file up in Textpad and just find/replacing all of the filepaths. It worked fine for most things, but on some models it didn't work at all. I'm not sure about the format of which models was which, but I assumed that it was ODOL models that were messing up. That is why I tried converting the model, and then using feersum.endjinn's texture swapping utility. I'll try the whole thing over again with just find/replacing on the original model and see what happens. Share this post Link to post Share on other sites
sanctuary 19 Posted August 8, 2005 With the sourceforge program notepad++ i never had any errors when making path replacement using the replace feature of this text editor. I can't be as sure for other text editor. -But that's true only with ODOL models (the binarized models)- Using notepad++ with MLOD models -will- create errors ingame. The only solution i can guarantee 100% for having using it myself for -MLOD- models (not binarized ones) is TxtPathSwap as it has been already said (never had myself any error with it + MLOD models) Share this post Link to post Share on other sites
General Barron 0 Posted August 8, 2005 YES! It worked! I just edited the original model with Textpad (same type of program as Notepad ++) and everything worked like a dream. Thanks for the info though, I didn't know about the difference between the model types. That must have been my problem in the past! Now, for dummies like me, here is what I've learned: For models in ODOL format (binarized--says "ODOL" at top of file when opened in Textpad) Find/replace the texture paths For models in MLOD format Use txtswap utility linked here. Thanks for the help! Share this post Link to post Share on other sites
vektorboson 8 Posted August 14, 2005 Some additional advice from me: If you don't know anything about modelling in O2, then don't convert the ODOL-files to MLOD-files, since this will mess up the normals, it will mess up the Userdata for faces, (Tanks won't turn dark when damaged) and it will mess up the lighting (some faces will be fully lighted). Best'd be to replace the textures just with a HexEditor (or any other editor which understands binary files), like done here. Replacement in MLOD-files isn't trivial because the texture paths have a fixed length (32 characters! and every face keeps a copy of the texture path. Share this post Link to post Share on other sites
SelectThis 0 Posted August 16, 2005 Following on from vektorboson said, you can use a hex/texteditor (my preference is Ultraedit) on both ODOL and MLOD p3ds. The thing to remember is this: For MLOD do not change the number of characters in the path name. eg: Original texture path: data\drevo_dirkate.pac (18 char not counting the suffix) edited texture path mypbo\afolder\texa.paa (18 char not counting the suffix) For ODOL, you can change the number of characters. SelectThis Share this post Link to post Share on other sites
ardvarkdb 104 Posted June 26, 2006 I used the hexediting method for changing some texture paths and it worked fine but when I start up a game I get a box popping up saying it can't find a texture using the old texture path name, yet all the names in the .p3d file have been changed. I know Sanctuary said that this method can create errors ingame and I was wondering if anyone know how to solve this problem Share this post Link to post Share on other sites
berghoff 11 Posted June 27, 2006 I had this to with my trees either save file in o2 or build new one. Share this post Link to post Share on other sites