Page 1 of 1

Getting your stuff back when you rejoin.

PostPosted: Wed Jan 25, 12 5:00 pm
by Poor
Does anyone know what is responsible for giving a player his inventory, skills, and augs back when he leaves a game and comes back? It seems to be a MTL feature. I want to preserve some additional properties.

PostPosted: Wed Jan 25, 12 11:18 pm
by atrey65789
Im not sure if its a feature, for me a majority of the time I leave a game and come back, my stuff is gone, but If I leave a game then quickly come back, then my stuff is still there. It may be a bug

PostPosted: Wed Jan 25, 12 11:24 pm
by Alex
Download the DXMTL source and then take a look at the V2E class. It's used when a player leaves & enters the server. This class is used within the MTLManager.

PostPosted: Thu Jan 26, 12 12:19 am
by Poor
That is definitely it. It doesn't look like I can extend it or override the functions because all the names are messed up but I'll try making a similar class that deals with the stuff I want. Thanks Alex.

PostPosted: Mon Jan 30, 12 10:56 am
by ~ô¿ô~Nobody~
You can make a mod extending DXMTL, using the MTL extension pack, which you can get here:
http://www.dxalpha.com/forum/viewtopic.php?t=17032

PostPosted: Thu Feb 02, 12 1:15 am
by ~DJ~
On a related note.. (SORRY FOR STEALING UR TOPIC)..
I'm trying to extend a modification to MTL.. but I want to remove all these storing features.. any clue how? I see no mention of that class you mentioned, Alex.. on the MTLPlayer.

halp pls thnx :oops:

PostPosted: Thu Feb 02, 12 3:08 am
by Poor
In the decompiled DXMTL you will find this line in MTLPlayer.Destroyed().

Code: Select all
V6F.V15(self);


V6F is the players MTLManager and V15 is the function that creates an object of V2E that retains stuff for the player. Things that are saved are scoreboard information, team, augmentations, skills, health, and inventory.

PostPosted: Thu Feb 02, 12 6:16 am
by ~DJ~
Alright, thanks... so do I create a new MTLManager now or what.. overriding the v15 function? :?

PostPosted: Thu Feb 02, 12 2:58 pm
by Poor
If you want nothing to be saved you could override the Destroyed function in your player class so it doesn't make the call that creates an object. You also need to change Super.Destroyed() to Super(Human).Destroyed() so it doesn't use the MTLPlayer function.

Code: Select all
simulated event Destroyed ()
{
   local ColorTheme V9C;

   if ( PlayerIsOnServer() )
   {
      /* Don't create a save object
      if ( (V6F != None) &&  !Level.Game.bGameEnded )
      {
         V6F.V15(self);
      }
      */
      if ( AugmentationSystem != None )
      {
         AugmentationSystem.Destroy();
      }
      if ( SkillSystem != None )
      {
         SkillSystem.Destroy();
      }
      if ( aDrone != None )
      {
         aDrone.Destroy();
      }
      if ( invulnSph != None )
      {
         invulnSph.Destroy();
      }
      if ( killProfile != None )
      {
         killProfile.Destroy();
      }
      if ( ThemeManager != None )
      {
         V9C=ThemeManager.FirstColorTheme;
JL00D5:
         if ( V9C != None )
         {
            V9C.Destroy();
            V9C=V9C.Next;
            goto JL00D5;
         }
         ThemeManager.Destroy();
      }
   }
   Super(Human).Destroyed();
}

PostPosted: Thu Feb 02, 12 3:02 pm
by ~DJ~
Thanks for that Poor, I'll try it out ASAP :D
EDIT: Awesome, thanks! it works! :)