For direct access use https://forums.oldunreal.com
It's been quite a while since oldunreal had an overhaul, but we are moving to another server which require some updates and changes. The biggest change is the migration of our old reliable YaBB forum to phpBB. This system expects you to login with your username and old password known from YaBB.
If you experience any problems there is also the usual "password forgotten" function. Don't forget to clear your browser cache!
If you have any further concerns feel free to contact me: Smirftsch@oldunreal.com

RLCoop - Reviving kicks players from server

The section related to UnrealScript and modding. This board is for coders to discuss and exchange experiences or ask questions.
User avatar
Shivaxi
OldUnreal Member
Posts: 2232
Joined: Wed Mar 08, 2006 4:43 pm

RLCoop - Reviving kicks players from server

Post by Shivaxi »

So, this is a really bizarre one, and I was actually writing up a big post about this when I semi fixed the issue, so lemme explain:

In RLCoop we have a custom RLPlayer class, with all sorts of crap going on.  One of the functions is a revive function in order to revive a dead player with the SuperHealth item.  Now we were using Carcass for this before, but we changed the dying state to sort of simulate death in our own way rather than changing the player to the carcass class in order to have more control over the dying state and reviving and all that.

Problem is, now with reviving, when a player tries to revive a dead player, it disconnects them from the server, and the dead player gets "connection failed" where on the server it just says the left the game.  I have a funny feeling there's something out of check, and somewhere a destroy() might be getting called on the playerpawn when being revived?  Not sure but, here is the revive function:

Code: Select all

function bool RespawnMe(Actor Carc)
{

      local Inventory Inv;
      
      bMovable=True;
      SetCollision(True,True,True);
      Health=RandRange(10,26);
      bHidden=False;
      DrawType=DT_Mesh;
      ViewTarget=None;
      bBehindview=False;
      SetBase(Carc.Base);
      SetLocation(Carc.Location);
      ClientSetLocation(Carc.Location, Carc.Rotation);
      StartWalk();
      
      if(Region.Zone.bWaterZone) GoToState('PlayerSwimming');
      else { GoToState('PlayerWalking'); FeignDeath(); }


      
      Inv=Spawn(class'rInvHandler');
      if(Inv!=None)
      {
            Inv.GiveTo(Self);
            Pickup(Inv).PickupFunction(Self);
      } else return false;
      
      Inv=Spawn(class'RLMelee');
      if(Inv!=None)
      {
            Inv.GiveTo(Self);
            Weapon(Inv).BringUp();
      } else return false;


      
      return true;

}
Now that last line return true; changing that to a return false; fixes the disconnection issue, and the player gets revived, hooray, but then the other issue is that now the SuperHealth does not get used up, which is this code here in playerpawn as well:

in simulated function GrabDecoration()

Code: Select all

if(Carcass(A)!=None && Carcass(A).bPlayerCarcass)
    {
        if(FindInventoryType(class'rSuperHealth')!=None  && SelectedItem==FindInventoryType(class'rSuperHealth') && !FindInventoryType(class'rSuperHealth').bActive)
        {
            ForEach AllActors(class'RL_Player',P,A.Tag) if(P.Tag==A.Tag && (P!=Self) && P.Health
Last edited by Shivaxi on Fri Dec 30, 2016 3:04 am, edited 1 time in total.
Image  Image
User avatar
Shivaxi
OldUnreal Member
Posts: 2232
Joined: Wed Mar 08, 2006 4:43 pm

Re: RLCoop - Reviving kicks players from server

Post by Shivaxi »

Just realized the second part of that code above was commented out, and we're actually using this now:

Code: Select all

      if(RL_Player(A)!=None && RL_Player(A).Health
Last edited by Shivaxi on Fri Dec 30, 2016 3:18 am, edited 1 time in total.
Image  Image

Return to “UScript Board”