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 Urgent: Can you decode this crash?

Discussion in 'Programming' started by Rajada, Feb 25, 2011.

  1. Rajada

    Rajada Member

    Joined:
    Jan 21, 2008
    Messages:
    213
    Likes Received:
    0
    I just got this with a custom PlayerReplicationInfo (actually, I modified the default for a total conversion kind of thing). I need to know what it means so I can fix this. This only happens online, not in singleplayer. The replication info seems to be to blame, but how?

    [​IMG]

    This is the code


    Code:
    var string				PlayerName;		// Player name, or blank if none.
    var string				OldName;		// Temporary value.
    var int					PlayerID;		// Unique id number.
    var string				TeamName;		// Team name, or blank if none.
    var byte				Team;			// Player Team, 255 = None for player.
    var int					TeamID;			// Player position in team.
    var float				Score;			// Player's current score.
    var float				Deaths;			// Number of player's deaths.
    var float				Spree;			// Player is on a killing spree.
    var int                 Lives;          // For gametypes that use lives.
    var bool                bSuperAdmin;    // Double check for kicking admins.
    var bool                bHideScore;     // Don't show my score on the scoreboard.
    var int                 ExpRank;        // For mutators that use ranks.
    
    var class<VoicePack>	VoiceType;
    
    //##nerf WES FIXME
    // Taking it out since we never use it.
    //var Decoration			HasFlag;
    
    var int					Ping;
    var bool				bIsFemale;
    var	bool				bIsABot;
    var bool				bFeigningDeath;
    var bool				bIsSpectator;
    var bool				bWaitingPlayer;
    var bool				bAdmin;
    //##nerf WES FIXME
    // Don't need TalkTexture since we are not displaying their face.
    //var Texture				TalkTexture;
    var ZoneInfo			PlayerZone;
    var LocationID			PlayerLocation;
    var name				SuicideType;
    var int					Rank;
    var int					Lead;
    var bool				bDead;
    
    // Nerf expansion slot
    var texture				SkinIcon;		// player's icon in the HUD
    var ETeamType			TeamType;		// twister, tycoon, whatever
    var EBotIndex			BotIndex;		// one of ours, 0-32
    
    var	EVType				VType;			// for voice source construction
    
    
    replication
    {
    	// Things the server should send to the client.
    	reliable if ( Role == ROLE_Authority )
    		PlayerName, OldName, PlayerID, TeamName, Team, TeamID, Score, Deaths, Spree, VoiceType,
    		//HasFlag, 
    		Ping, bIsFemale, bIsABot, bFeigningDeath, bIsSpectator, bWaitingPlayer,
    		bAdmin, 
    //##nerf WES 
    // Don't need TalkTexture since we are not displaying their face.
    		//TalkTexture,
    		PlayerZone, PlayerLocation, SuicideType, Rank, Lead, bDead,
    		SkinIcon, TeamType, BotIndex, VType;
    }
    
    function PostBeginPlay()
    {
    	Timer();
    	SetTimer(2.0, true);
    	bIsFemale = Pawn(Owner).bIsFemale;
    	if(Owner.IsA('NerfIPlayer'))
    	bHideScore = NerfIPlayer(Owner).bHideScore;
    	else if(Owner.IsA('NerfBots'))
    	bHideScore = NerfBots(Owner).bHideScore;
    	else if(Owner.IsA('Spectator'))
    	bHideScore = Spectator(Owner).bHideScore;
    }
     					
    function Timer()
    {
    	local float MinDist, Dist;
    	local LocationID L;
    
    	MinDist = 1000000;
    	PlayerLocation = None;
    	if ( PlayerZone != None )
    		for ( L=PlayerZone.LocationID; L!=None; L=L.NextLocation )
    		{
    			Dist = VSize(Owner.Location - L.Location);
    			if ( (Dist < L.Radius) && (Dist < MinDist) )
    			{
    				PlayerLocation = L;
    				MinDist = Dist;
    			}
    		}
    
    	if (PlayerPawn(Owner) != None)
    		Ping = int(PlayerPawn(Owner).ConsoleCommand("GETPING"));
    }
    
    function tick(float deltatime)
    {
    bIsFemale = Pawn(Owner).bIsFemale;
    	if(Owner.IsA('NerfIPlayer'))
    	bHideScore = NerfIPlayer(Owner).bHideScore;
    	else if(Owner.IsA('NerfBots'))
    	bHideScore = NerfBots(Owner).bHideScore;
    	else if(Owner.IsA('Spectator'))
    	bHideScore = Spectator(Owner).bHideScore;
    }
     
    Last edited: Feb 25, 2011
  2. gopostal

    gopostal Active Member

    Joined:
    Jan 19, 2006
    Messages:
    822
    Likes Received:
    46
    No way to tell unless you post the relevant code. Send the classes to me, I'll take a look. You messed up replication obviously but it's always fixable.
     
  3. meowcat

    meowcat take a chance

    Joined:
    Jun 7, 2001
    Messages:
    774
    Likes Received:
    1
    Is that PlayerReplicationInfo a subclass of the normal PRI, or are you trying to recompile the PlayerReplicationInfo itself? In first UT game, the PlayerReplicationInfo had a native component as well as native replication. By commenting out (or even trying to 're-replicate' the same variables) the variables the native code is having problems compressing/comparing the data to determine what to replicate. Typically you cannot easily recompile the core version of engine.u of a game if you've also screwed with stuff that the native code expects to see (possibly TalkTexture of HasFlag)
     
  4. Rajada

    Rajada Member

    Joined:
    Jan 21, 2008
    Messages:
    213
    Likes Received:
    0
    If I pout those vars in say a pawn instead, can I still access them online reliably? Talk texture and has flag were like that before i got there. Can I create my own kind of PRI if I don't re-replicate variables?
     
    Last edited: Feb 26, 2011
  5. gopostal

    gopostal Active Member

    Joined:
    Jan 19, 2006
    Messages:
    822
    Likes Received:
    46
    If meowcat is right (and I would trust his opinion) you are pretty much blocked.
     
  6. meowcat

    meowcat take a chance

    Joined:
    Jun 7, 2001
    Messages:
    774
    Likes Received:
    1
    First rule of Uscript, unless you are a licensee, never recompile the base packages (engine.u for example), especially those which contain native classes. Only create new packages and subclass those classes that you need to add your modded functionality. I guess the UDK may be a special case (I've not tried messing with it much yet).

    If I were you, I would probably just create a subclass of PlayerReplicationInfo (which I can't tell if you have already done or not) and then override what ever functions/variables in a custom pawn/playerpawn class that that spawns the PRI. Without knowing more details of what you are trying to do I'm not sure we can provide much help.
     
  7. Wormbo

    Wormbo Administrator Staff Member

    Joined:
    Jun 4, 2001
    Messages:
    5,915
    Likes Received:
    36
    Or alternatively: If you really have to change existing packages, at least do not change the order or type of class-global variables in native classes. Particularly you must not add new class-global variables to native classes that have native subclasses. If the class has only non-native subclasses, you can add your new variables after all others.

    In other words: You cannot add variables to classes such as Object, Actor, Pawn, NavigationPoint, KeyPoint or (Replication)Info. PlayerReplicationInfo will work, but keep above rule in mind.
     
  8. Rajada

    Rajada Member

    Joined:
    Jan 21, 2008
    Messages:
    213
    Likes Received:
    0
    AH, but this IS PlayerReplicationInfo, so would that mean some other class is to blame or am I still breaking it at PRI? For example I did add code to pawn, so could that cause the error seen above or is this for sure PRI related? Also, keep in mind this only happens with a server, not in stand alone.
     
    Last edited: Feb 26, 2011
  9. Wormbo

    Wormbo Administrator Staff Member

    Joined:
    Jun 4, 2001
    Messages:
    5,915
    Likes Received:
    36
    Adding, modifying or removing non-native functions and states is ok. Adding variables is not, because it messes up the mapping of script variables to native variables unless you reexport headers and recompile the native implementation. The reason you only get this one in network games could be that PRI determines replicated variables natively and unexpectedly hits your messed-up variables.
     
  10. Rajada

    Rajada Member

    Joined:
    Jan 21, 2008
    Messages:
    213
    Likes Received:
    0
    Ah, okay, So I need a new place for those variables, such as NerfIPlayer which is below PlayerPawn but is not native. But the Tick function I added is totally fine? Just the variables are to blame?
     

Share This Page