![]() |
|
|
#1 |
|
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; Code:
function PerformSpecialHandicap()
{
local UTPawn P;
if(HandicappedPlayer != none)
{
P = UTPawn(HandicappedPlayer.Pawn);
if(P != none)
{
P.AirControl = 0;
P.DefaultAirControl = 0;
}
}
}
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;
}
}
}
|
|
|
|
|
|
|
#2 |
|
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 | PlanetJailbreak | Unreal Wiki | Liandri Archives Everything you ever wanted to know about replication (but were afraid to ask) [in German] | 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!" |
|
|
|
|
|
|
#3 |
|
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. ) |
|
|
|
|
![]() |
| Tags |
| aircontrol, replication |
| Thread Tools | |
| Display Modes | |
|
|