Guest cornel

Main menu modding

Recommended Posts

Guest cornel

"This is where someone that actually knows what they are talking about has to step in and explain it to you."

 

You're kidding, right?

 

I hope this thread is of use to many more wannabe-modders ;)

Many thanks to you, DarthParametric!!!

Share this post


Link to post
Share on other sites

Could this in theory be used to convert the Darth Sion screen to use DeadMan's TFU-style Sion model? (Or Darth Sapiens' version)

Not modified meshes, no. Simple retextures for the original Sion mesh would be fine though.

 

You're kidding, right?

Nope, this sort of thing is completely outside my wheelhouse. I simply learned to bludgeon my way through certain elements of it out of shear necessity, trying to overcome issues with MDLOps, my mortal enemy.

Share this post


Link to post
Share on other sites

Could this in theory be used to convert the Darth Sion screen to use DeadMan's TFU-style Sion model? (Or Darth Sapiens' version)

 

Not modified meshes, no. Simple retextures for the original Sion mesh would be fine though.

 

That's because mainmenu0x.mdl (don't know Sions number^^) is more than his body model, right? Or would replacing this mdl with the TFU style Sion model work?

Share this post


Link to post
Share on other sites

That's because mainmenu0x.mdl (don't know Sions number^^) is more than his body model, right? Or would replacing this mdl with the TFU style Sion model work?

Yes, I was wondering if - since this seems to be a method of modifying the physical model - it would be possible to import the relevant geometry. My experience in model editing is extremely limited.

Share this post


Link to post
Share on other sites
Guest cornel

Playing around with the main menu gui from KOTOR...

 

Now the layout looks more like the TSL menu.

 

 

(This was possible thanks to the guidance of DarthParametric and FairStrides)

post-17120-0-95688200-1455829771_thumb.jpg

  • Like 1

Share this post


Link to post
Share on other sites
Guest cornel

And this is my menu for TSL...

 

 

 

 

(This was possible thanks to the guidance of DarthParametric and FairStrides)

post-17120-0-83900000-1455829968_thumb.jpg

Share this post


Link to post
Share on other sites

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/

 

What I was able to do was take the Traya and the Kreia menu models:

1 - convert to -ascii.mdl with MDLOps (5? it was a while ago)

2 - load it into 3DS Max and then manipulate the mesh vertices and uvw map, export it

3 - use Taina's replacer tool to modify the original mdl & mdx (there should be lots of threads or tutorials, just search for Taina and replacer)

4 - the new model worked in game just fine

 

Logan23 made a re-skin of the Sion menu model, but I eventually re-did that character from scratch, so we didn't need the Sion re-skin. So far, I haven't tried to add the new character to any menu model.

Share this post


Link to post
Share on other sites

Well, my KotOR2 has several main menu GUI files:

 

mainmenu10x7_p.gui

mainmenu12x9_p.gui

mainmenu16x12_p.gui

mainmenu8x6_p.gui

mainmenu_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.

 

Pretty sure it ALWAYS uses mainmenu8x6_p.gui, regardless of the resolution used. Probably a messup from OE, though I haven't noticed much difference renaming the other files such as loading the game. _x is indeed x-box files.

 

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, the main menu is hardcoded not to go higher than 5, anything above returns 1 (Sion). Which seems rather stupid, since there's another background tier, but that's how it works.

That's why with TSLRCM there's a copy of 06 named 02, and the associated scripts have also been modified appropriately (02 was never called for ever in the original game).

 

05 actually returns the LEADER, rather than the main character actually. So without cheating you can get HK there from the factory, remote, Atton... and if you do cheat 5 as main menu anyone can appear there really due to the Dxun Tomb or Nar Shaddaa sections etc.

Share this post


Link to post
Share on other sites
However, the main menu is hardcoded not to go higher than 5, anything above returns 1 (Sion). Which seems rather stupid, since there's another background tier, but that's how it works.

That's why with TSLRCM there's a copy of 06 named 02, and the associated scripts have also been modified appropriately (02 was never called for ever in the original game).

 

05 actually returns the LEADER, rather than the main character actually. So without cheating you can get HK there from the factory, remote, Atton... and if you do cheat 5 as main menu anyone can appear there really due to the Dxun Tomb or Nar Shaddaa sections etc.

 

What are the requirements for 02 (the original 06) to show up if I may ask? I've never seen it in my playthroughs.

Also, 05 keeps the main character for me even though HK is currently party leader in the factory... weird^^

Share this post


Link to post
Share on other sites

*Casts lesser thread necromancy*

 

thread_necro.gif

 

So I've been playing around with menu editing, like so:

 

 

With completely custom menus an option in the near future, I was wondering how practical it would be to swap the TSL menus around based on planet/location rather than Sith Lord. I was looking at the vanilla and TSLRCM versions of k_align_movie, which seems to be where which menu is shown is determined. The initial bit of the vanilla script which checks if the player has left Telos (seems like it is unused?) gave me the idea: check what module the player is in, then set the GBL_MAIN_SITH_LORD value based on that. I know that KSE shows a "last module" value, so is that stored in such a way that it is readable via script?

 

