Hi,
I'm trying to make a weapon which spawn a xpawn the 'lure' and give the control to the player owning the gun.
The player will control the original pawn is made when:
-the lure auto-destroys as I want the control time limited.
I used the lifespan parameter in my modified xpawn class to avoid using a timer() or tick().
-the lure is killed.
The process of possesssing/unpossessing works offline but i have an issue when unpossesing the pawn on a server.
In my xpawn subclass i modified :
and I added:
(Taken from the redeemer warhead code.)
I suspect several things to cause the issue but I can't clearly point out what:
-revelancy: the xpawn cannot auto destroy because a controller (client) is controlling it
-replication:
I'm trying to make a weapon which spawn a xpawn the 'lure' and give the control to the player owning the gun.
The player will control the original pawn is made when:
-the lure auto-destroys as I want the control time limited.
I used the lifespan parameter in my modified xpawn class to avoid using a timer() or tick().
-the lure is killed.
The process of possesssing/unpossessing works offline but i have an issue when unpossesing the pawn on a server.
In my xpawn subclass i modified :
Code:
simulated function Destroyed()
{
...
RelinquishController();
Super.Destroyed();
}
State Dying
{
simulated function BeginState()
{
...
RelinquishController();
Super.BeginState();
}
}
Code:
function RelinquishController()
{
if ( Controller == None )
return;
Controller.Pawn = None;
if ( !Controller.IsInState('GameEnded') )
{
if ( (OldPawn != None) && (OldPawn.Health > 0) )
{
Controller.Possess(OldPawn);
log("possessing oldpawn");
}
else
{
if ( OldPawn != None )
Controller.Pawn = OldPawn;
else
Controller.Pawn = self;
Controller.PawnDied(Controller.Pawn);
}
}
Instigator = OldPawn;
Controller = None;
}
I suspect several things to cause the issue but I can't clearly point out what:
-revelancy: the xpawn cannot auto destroy because a controller (client) is controlling it
-replication:
the destruction function isn't replicated/called/executed on the client
the pawn itself isn't replicated