News UnrealEd Files Mods FragBU Liandri Archives
BeyondUnreal Forums

Go Back   BeyondUnreal Forums > Unreal Development > Coding

Reply
 
Thread Tools Display Modes
Old 29th Dec 2011, 11:40 PM   #1
DannyMeister
UT3 Jailbreak Coder
 
DannyMeister's Avatar
 
Join Date: Dec. 11th, 2002
Location: Bolivar, Missouri
Posts: 1,242
Pawn.AirControl not getting replicated

Based on the replication block in Pawn.uc, any changes to AirControl will be replicated to the owning client.

Code:
// variables sent to owning client
if ( bNetDirty && bNetOwner && Role==ROLE_Authority )
	InvManager, Controller, GroundSpeed, WaterSpeed, AirSpeed, AccelRate, JumpZ, AirControl;
However, AirControl never gets updated for the client in the following code called on the server. The result is a very jittery experience as the client updates its position in the air based on user input and then gets corrected by the server.

Code:
function PerformSpecialHandicap()
{
	local UTPawn P;

	if(HandicappedPlayer != none)
	{
		P = UTPawn(HandicappedPlayer.Pawn);
		if(P != none)
		{
			P.AirControl = 0;
			P.DefaultAirControl = 0;
		}
	}
}
By adding a call to the following function after setting the AirControl to 0 above, I can get rid of the jittery effect, but this seems unnecessary.

Code:
// this shouldn't be necessary! AirControl is supposed to be replicated to owning client.
simulated unreliable client function ClientRemoveAirControl()
{
	local UTPlayerController O;
	local UTPawn P;

	O = UTPlayerController(Owner);
	if(O!=none)
	{
		P = UTPawn(O.Pawn);
		if(P!=none)
		{
			P.AirControl = 0;
			P.DefaultAirControl = 0;
		}
	}
}
Anyone have any ideas? Thanks.
__________________

UT3 Jailbreak is under development! Forums | Website
DannyMeister is offline   Reply With Quote
Old 30th Dec 2011, 02:12 AM   #2
Wormbo
 
Wormbo's Avatar
 
Join Date: Jun. 4th, 2001
Location: Germany
Posts: 5,781
The thing with the replication block is, that it only tells that something is supposed to be replicated, but not when. Try forcing an immediate update by setting bForceNetUpdate=true when modifying AirControl.
Then again, DefaultAirControl is not replicated at all and ifs used to reset AirControl after landing. So if you want to permanently change the (default) AirControl, you have no other choice than replicating a function call or using an additional (repnotify) variable.
__________________
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 30th Dec 2011, 10:03 PM   #3
DannyMeister
UT3 Jailbreak Coder
 
DannyMeister's Avatar
 
Join Date: Dec. 11th, 2002
Location: Bolivar, Missouri
Posts: 1,242
Sorry, I forgot to mention that I had already tried to use bForceNetUpdate=true to no avail. I could run around for10 minutes after AirControl was set to 0 and it never replicated. This was quite surprising to me.
Fortunately DefaultAirControl isn't really needed in this case as I believe it only really used for resetting air control on the server anyways (at least according to the initial glance I gave it. )
__________________

UT3 Jailbreak is under development! Forums | Website
DannyMeister is offline   Reply With Quote
Reply

Tags
aircontrol, 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 01:36 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