1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

UE1 - UT Mutator Menu Code - Need Help

Discussion in 'Programming' started by Rajada, May 22, 2012.

  1. Rajada

    Rajada Member

    Joined:
    Jan 21, 2008
    Messages:
    213
    Likes Received:
    0
    I am modifying the menu code for the mutator window for my own Unreal engine game mod. My menu structure is identical to UT, and after playing with the code, the following works perfectly with one exception. All the mutators with valid int files are found and names are read in, but the list items are never created.

    Code:
    function LoadMutators()
    {
    	local int NumMutatorClasses;
    	local string NextMutator, NextDesc;
    	local UMenuMutatorList I;
    	local int j;
    	local int k;
    	
    	
    	GetPlayerOwner().GetNextIntDesc(MutatorBaseClass, 0, NextMutator, NextDesc);
    	while( (NextMutator != "") && (NumMutatorClasses < 200) )
    	{
    		I = UMenuMutatorList(Exclude.Items.Append(class'UMenuMutatorList'));
    		I.MutatorClass = NextMutator;
    
    		k = InStr(NextDesc, ",");
    		if(k == -1)
    		{
    			I.MutatorName = NextDesc;
    			I.HelpText = "";
    		}
    		else
    		{
    			I.MutatorName = Left(NextDesc, k);
    			I.HelpText = Mid(NextDesc, k+1);
    		}
    		GetPlayerOwner().GetNextIntDesc(MutatorBaseClass, NumMutatorClasses, NextMutator, NextDesc);
    		NumMutatorClasses++;
    	}
    	
    	MutatorList = GetConfigString("NerfMenu.NerfPDAScreenSetupBotmatch", "SavedMutatorString", "Nerf.ini");
    
    	while(MutatorList != "")
    	{
    		j = InStr(MutatorList, ",");
    		if(j == -1)
    		{
    			NextMutator = MutatorList;
    			MutatorList = "";
    		}
    		else
    		{
    			NextMutator = Left(MutatorList, j);
    			MutatorList = Mid(MutatorList, j+1);
    		}
    		
    		I = UMenuMutatorList(Exclude.Items).FindMutator(NextMutator);
    		if(I != None)
    		{
    			I.Remove();
    			Include.Items.AppendItem(I);
    		}
    		else
    			Log("Unknown mutator in mutator list: "$NextMutator);
    			
    	}
    	Exclude.Sort();
    }
    
    
    Once again, this is slightly modified for another version of the engine. Everything compiles, all the windows and fields show up, but the list items (IE the text reading "MUTATOR.MUTATORNAME") does not even get created. To me, that means there's something wrong with this line...

    Code:
    UMenuMutatorList(Exclude.Items.Append(class'UMenuMutatorList'));
    or something wrong with the UMenuMutatorList...

    Code:
    var string MutatorName;
    var string MutatorClass;
    
    function int Compare(UWindowList T, UWindowList B)
    {
    	if(Caps(UMenuMutatorList(T).MutatorName) < Caps(UMenuMutatorList(B).MutatorName))
    		return -1;
    
    	return 1;
    }
    
    // Call only on sentinel
    function UMenuMutatorList FindMutator(string FindMutatorClass)
    {
    	local UMenuMutatorList I;
    
    	for(I = UMenuMutatorList(Next); I != None; I = UMenuMutatorList(I.Next))
    		if(I.MutatorClass ~= FindMutatorClass)
    			return I;
    
    	return None;
    }
    But these compile fine and are identical to the UT versions. So, does anyone have any insight into what could be causing the list items to not be made? When I log the contents of Exclude (Exclude.Items) it is returning None.
     
    Last edited: May 23, 2012
  2. Rajada

    Rajada Member

    Joined:
    Jan 21, 2008
    Messages:
    213
    Likes Received:
    0
    Ahhhhh I figured it out. I had to explicitly declare the ListClass in the Exclude and Include boxes for some reason.
     

Share This Page