UE3 - UT3 Pawn.AirControl not getting replicated

  • 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.

DannyMeister

UT3 Jailbreak Coder
Dec 11, 2002
1,275
1
38
40
Bolivar, Missouri
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.
 

Wormbo

Administrator
Staff member
Jun 4, 2001
5,913
36
48
Germany
www.koehler-homepage.de
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.
 

DannyMeister

UT3 Jailbreak Coder
Dec 11, 2002
1,275
1
38
40
Bolivar, Missouri
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. )