News UnrealEd Files Mods FragBU Liandri Archives
BeyondUnreal Forums

Go Back   BeyondUnreal Forums > Unreal Development > Coding

Reply
 
Thread Tools Display Modes
Old 25th Feb 2011, 01:35 PM   #1
Rajada
Registered User
 
Join Date: Jan. 21st, 2008
Posts: 210
Urgent: Can you decode this crash?

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?



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;
}
__________________
How to play NAB


Last edited by Rajada; 25th Feb 2011 at 02:04 PM.
Rajada is offline   Reply With Quote
Old 25th Feb 2011, 02:03 PM   #2
gopostal
Registered User
 
Join Date: Jan. 19th, 2006
Posts: 673
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.
gopostal is offline   Reply With Quote
Old 25th Feb 2011, 08:00 PM   #3
meowcat
i am a rock, i am an island
 
meowcat's Avatar
 
Join Date: Jun. 7th, 2001
Posts: 763
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)
__________________
"What do you mean it doesn't exist clientside?"
Meowcat's Mods for UT2K4:
Yet Another Real-life Mod: Class-based play, generic realistic weapons, unoriginal gameplay, w/ cheap COD4 knockoff, parkour player moves
TD Vehicles v125: HMMWV, MI4Hound, Black Hawk & AH-6 Helicopters, Motorcycle, IFAV Jeep, Abrams Tank
Jetpacks for UT2k4!
meowcat is offline   Reply With Quote
Old 26th Feb 2011, 01:19 AM   #4
Rajada
Registered User
 
Join Date: Jan. 21st, 2008
Posts: 210
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?
__________________
How to play NAB


Last edited by Rajada; 26th Feb 2011 at 01:31 AM.
Rajada is offline   Reply With Quote
Old 26th Feb 2011, 08:37 AM   #5
gopostal
Registered User
 
Join Date: Jan. 19th, 2006
Posts: 673
If meowcat is right (and I would trust his opinion) you are pretty much blocked.
gopostal is offline   Reply With Quote
Old 26th Feb 2011, 10:34 AM   #6
meowcat
i am a rock, i am an island
 
meowcat's Avatar
 
Join Date: Jun. 7th, 2001
Posts: 763
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.
__________________
"What do you mean it doesn't exist clientside?"
Meowcat's Mods for UT2K4:
Yet Another Real-life Mod: Class-based play, generic realistic weapons, unoriginal gameplay, w/ cheap COD4 knockoff, parkour player moves
TD Vehicles v125: HMMWV, MI4Hound, Black Hawk & AH-6 Helicopters, Motorcycle, IFAV Jeep, Abrams Tank
Jetpacks for UT2k4!
meowcat is offline   Reply With Quote
Old 26th Feb 2011, 11:13 AM   #7
Wormbo
 
Wormbo's Avatar
 
Join Date: Jun. 4th, 2001
Location: Germany
Posts: 5,785
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.
__________________
Wormbo's UT/UT2004/UT3 mods | YouTube channel | PlanetJailbreak/JDN | Unreal Wiki | Liandri Archives
Everything you ever wanted to know about replication| UnrealScript security considerations
<elmuerte> you shouldn't do all-nighters, it's a waste of time and effort
<TNSe> nono
<TNSe> its always funny to find code a week later you dont even remember writing
<Pfhoenix> what's worse is when you have a Star Wars moment
<Pfhoenix> "Luke! I am your code!" "No! Impossible! It can't be!"
Wormbo is offline   Reply With Quote
Old 26th Feb 2011, 01:22 PM   #8
Rajada
Registered User
 
Join Date: Jan. 21st, 2008
Posts: 210
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.
__________________
How to play NAB


Last edited by Rajada; 26th Feb 2011 at 01:27 PM.
Rajada is offline   Reply With Quote
Old 26th Feb 2011, 04:00 PM   #9
Wormbo
 
Wormbo's Avatar
 
Join Date: Jun. 4th, 2001
Location: Germany
Posts: 5,785
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.
__________________
Wormbo's UT/UT2004/UT3 mods | YouTube channel | PlanetJailbreak/JDN | Unreal Wiki | Liandri Archives
Everything you ever wanted to know about replication| UnrealScript security considerations
<elmuerte> you shouldn't do all-nighters, it's a waste of time and effort
<TNSe> nono
<TNSe> its always funny to find code a week later you dont even remember writing
<Pfhoenix> what's worse is when you have a Star Wars moment
<Pfhoenix> "Luke! I am your code!" "No! Impossible! It can't be!"
Wormbo is offline   Reply With Quote
Old 26th Feb 2011, 04:13 PM   #10
Rajada
Registered User
 
Join Date: Jan. 21st, 2008
Posts: 210
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?
__________________
How to play NAB

Rajada is offline   Reply With Quote
Reply

Tags
error, replication

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 11:46 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.

Copyright ©1998 - 2012, BeyondUnreal, Inc.
Privacy Policy | Terms of Use
Bandwidth provided by AtomicGamer