Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ SMAUG ➜ SMAUG coding ➜ Corpse making

Corpse making

It is now over 60 days since the last post. This thread is closed.     Refresh page


Pages: 1  2 3  

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #15 on Sat 08 Jul 2006 08:34 PM (UTC)
Message
I didn't say remove the ifcheck. I'm saying do this:
        if (!IS_NPC(ch) && obj->wear_loc != -1)
{
        obj_from_char( obj );
               continue;
}


Unless I still don't understand what you mean.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Metsuro   USA  (389 posts)  Bio
Date Reply #16 on Sat 08 Jul 2006 09:34 PM (UTC)

Amended on Sat 08 Jul 2006 10:15 PM (UTC) by Metsuro

Message
From what I can tell that still removes the obj from the player and then "loses" it not going to the corpse or the player...

Everything turns around in the end
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #17 on Sat 08 Jul 2006 09:37 PM (UTC)
Message
Sorry, I meant obj_from_obj. I did say to the corpse. Make sure obj_from_char is already done.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Gohan_TheDragonball   USA  (183 posts)  Bio
Date Reply #18 on Sat 08 Jul 2006 10:08 PM (UTC)

Amended on Sat 08 Jul 2006 10:09 PM (UTC) by Gohan_TheDragonball

Message
you actually need to modify the code in two different places, both in the make_corpses() function and in the extract_char() function, as smaug code does the following:

player killed->make corpse->extract character