Assuming so, from all available locations you'd have to choose just 5, which we know is the hard coded limit. That's pretty restrictive, so you'd have to do some two-for-ones, screens that cover more than one location/theme. My thoughts are:

 

Background: Peragus/Telos

Character/s: T3? Kreia? Atton? HK-50? Sion? Atris? Handmaiden?

 

Background: Nar Shaddaa

Character/s: Zez-Kai Ell? Mira? Hanharr? Goto (hologram version)?

 

Background: Dantooine (lots of flying manta ray things!)

Character/s: Vrook? Disciple? Azkul?

 

Background: Onderon/Dxun

Character/s: Kavar? Mandalore? Vaklu vs Talia?

 

Background: Korriban

Character/s: Sion

 

I know it is kind of odd to exclude Malachor V (especially as that was what I was playing with above), but something has to get the chop when 5 locations is all you have to work with. I'm also not sure where you'd put Nihilus or Traya in any of those. I assume the addition of the player is hard coded to some degree as well (in terms of specific menu number, animation, etc.). If so, that might also take them off the table as a possibility.

  • Like 2

Share this post


Link to post
Share on other sites

I know that KSE shows a "last module" value, so is that stored in such a way that it is readable via script?

 

Yes, the global string K_LAST_MODULE. It would be trivial to grab the first number from that and convert it to an integer based on the planet.

int nCurrentPlanet = StringToInt(GetStringLeft(GetGlobalString("K_LAST_MODULE"), 1));

Then you'd need an if tree to filter it down to 5 options, but seems doable.

 

There already is one for current planet, but I'm not sure if it's used properly in K2, since it's left over from the rapid transit system in the first game. But if that works you could use that instead, either way.

Share this post


Link to post
Share on other sites

I know that KSE shows a "last module" value, so is that stored in such a way that it is readable via script?

Yes, KSE shows a last module value, though this is in one of the save's files itself (I believe savenfo.res off the top of my head), not stored in an accessible way.

 

Yes, the global string K_LAST_MODULE.

Sadly this will not work out of the box. The K_LAST_MODULE global string was used exclusively for the Rapid Transit System in K1. The code carried over to K2, even though they took the button off of the GUI. In K2, any mention of K_LAST_MODULE is found only in three files: k_inc_utility (whose UT_ValidateJump function checks for the K1 Ebon Hawk level), k_sup_guiopen.nss and its compiled form. The k_sup_guiopen script was fired as part of the Rapid Transit System itself and so is void in K2 as it currently stands.

 

However, levels do have an OnExit script event in their .are file. One could probably use this to set K_LAST_MODULE to the current level using something like this:

void main()
{
    SetGlobalString("K_LAST_MODULE", GetModuleFileName());
}

From what I recall of the function, if you're in 003EBO.mod, the function would return "003EBO", without the extension.

Share this post


Link to post
Share on other sites

As in, the K_LAST_MODULE in the global strings section of the savegame? If so, then it must be a hard-coded change Obsidian made, since I see no mention of the k_sup_guiopen script being called in any way in the levels...

Share this post


Link to post
Share on other sites

Based on JCarter's snippert, I was going to suggest something like this:

 

 

 

	int nCurrentPlanet = StringToInt(GetStringLeft(GetGlobalString("K_LAST_MODULE"), 1));

	if (nCurrentPlanet >= 001 && nCurrentPlanet <= 007) {
		// Ebon Hawk - 001EBO to 007EBO
		SetGlobalNumber("GBL_MAIN_SITH_LORD", 1);
	}
	else if (nCurrentPlanet >= 101 && nCurrentPlanet <= 262) {
		// Peragus & Telos - 101PER to 262TEL
		SetGlobalNumber("GBL_MAIN_SITH_LORD", 1);
	}
	else if (nCurrentPlanet >= 301 && nCurrentPlanet <= 371) {
		// Nar Shaddaa & Goto's Yacht - 301NAR to 371NAR
		SetGlobalNumber("GBL_MAIN_SITH_LORD", 2);
	}
	else if (nCurrentPlanet >= 401 && nCurrentPlanet <= 512) {
		// Dxun & Onderon - 401DXN to 512OND
		SetGlobalNumber("GBL_MAIN_SITH_LORD", 3);
	}
	else if (nCurrentPlanet >= 601 && nCurrentPlanet <= 650) {
		// Dantooine - 601DAN to 650DAN
		SetGlobalNumber("GBL_MAIN_SITH_LORD", 4);
	}
	else if (nCurrentPlanet >= 701 && nCurrentPlanet <= 711) {
		// Korriban - 701KOR to 712KOR
		SetGlobalNumber("GBL_MAIN_SITH_LORD", 5);
	}
	else if (nCurrentPlanet >= 851 && nCurrentPlanet <= 853) {
		// Ravager - 851NIH to 853NIH
		SetGlobalNumber("GBL_MAIN_SITH_LORD", 1);
	}
	else if (nCurrentPlanet >= 901 && nCurrentPlanet <= 907) {
		// Malachor V - 901MAL to 907MAL
		SetGlobalNumber("GBL_MAIN_SITH_LORD", 1);
	}
	else if (nCurrentPlanet = 950) {
		// Coruscant Trial Scene - 950COR (I don't think this one counts?)
		SetGlobalNumber("GBL_MAIN_SITH_LORD", 1);
	}
	else {
		// Catchall for 3rd party mods with new modules
		SetGlobalNumber("GBL_MAIN_SITH_LORD", 1);
	}

 

