Help with menu.

Discussions about UT99
Post Reply
UTX
Skilled
Posts: 214
Joined: Fri Aug 28, 2015 3:39 am

Help with menu.

Post by UTX »

I am back and I have decided to begin working again on the Unreal Tournament X again, I will begin with the Health items as I mentioned in another thread but I have an issue, I have never been able to make mod menus. So I came here to ask, would any of you be willing to help me out with those or is there a good tutorial that I could understand? I need to know in case I cannot do this I will have to name all my variables something that can be understandable and that will take a little extra time.
JackGriffin
Godlike
Posts: 3774
Joined: Fri Jan 14, 2011 1:53 pm
Personal rank: -Retired-

Re: Help with menu.

Post by JackGriffin »

The UWindow code is MADDENING to deal with and mostly it wouldn't be used anyway. If your mod is designed to work online then just use ini files with it.

I know you may not need it but others possibly could. Here's a very quick primer on variable declaration in uscript:

Code: Select all

Class FireDragon Expands ScriptedPawn config(INIsDragons);

var(FireDragon) config bool AttackOtherMonsters;

defaultproperties
{
	AttackOtherMonsters=True
}
Breakdown-
config(INIsDragons) -This tells the engine to go look here for the values of the variables declared later in this class

var -this is the variable declaration
() -this tells the engine to show this variable in editor under the actor's properties
FireDragon -putting this inside the () tells the editor to create a new category in the actor's properties and call that "FireDragon"
config -This instructs the game to look for an ini file and use the value from it. If one does not exist then it will use the value from DefaultProperties
bool -True/False. Can also be int for Integer, string for a String Value, etc.
AttackOtherMonsters -this is the declared variable itself.

AttackOtherMonsters=True -this sets a default value for the variable just in case the ini is missing.

From my ini file:

Code: Select all

[INIsDragons.FireDragon]
AttackOtherMonsters=True
INIsDragons -Package name
FireDragon -class name

Be sure you don't have any spaces added after your values in your ini file. Certain variables will grab the string value and return them 'literally'. For example highlight these next two lines:

Password=P@ssWord
Password=P@ssWord

See how the second one has a trailing space? If you returned a string value on that you would get "P@ssWord " as the return, with the blank space at the end. This drove me mad one evening when I could not get my password to work on my server. It was only after I logged the return did I finally see the space I had added by mistake.

Anyway I hope this helps someone.

Visual aid-
show.jpg
show.jpg (83.09 KiB) Viewed 716 times
So long, and thanks for all the fish
UTX
Skilled
Posts: 214
Joined: Fri Aug 28, 2015 3:39 am

Re: Help with menu.

Post by UTX »

You are correct, including the part about me not needing it as I knew this. :)
And this is how I have been doing it, along with the Advanced Properties entry, thanks to Dr. Flay for teaching me that. I just think a mod menu would be better, as that way I can name the variables whatever I want and then type the descriptions in the menus.
Post Reply