so anything you let the character keep instead of going to the corpse will instead be purged all together. what you need to do is open up handler.c and modify the extract_char() function.


    if ( !fPull )
    {
        location = NULL;

        for ( obj = ch->first_carrying; obj; obj = obj_next )
        {
            obj_next = obj->next_content;
            if ( obj->wear_loc != -1 )
                continue;
            obj_from_char( obj );
            extract_obj( obj );
        }


I am not exactly sure how this function used to look, but this is how you will want it to look. Just make sure you're modifying the section under the fPull ifcheck.
Top

Posted by Metsuro   USA  (389 posts)  Bio
Date Reply #19 on Sat 08 Jul 2006 10:38 PM (UTC)
Message
Well this is one step closer.


   if( !fPull )
   {
      location = NULL;

     for ( obj = ch->first_carrying; obj; obj = obj_next )
      {
            obj_next = obj->next_content;
            if ( obj->wear_loc != -1 )
                continue;
            obj_from_char( obj );
            extract_obj( obj );
      }

      if( !IS_NPC( ch ) && ch->pcdata->clan )
         location = get_room_index( ch->pcdata->clan->recall );

      if( !location )
         location = get_room_index( ROOM_VNUM_ALTAR );

      if( !location )
         location = get_room_index( 1 );

      char_to_room( ch, location );


and


   for( obj = ch->first_carrying; obj; obj = obj_next )
   {
      obj_next = obj->next_content;
      if (!IS_NPC(ch) && obj->wear_loc != -1)
        continue;
      obj_from_char( obj );
      if( IS_OBJ_STAT( obj, ITEM_INVENTORY ) || IS_OBJ_STAT( obj, ITEM_DEATHROT$
         extract_obj( obj );
      else
         obj_to_obj( obj, corpse );
   }


this is what I have now it does still lose everything the player was wearing... now at least the inventory is moved to the corpse.

Everything turns around in the end
Top

Posted by Metsuro   USA  (389 posts)  Bio
Date Reply #20 on Sun 09 Jul 2006 09:22 PM (UTC)
Message
   xREMOVE_BIT( ch->act, ACT_MOUNTED );

   while( ( obj = ch->last_carrying ) != NULL )
      extract_obj( obj );

   char_from_room( ch );


well I finally noticed that this was right above the if check for !fPull, so I commented out just the while thing and it seems to work properly

Everything turns around in the end
Top

Posted by Gohan_TheDragonball   USA  (183 posts)  Bio
Date Reply #21 on Wed 12 Jul 2006 08:35 PM (UTC)
Message
umm no, you do not want to comment that out, move it below the ifcheck, you don't want all those objects remaining when a player quits, they need to be extracted
Top

Posted by Metsuro   USA  (389 posts)  Bio
Date Reply #22 on Wed 12 Jul 2006 11:41 PM (UTC)
Message
Doesn't your suggestion of adding...

     for ( obj = ch->first_carrying; obj; obj = obj_next )
      {
            obj_next = obj->next_content;
            if ( obj->wear_loc != -1 )
                continue;
            obj_from_char( obj );
            extract_obj( obj );
      }


doesn't it do what the while does already? so what would be the point of adding it once more? and as of right now I havn't seen any problem with duplicated eq, or even lose of eq after dying or quitting? so many I am just missing something, or that your suggestion already does this for me?

Everything turns around in the end
Top

Posted by Gohan_TheDragonball   USA  (183 posts)  Bio
Date Reply #23 on Thu 13 Jul 2006 04:44 AM (UTC)
Message
no that would only extract the objects when a player dies, however when a player quits fPull is true, so that portion would not be run, and its not really an issue of players getting items duplicated, its more the item remain in memory, take a look at your MEMORY command to see how many actual items are loaded in the game, if you do not extract the objects from memory when a player quits, that amount will grow and grow. though truthfully i know not what that would do in the short term, but if your mud is stable and doesn't crash all too often a problem might arise.
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #24 on Thu 13 Jul 2006 05:01 AM (UTC)
Message
It would really mess up item counts, since the object would basically be floating in space, not in any room, inventory, container, etc. Rare items based on item-count would be affected, for example.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Metsuro   USA  (389 posts)  Bio
Date Reply #25 on Thu 13 Jul 2006 08:38 AM (UTC)
Message
having this in causes everything a player is wearing to be removed, And then only places the inventory in the corpse, but removes all eq worn, removing this however doesn't do it. So either i'm missing something far off or what.

Everything turns around in the end
Top

Posted by Metsuro   USA  (389 posts)  Bio
Date Reply #26 on Thu 13 Jul 2006 09:22 AM (UTC)
Message
well I just changed extract_char, to the new_extract_char from dbsc copies, adding a bool death at the end, and then adding an if check before the while.

Everything turns around in the end
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #27 on Thu 13 Jul 2006 12:55 PM (UTC)
Message
I think you need to slow down a bit and learn what these functions are actually doing, how, and why. I have the impression that you're making changes almost randomly, throwing in lines and seeing what happens. That will only cause trouble further down the line. Take the time to learn a bit before charging ahead, and you will get much more out of the exercise.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Metsuro   USA  (389 posts)  Bio
Date Reply #28 on Thu 13 Jul 2006 03:26 PM (UTC)
Message
the changes I made I understand what its doing. Its tacking on an extra arguement, so that you can declare if you died or not. now, in the other copy they use

#define extract_char( ch, fPull ) new_extract_char( ch, fPull, FALSE)

which will return the bool death, false right, every time extract_char is called. however when new_extract_char is called with the last being TRUE then...

   if( !death )
   {
      while( ( obj = ch->last_carrying ) != NULL )
      extract_obj( obj );
   }


only work on logout, and not on death. Which then stops the memory problem right? but doesn't remove the eq on death correct? Sometimes I seem random sometimes I dont, it usually depends on how tired I am... heh... sorry.

Everything turns around in the end
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #29 on Thu 13 Jul 2006 03:32 PM (UTC)
Message
It's basically impossible for us to say what is going to happen when we don't know what exactly has been changed and we see bits of code here and there. I mean, sure, for the code you posted, it looks like if the variable death is false, every one of the character's objects will be extracted. Whether or not this actually does what you want it to do in the greater scheme of things is a good question. It depends on when 'death' is set to true or false, and what you have changed in other places of the code.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


100,993 views.

This is page 2, subject is 3 pages long:  [Previous page]  1  2 3  [Next page]

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.