But I gather it won't be that simple then?

Share this post


Link to post
Share on other sites

As in, the K_LAST_MODULE in the global strings section of the savegame? If so, then it must be a hard-coded change Obsidian made, since I see no mention of the k_sup_guiopen script being called in any way in the levels...

 

Ah, I did a test and my saves were indeed lying to me. A shame.

 

I don't think the OnExit method would work, though. It wouldn't account for when the player gets warped through other means. OnEnter should account for those... I think. Actually, it might not make a difference. I've never tested that, so I can't say.

 

Based on JCarter's snippert, I was going to suggest something like this:

...

But I gather it won't be that simple then?

 

 

Oh, if you're going to be that specific about the module, then you'll need to check all three digits.

int nCurrentModule = StringToInt(GetStringLeft(GetGlobalString("K_LAST_MODULE"), 3));

Share this post


Link to post
Share on other sites

Well, it gets fired every time you enter that module (not just the first time) and then the script would store that as the global string.

 

But OnExit fires when you exit that module and transition to another one, so it might not make a difference. It depends on whether OnExit isn't fired when you exit in certain circumstances. I'm pretty sure OnEnter must always be fired when you enter, though.

Share this post


Link to post
Share on other sites

I see no difference from here in the execution of the OnEnter and the OnExit, so I would suggest a test using an OnExit and a conversation warp. Probably just a simple SendMessageToPC in the OnExit and then see if it shows up in the feedback log.

 

As to the OnEnter itself, the only way this would work for getting the last, or previous, module would be if it also checked for the nearest door/trigger so that you knew which warp point was actually used to get to this module.

Share this post


Link to post
Share on other sites

I see no difference from here in the execution of the OnEnter and the OnExit, so I would suggest a test using an OnExit and a conversation warp. Probably just a simple SendMessageToPC in the OnExit and then see if it shows up in the feedback log.

 

Yes, I may be overthinking it. But things in this game rarely work the way you'd think. It's made me paranoid.

 

 

As to the OnEnter itself, the only way this would work for getting the last, or previous, module would be if it also checked for the nearest door/trigger so that you knew which warp point was actually used to get to this module.

 

Well, we don't care about that? We only care about what module we're in right now. GetModule();

Share this post


Link to post
Share on other sites

GetModule() returns the object reference to the level itself, just like you'd refer to a creature or an item, or a placeable. For any of this to work, going off of the level you're in or were in at the time of this scripting, you'd need GetModuleFileName(). If you're in "001EBO.mod", the function would only return "001EBO".

Share this post


Link to post
Share on other sites

...Then doesn't that last comment negate all of this talk about K_LAST_MODULE, which is the module you had been in, not the module are currently in?

 

Yeah, if it were actually serving its original purpose. Now that you mention it, if it actually were working correctly then it wouldn't be ideal for this (if a value is only stored when the rapid transit system is used). But for the purpose of the main menu, all that's needed is a means to store the current module. K_LAST_MODULE is a global string that is not being used for anything, so it's as good as any, right? You could make a new string or numeric, but that's more work.

 

 

What does GetModule() return? An int or a string?

 

GetModule() returns the object reference to the level itself, just like you'd refer to a creature or an item, or a placeable. For any of this to work, going off of the level you're in or were in at the time of this scripting, you'd need GetModuleFileName(). If you're in "001EBO.mod", the function would only return "001EBO".

 

Yeah, sorry, I meant GetModuleName(). That returns the string of the module.

 

If you want, you can copy the code from my script jc_c_planet in my Toolbox. I think I accounted for every possibility in there. 950 counts as the Ebon Hawk, etc.

 

For the OnEnter or OnExit or whatever method, you'd have to add something like

SetGlobalString( "K_LAST_MODULE", GetModuleName() );

at the end of the script.

Share this post


Link to post
Share on other sites

Very true. However, the impression I got from Darth Parametric's original purpose was that the menu would change after you completed a planet. Were that the case, then I'd suggest tapping into the Galaxy Map's script and in all likelihood using the K_CURRENT_PLANET global int before the planet change would occur.

 

If it is instead to show the current planet you're on, we could still tap into the Galaxy Map's scripts, just at the point after the planet change.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.