Getting your stuff back when you rejoin.

The best and quickest support by a group of top-notch editing specialists, guaranteed!

Moderator: Forum Guards

Getting your stuff back when you rejoin.

Postby Poor » Wed Jan 25, 12 5:00 pm

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.
Poor
Poster
 
Posts: 190
Joined: Tue Jan 04, 11 7:42 pm

Postby atrey65789 » Wed Jan 25, 12 11:18 pm

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
-A
atrey65789
Regular
 
Posts: 400
Joined: Thu Dec 22, 11 3:02 pm

Postby Alex » Wed Jan 25, 12 11:24 pm

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.
Alex
Alpha
 
Posts: 8067
Joined: Wed Nov 12, 03 4:51 pm

Postby Poor » Thu Jan 26, 12 12:19 am

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.
Poor
Poster
 
Posts: 190
Joined: Tue Jan 04, 11 7:42 pm

Postby ~ô¿ô~Nobody~ » Mon Jan 30, 12 10:56 am

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
Nobody is perfect...
------------------------------
Longc[A]t wrote:I still think Dae is a russian spambot.

~[A]Daedalus~ wrote:There will be a day when my patience goes away and you, along with all who rant with you, will get banned.

ô¿ô¥[GODZ]¥NOCHANC wrote:I can ban any one I want ANY time I want. You have no rights here.
User avatar
~ô¿ô~Nobody~
Alpha
 
Posts: 2520
Joined: Fri Dec 31, 04 3:20 pm
Location: Proclarush Taonas

Postby ~DJ~ » Thu Feb 02, 12 1:15 am

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:
User avatar
~DJ~
Forum Super Hero
 
Posts: 3766
Joined: Tue May 22, 07 12:23 pm

Postby Poor » Thu Feb 02, 12 3:08 am

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.
Poor
Poster
 
Posts: 190
Joined: Tue Jan 04, 11 7:42 pm

Postby ~DJ~ » Thu Feb 02, 12 6:16 am

Alright, thanks... so do I create a new MTLManager now or what.. overriding the v15 function? :?
User avatar
~DJ~
Forum Super Hero
 
Posts: 3766
Joined: Tue May 22, 07 12:23 pm

Postby Poor » Thu Feb 02, 12 2:58 pm

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();
}
Poor
Poster
 
Posts: 190
Joined: Tue Jan 04, 11 7:42 pm

Postby ~DJ~ » Thu Feb 02, 12 3:02 pm

Thanks for that Poor, I'll try it out ASAP :D
EDIT: Awesome, thanks! it works! :)
Last edited by ~DJ~ on Thu Feb 02, 12 3:06 pm, edited 1 time in total.
User avatar
~DJ~
Forum Super Hero
 
Posts: 3766
Joined: Tue May 22, 07 12:23 pm


Return to Editing issues

Who is online

Users browsing this forum: No registered users and 20 guests
cron