Guest cornel Posted February 15, 2016 Has anyone tried to modify the main menu? I've searched but could not find an existing mod (to serve as an example) that contains modified mainmenu01.mdl or mainmenu.gui files... I would like to replace the menu's Sion model for a jedi master, or (if that's too complicated) simply remove the sith character model completely... I tried to put an edited mdl file in the override folder, but that would result in a main menu without the model and without the background (which is a shame 'cause I made a nice new background...), and even placing an unmodified (!) mainmenu01.dlm file in the override folder will result in a background-less and character-less menu... Is there any other file that specifies what can be seen in the main menu screen and which I could edit? Note: I have not been able to open (and edit) the .gui files, so i have no idea what they contain... Quote Share this post Link to post Share on other sites
DarthParametric 3,785 Posted February 15, 2016 I think the Revenge of Revan mod managed it, didn't they? Presumably they managed to compile a new model with a replacement character. Perhaps Logan23 or redrob41 could chime in with some specifics. The mod has its own sub-forum here. Maybe you could ask in the "Ask the Developer of Revenge of Revan....a Question" thread. http://deadlystream.com/forum/forum/5-revenge-of-revan/ Quote Share this post Link to post Share on other sites
DarthRevan101 104 Posted February 15, 2016 There was a mod that did this: Although I can only find a picture of it, it seems it is possible to edit the main menu in such a way. Quote Share this post Link to post Share on other sites
Kexikus 995 Posted February 15, 2016 Editing .gui files is possible with gff editors like KGFF: http://www.lucasforums.com/showthread.php?t=149407. You can't add fields to it though (I think), but you can move and scale pretty much everything that's seen in the GUI. For changing the model, I'd guess that there is a special model for the character that's used only in the main menu. I don't know which one though Quote Share this post Link to post Share on other sites
1Leonard 134 Posted February 15, 2016 There was a mod that did this: Although I can only find a picture of it, it seems it is possible to edit the main menu in such a way. That's not original, that's a piece of unrestored content originally made by Obsidian. Quote Share this post Link to post Share on other sites
Guest cornel Posted February 15, 2016 Thank you very much for this info! I'll check out the mod and the forum Quote Share this post Link to post Share on other sites
DarthRevan101 104 Posted February 15, 2016 That's not original, that's a piece of unrestored content originally made by Obsidian. Oh okay, thanks for telling me. Quote Share this post Link to post Share on other sites
1Leonard 134 Posted February 15, 2016 Oh okay, thanks for telling me. No prob. Quote Share this post Link to post Share on other sites
Fair Strides 509 Posted February 15, 2016 mainmenu_01.mdl and .mdx = Sion mainmenu_02.mdl and .mdx = Darth Traya (cut appearance) mainmenu_03.mdl and .mdx = Darth Nihilus mainmenu_04.mdl and .mdx = Darth Traya (in-game appearance) mainmenu_05.mdl and .mdx = Blank (place left for main character's model) mainmenu_06.mdl and .mdx = Restored extra with Darth Nihilus, the Twin Suns, and the Cannok However, I need to rip some code from KAurora for use with MDLOps before editing these would even be viable. IF ATTEMPTED WITH MDLOPS: - No fog or lights IF ATTEMPTED WITH KAURORA: - No animations And right now, it'd be easier to rip the Emitter and Light info from KAurora than to figure out why KAurora screws up the animations. Quote Share this post Link to post Share on other sites
DrMcCoy 40 Posted February 16, 2016 You can't add fields to it though (I think) Yes. The menu code in the executable is quite hard-coded. The game basically knows how the menus are laid out, i.e. which buttons and other widgets exist. It creates the general layout, and then only looks into the GUI GFF for details, like color and size. Quote Share this post Link to post Share on other sites
Guest cornel Posted February 16, 2016 Wow, so much info... thank you guys!!! @ Fair Strides: I had also discovered the different menus, but the fifth didn't show my character, it stayed without a model. How can I get my own character in the menu? @DrMcCoy: the GUI GFF you refer to is that the "mainmenu.gui" file? Quote Share this post Link to post Share on other sites
Fair Strides 509 Posted February 16, 2016 Wow, so much info... thank you guys!!! @ Fair Strides: I had also discovered the different menus, but the fifth didn't show my character, it stayed without a model. How can I get my own character in the menu? @DrMcCoy: the GUI GFF you refer to is that the "mainmenu.gui" file? If you'll look, I said there was a "place left for main character's model", not that the model itself was there. The game is hard-coded to make your model appear using settings from the .ini file to determine the model, and according to the CurSithLord entry in the .ini file (I think 4 makes your character show up). But all that is K2-exclusive. Quote Share this post Link to post Share on other sites
DrMcCoy 40 Posted February 16, 2016 Well, my KotOR2 has several main menu GUI files: mainmenu10x7_p.guimainmenu12x9_p.guimainmenu16x12_p.guimainmenu8x6_p.guimainmenu_p.gui Which of them are loaded depends on your resolution. There's also mainmenu_x.gui and mainmenu8x6_x.gui, which, I guess, might be for the Xbox versions. Quote Share this post Link to post Share on other sites
Guest cornel Posted February 16, 2016 @ Fair Strides: That's a nice tidbit of info, you just shared here! I tried the ini setting "4" just to test it, and indeed: my character appeared in the menu. A shame that it's K2 exclusive... @ DrMcCoy: Yeah, I also saw that, and found out that with a custom wide-screen patch the 800x600 menu is used. I'm trying out how to change the color of the buttons and text (want them starwarsy yellow lol). Quote Share this post Link to post Share on other sites
Guest cornel Posted February 17, 2016 So I managed to change the colors of the buttons and button texts, but NOT the color (nor the blinking) during mouse-over! I cannot find the reference for that. It's not the highlighting bit, as I found out. Anyone any idea about that? See this for more info on changing the character on the main menu: http://deadlystream.com/forum/topic/4151-mdx-and-mdl-decompiler-editor-and-compiler/?do=findComment&comment=43082 ... Quote Share this post Link to post Share on other sites
Fair Strides 509 Posted February 17, 2016 You might need to change the texture used for the Hilight on the buttons to one that's yellow. Assuming the Highlight section of the .gui file has had its Color field changed with no result. Also, try setting PULSING to 0 Quote Share this post Link to post Share on other sites
Guest cornel Posted February 17, 2016 In my mainmenu8x6.gui file all PULSING values are already 0... I made a yellow 512x512 pixels tga texture file and referenced the HILIGHT FILL to it, but it just gives a colored bar inside the button, on top of the text. It was worth the try, but I think the blinking and the blink/over color are hard-coded So, what remains is changing the color of the fog (would like that to be white), which seems to be possible, as hinted by DarthParametric... ...and changing the background music (mus_sion.wav). I've added a light-side tune (mus_menu.mp3) to the StreamMusic folder. made a new entry in the ambientmusic.2da and musictable.2da (with reference code 999999), and now I'm looking for a way to link this tune to the main menu... I have not been able to find any mention of music in the gui or mdl files, but I'm probably looking in the wrong files. No clue as to where such a specification could be found... Anyone any idea? Quote Share this post Link to post Share on other sites
Fair Strides 509 Posted February 17, 2016 Here's a picture where all I did was change the Color field for the Hilight on the Load Games button to 1, 0, 0. No other changes were done. This was done on the mainmenu8x6_p.gui file. The doc that I gave you on the GUI sub-sections: read what it says for EDGE and CORNER and then look at the Hilight section again. (You might also need to extract and view the textures with alpha channel turned on as well to get the full idea) Quote Share this post Link to post Share on other sites
Guest cornel Posted February 17, 2016 I have already achieved this... Thank you anyway for going through the trouble! The thing that remained was the color of the text while blinking (at mouse-over)... That's something I apparently cannot change with editing the gui file. Quote Share this post Link to post Share on other sites
Fair Strides 509 Posted February 18, 2016 Ah. It wasn not very clear when you said "So I managed to change the colors of the buttons and button texts, but NOT the color (nor the blinking) during mouse-over!" whether you were referring to buttons, text, or both, so I assumed we'd start with the basics. And there's no entry in the Hilight settings to control the text. As for the music, I think you'll just need to rename your music file to the sion one. Though, I noticed a "mus_main" in the ambient music .2da, so maybe rename your tune to that? Quote Share this post Link to post Share on other sites
Guest cornel Posted February 18, 2016 It's not a biggie, I'm happy with what I have achieved with the menu so far... About the music: I had done that (simply renaming the mp3 file to mus_sion), but after the warning I got from DarthParametric (about changing the Kreia texture for the sake of the menu and thus having a changed character later on in the game) I thought it wise not to change the sion tune, in case it would be called upon later in the game... Or is it only used for the menu? Quote Share this post Link to post Share on other sites
DarthParametric 3,785 Posted February 18, 2016 WARNING: Wall of text incoming. So, following on from part 1 (that I managed to post in the wrong thread, whoops), let us now delve even further into the dank underbelly of MDL hex editing. Finding and changing ASCII strings like textures is pretty basic. To change numerical values for things like the colour of VFX involves a few extra steps. Start by loading the binary MDL into MDLOps and clicking the Read button. When that is done, hit the View Data button. A new window will pop up. You probably want to maximise it to see everything. This is the model data viewer. It gives you a tree view of the model structure, and shows hex chunks for each element along with the specific values for each type of data. Expand the "nodes", well, node I guess. What we are interested in here is the smoke VFX. Based on the names, we can tell that we want to look at the four Fx_PuffySand nodes. Expand "Fx_PuffySand" -> "node_header" and select "controller_data". You'll see the righthand side of the screen populate with that node's data: The middle two windows are the binary data in hex and ASCII, and the far right window is a list of the source values for each particular block of data. You may want to refer to the breakdown of the MDL structure by original MDLOps author Chuck Chargin - https://web.archive.org/web/20151016191416/https://home.comcast.net/~cchargin/kotor/mdl_info.html - but don't worry too much if that's all over your head at the moment. Save it for later use. The important thing to note is that each chunk of data is of a certain length, which varies depending on the format it is stored in. If you recognise certain chunks of data, knowing how long they are may help you find where the specific chunk you are looking for is (you did your homework from the last lesson and Googled hex offsets, right?). At this juncture, it is most likely useful to refer to the decompiled ASCII model. If you find the section starting with "node emitter Fx_PuffySand" and compare it to the data viewer's righthand window, you'll be able to match some of the values and work out what is what. The first four bytes are empty/zero, the next 12 bytes are the position (XYZ) values, then another four bytes of zero value, then the next 16 bytes are orientation (XYZW quaternion). Here we run into one of the vagaries of MDLOps: the decompiled ASCII data doesn't match the binary data. If you spend any time with MDLOps, you'll be seeing this sort of thing a lot. In this instance though it isn't relevant to what we are doing, so we can ignore. Skim over the other values. There are lots of zeros, so we can't tell a lot of these apart. But you can see things like particle rotation, random velocity, and bounce coefficient. But what we are really interested in is colorStart, colorMid, and colorEnd. These are in a Vector3, basically RGB converted to 0-1 values. Fortunately in this case the data is in a convenient format to spot. ColorStart is 0.058823499828577,0.058823499828577,0.058823499828577. We can see three blocks of 12 bytes with repeating 4 byte segments. The first of these is E9F0703D which is equivalent to a float value of 0.0588235 (depending on how many figures you round to), the same as colorStart. Similarly we can confirm that A9D8D83D and CFBC3C3E match colorMid and colorEnd, respectively. So it seems that these are our colour values: Given that the values we are looking for are altogether in a contiguous 48 byte chunk (including 12 bytes of zero value padding): E9F0703D E9F0703D E9F0703D 00000000 A9D8D83D A9D8D83D A9D8D83D 00000000 CFBC3C3E CFBC3C3E CFBC3C3E 00000000 We can note this down as a single string to search for later in a hex editor, like so: E9F0703DE9F0703DE9F0703D00000000A9D8D83DA9D8D83DA9D8D83D00000000CFBC3C3ECFBC3C3ECFBC3C3E00000000 The reason we want that as a single string is that the bigger the chunk, the less likely it is that there will be matching data anywhere else in the file. We only want to edit these specific values, not accidentally overwrite something we shouldn't. Additionally, as you may have guessed from both the repeated values and the actual colour of the smoke in the menu, these are greyscale colours. We'll be using actual colour in this example, which means varying values. It's easier to replace it all in a single find and replace string, and it makes it less likely you'll make errors. We can now continue on with the other Fx_PuffySand nodes, noting their particular hex strings of interest. Fx_PuffySand01 is straightforward: with the string: CFBC3C3ECFBC3C3ECFBC3C3E00000000CFBC3C3ECFBC3C3ECFBC3C3E00000000C7C8C83DC7C8C83DC7C8C83D00000000 Fx_PuffySand02 has zero data values for colorStart and colorMid, but that's not a problem. We can determine from the other nodes that the data chunk we want is located at the same offset, plus it's simply a case of setting the first 32 bytes to zero. Which gives us: 0000000000000000000000000000000000000000000000000000000000000000D0B4343ED0B4343ED0B4343E00000000 And lastly Fx_PuffySand03: Which has zero values for colorStart: 00000000000000000000000000000000838A8A3E838A8A3E838A8A3E00000000D5CD4D3FD5CD4D3FD5CD4D3F00000000 So now we have the info we need from MDLOps, we can move across to the hex editor. But before we do that, we need to work out what colours we want to change the VFX to, and how to convert that into hex. We have four VFX emitters, so I'll choose four different colours just so the differences are obvious. While we are on the subject of colours, you will have noticed that each emitter has three sets of colours, start, middle, and end. This allows for the overall colour to change across the different stages of particle life. Start is when the particle is first emitted, mid during the middle of its lifetime, and end just before extinction. For smoke, you'd typically want the beginning to be dark, then gradually lighten in the mid and end phases before it fades out completely. If you look at the vanilla values, you'll see that's what they do. They start out almost black, then lighten to a mid- to dark grey. The colour is offset by the transparency, but more on that later. So, colour. For Fx_PuffySand colorStart the colour is 0.058823499828577,0.058823499828577,0.058823499828577. To convert this to a typical RGB value, we simply multiply each value by 255. In this instance the values are the same, and multiplying it by 255 gives 14.99999245628714, in other words an RGB of (near as damned) 15,15,15 which is almost black. Using this approach we can also go back the other way. Simply divide all your RGB values by 255. Let's start with a new set of colours for Fx_PuffySand. We'll go with 20,60,100 to begin, 30,100,155 in the midlife, and 50,150,250 at the end. That goes from a dark blue to a light blue. If we divide by 255 we get our Vector3s: 20,60,100 0.07843138,0.2352941,0.3921569 30,100,155 0.117647059,0.3921569,0.6078432 50,150,250 0.196078431,0.588235294,0.980392 Now we just need to convert those values into hex. All hex editors should have a base convert or calculator that will convert between different formats. You want to go from a float to a little endian hex value. You should be also able to Google an online hex converter if needed. So converting those values gives us: A1A0A03D F1F0703E C9C8C83E F1F0F03D C9C8C83E 9C9B1B3F ACC8483E 9296163F F8FA7A3F Which means with the 12 bytes of zero padding we get the following string: A1A0A03DF1F0703EC9C8C83E00000000F1F0F03DC9C8C83E9C9B1B3F00000000ACC8483E9296163FF8FA7A3F00000000 In the hex editor, if we search the MDL for the original string for Fx_PuffySand that we noted earlier, we find only a single instance, which is good. We can now replace that with the new string we just created. Doing so and loading up the editing menu in the game gives the following: Success, albeit perhaps a tad bright (I forgot to take into account transparency). Now let's do the same with Fx_PuffySand01. 50,10,10 0.196078431,0.039215686,0.039215686 140,28,28 0.549019608,0.109803922,0.109803922 250,54,54 0.980392157,0.211764706,0.211764706 C9C8483E A1A0203D A1A0203D 8D8C0C3F E1E0E03D E1E0E03D FBFA7A3F D9D8583E D9D8583E C9C8483EA1A0203DA1A0203D000000008D8C0C3FE1E0E03DE1E0E03D00000000FBFA7A3FD9D8583ED9D8583E00000000 Which gives: Fx_PuffySand02: 5,35,5 0.019607843,0.137254902,0.019607843 18,107,18 0.070588235,0.419607843,0.070588235 29,184,29 0.11372549,0.721568627,0.11372549 A1A0A03C 8D8C0C3E A1A0A03C 9190903D D7D6D63E 9190903D E9E8E83D B9B8383F E9E8E83D A1A0A03C8D8C0C3EA1A0A03C000000009190903DD7D6D63E9190903D00000000E9E8E83DB9B8383FE9E8E83D00000000 Which gives: And finally, Fx_PuffySand03: 35,10,55 0.137254902,0.039215686,0.215686275 85,25,130 0.333333333,0.098039216,0.509803922 135,40,205 0.529411765,0.156862745,0.803921569 Which gives: A thing of beauty. I'm surprised Obsidian didn't go with that colour scheme. Regarding transparency, I haven't played with it myself, but it looks to be the alphaMid value. That would seem to correspond to value 052 in the data viewer. Figuring out how to change that on your own will be a good learning experience. 4 Quote Share this post Link to post Share on other sites
Guest cornel Posted February 18, 2016 How did you arrive at the "puffy sand" selection? I would have taken the two "mist" parts! ... I read through your article (I'm back in school again, yaaay!) a few times (my head hurts), and am now in the process of trying to duplicate your steps to get the hang of it (and be able to "do my thang" at some point), but I got stuck pretty soon: at the float to hex conversion... I cannot reproduce your results! I've tried several converters i could find online (like: http://gregstoll.dyndns.org/~gregstoll/floattohex/) but I never get the same result as you did... I tried to convert the first value (0.07843138) to get the correct result (A1A0A03D), but what I get is: 0x3da0a0a2... Could you recommend a correct online coverter? P.S. You probably don't remember when you started out and some wise master taught you the ropes, but I am feeling pretty grateful for what you're doing here... These didn't help any either: http://www.binaryhexconverter.com/ http://forums.kleientertainment.com/topic/42767-help-with-vector3-color-code/ Merely using your numbers, I got to this: Quote Share this post Link to post Share on other sites
sEcOnDbOuToFiNsAnItY 60 Posted February 18, 2016 Could this in theory be used to convert the Darth Sion screen to use DeadMan's TFU-style Sion model? (Or Darth Sapiens' version) Quote Share this post Link to post Share on other sites
DarthParametric 3,785 Posted February 18, 2016 I tried to convert the first value (0.07843138) to get the correct result (A1A0A03D), but what I get is: 0x3da0a0a2... You can ignore the 0x, that's just the designator that tells you that it is in hex. So take your 4 byte value, 3DA0A0A2, and split it into single byte chunks, 3D A0 A0 A2. Now reverse the order, A0 A0 A2 3D. Minor rounding error causes some differences, but the issue is endianness. This is where someone that actually knows what they are talking about has to step in and explain it to you. Quote Share this post Link to post Share on other sites