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.

UE2 - UT2kX Access a Muts configs from other class

Discussion in 'Programming' started by forrestmark9, May 14, 2014.

  1. forrestmark9

    forrestmark9 New Member

    Joined:
    Aug 6, 2009
    Messages:
    56
    Likes Received:
    0
    So far I can't figure this out, I want the Scoreboard and a few other classes to access a config from my base mut so setup some things but so far I can only let it access the default values, and can't access values that are set via .ini

    Here is a code example
    Code:
    		for(i=0;i<class'FMXBaseMut'.default.SteamIDs.Length;i++)
    		{
    			if( class'FMXBaseMut'.default.SteamIDs[i].ID == FPlayerRepInfo.SteamID )
    				V = Material(DynamicLoadObject(class'FMXBaseMut'.default.SteamIDs[i].MedalMaterial, class'Material', true));
    		}
    Here is the var in the basemut
    Code:
    struct SteamIDStruct
    {
        var string ID;
        var string MedalMaterial;
    	var Color VIPColor;
    };
    var globalconfig array<SteamIDStruct> SteamIDs;
    Here is the .ini file
    Code:
    [TwistedSPerks.FMXBaseMut]
    SteamIDs=(ID="76561197997881512",MedalMaterial="FMXBaseResources2.Icons.GeneralGrade4")
    SteamIDs=(ID="76561198013017383",MedalMaterial="FMXBaseResources2.Icons.DeathCrest",VIPColor=(R=128,G=128,B=128))
    SteamIDs=(ID="76561198001957275",MedalMaterial="FMXBaseResources2.Icons.KissSkye",VIPColor=(R=255,G=53,B=94))
    SteamIDs=(ID="76561198042301766",MedalMaterial="FMXBaseResources2.Icons.Zeke")
    SteamIDs=(ID="76561198054256896",MedalMaterial="FMXBaseResources2.Icons.VIPMedal",VIPColor=(R=136,G=0,B=137))
    SteamIDs=(ID="76561198014930243",MedalMaterial="FMXBaseResources2.Icons.VIPMedal",VIPColor=(R=0,G=255,B=127))
    SteamIDs=(ID="76561198067351667",MedalMaterial="FMXBaseResources2.Icons.VIPMedal",VIPColor=(R=255,G=111,B=255))
    SteamIDs=(ID="76561198022550978",MedalMaterial="TwistedSPerks.Icons.PeeblesSniper",VIPColor=(R=0,G=99,B=213))
     
  2. WGH

    WGH New Member

    Joined:
    Jan 22, 2006
    Messages:
    237
    Likes Received:
    0
    What bothers me is that you try to access mutator's config from scoreboard. Mutators are supposed to exist only on the server, and scoreboard - only on the client.
    I don't know what exactly you want to do, but most likely you need to replicate the data first. Since it's an array, and the engine doesn't support dynamic array replication, it's going to be a bit tricky. Voting classes may contain some hints how to do this (for they also have to replicate dynamic array - the map list).
     
    Last edited: May 15, 2014
  3. forrestmark9

    forrestmark9 New Member

    Joined:
    Aug 6, 2009
    Messages:
    56
    Likes Received:
    0
    It's in the scoreboard cause what this config does is set a playername color and a custom medal that is used in the scoreboard, hud, and anything else that displays the player name

    What I was thinking was maybe doing something like ScrnBalance, is making a var that is the mut itself and set that value to itself and do this class'FMXBaseMut'.default.Mut.SteamIDs sadly though this method doesn't seem to work
     
    Last edited by a moderator: May 15, 2014
  4. forrestmark9

    forrestmark9 New Member

    Joined:
    Aug 6, 2009
    Messages:
    56
    Likes Received:
    0
    Okay so taking suggestions from Poosh I added a few things to the PRI but the problem is, everything is returning none and the function that adds everything is ignored

    Here is the function in PlayerController
    Code:
    function InitPlayerReplicationInfo()
    {
    	local int i;
    	local ForrestPRI FPlayerRepInfo;
    
    	FPlayerRepInfo = ForrestPRI(PlayerReplicationInfo);
    	
    	for(i=0;i<class'FMXBaseMut'.default.Mut.SteamIDs.Length;i++)
    	{
    		if( GetPlayerIDHash() == class'FMXBaseMut'.default.Mut.SteamIDs[i].ID )
    		{
    			FPlayerRepInfo.bSuperVIP = True;
    			FPlayerRepInfo.MedalMaterial = Material(DynamicLoadObject(class'FMXBaseMut'.default.Mut.SteamIDs[i].MedalMaterial, class'Material', true));
    			FPlayerRepInfo.PlayerNameColor = class'FMXBaseMut'.default.Mut.SteamIDs[i].VIPColor;
    		}
    	}
    	
    	Super.InitPlayerReplicationInfo();
    }
    I added a log into this function to see if anything is actually working, the log never appeared so I'm guessing this code is getting ignored

    Here is the PRI code
    Code:
    var Material MedalMaterial;
    var Color PlayerNameColor;
    var bool bSuperVIP;
    
    replication
    {
    	reliable if ( Role == Role_Authority )	
    		PlayerNameColor, MedalMaterial, bSuperVIP;
    }
    EDIT: We figured it out for some odd reason GetPlayerIDHash() is returning a weird number and not the actual SteamID
     
    Last edited by a moderator: May 15, 2014
  5. forrestmark9

    forrestmark9 New Member

    Joined:
    Aug 6, 2009
    Messages:
    56
    Likes Received:
    0
    This problem has been solved it appears that GetPlayerIDHash would return the UT2004 CD-Key hash before PostLogin, so I had to do the calls in Tick from the PRI
     

Share This Page