Menu tutorials?

Discussions about Coding and Scripting
Post Reply
User avatar
ANUBITEK
Adept
Posts: 261
Joined: Sun Dec 28, 2014 1:10 am
Location: Anubitek

Menu tutorials?

Post by ANUBITEK »

Are the any tutorials I could look at that could help me understand ShowMenu(), how menu systems work, and how to set up my own menu system? Also bonus points for any HUD tutorials.

I'd like to make a menu system that can be pulled up when the player does an input, and I want to use my own byte values to cycle through individual options in the menu. I want to then be able to open another menu (or sub-menu?) based on what option I have 'selected'. In this sub-menu, I'd like to scroll through a list of potential int variables from 0-49 and be able to select one of these values, which should assign it to a value to be plugged into a fire() command (for instance, fire(11) ). From there, I'd like to be able to back out to the previous menu then exit out of that and go back into playing the game.

I have the input code to open the main menu here, I think:

Code: Select all

exec function CommandThree( optional byte F )
{
	if ( Health > 0 )
	{
		if ( bShowMenu || Len(Level.Pauser)>0 )
			return;
		else
		{
			bUsedCommandThree = true;
			//ShowMenu(); ???
			return;
		}
	}
}
And I've been looking at the menu call found in PlayerPawn:

Code: Select all

exec function ShowMenu()
{
	WalkBob = vect(0,0,0);
	bShowMenu = true; // menu is responsible for turning this off
	Player.Console.GotoState('Menuing');

	if ( Level.Netmode == NM_Standalone )
		SetPause(true);
}
And I've noticed some interesting code already, namely 'Player.Console.GotoState('Menuing');'.
<<| http://uncodex.ut-files.com/ |>>

Code reference for UGold, UT99, Unreal2, UT2k3, UT3
Additional Beyond Unreal Wiki Links
wiki.beyondunreal.com/Legacy:Console_Bar
wiki.beyondunreal.com/Exec_commands#Load
wiki.beyondunreal.com/Legacy:Exec_Directive#Loading_Other_Packages
wiki.beyondunreal.com/Legacy:Config_Vars_And_.Ini_Files
wiki.beyondunreal.com/Legacy:INT_File
User avatar
Feralidragon
Godlike
Posts: 5489
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: Menu tutorials?

Post by Feralidragon »

I don't know any, but tutorials like those would come in handy.

Although I never worked with that specific kind of menu, so I can't help much on that at the moment, I did work with the menus in general (namely the Mod menu, for which I created a more easier version to handle), and they are terribly messy to work with.
The level of over-engineering and hardcoding going on there is off the charts, and it has put off a lot of even big names around the community from working with it due to that.

Not saying it's terribly hard to understand, because it's not, but it's just messy to work with and get it working correctly, so probably you won't find many tutorials on the web.
Therefore I suggest you to take a good look around the source code (UnCodex, like the one you have in your signature) and try to figure it out first.

If in the meanwhile someone comes up with a tutorial link, great, if not, you can at least post here any bumps you find along the way, and you might get some additional help from someone then.
Post Reply