Author Topic: Making sure all remains are deleted, every time  (Read 383 times)

Legacy_QlippothVI

  • Full Member
  • ***
  • Posts: 197
  • Karma: +0/-0
Making sure all remains are deleted, every time
« on: June 23, 2012, 09:06:59 am »


               In Harvest of Souls loot bags are cause issues, since the game is rarely shorter than a half hour and if you play the whole game out we're talking days. As war rages in the module and loot bags accumulate gradually slowing the server or game more and more I'm looking for a way to eliminate them after so many minutes.

I added the Lootcorpse system, but it doesn't delete the bags or remains all of the time. This might have to do with no PC being present in the area, or even anywhere in the game if it is a server.

Is there any foolproof way of causing Lootcorpse to behave dependably? Otherwise I need to eliminate drops of any kind, and that's part fo the game...

I suppose I might be able to award any loot to the winning creature (faction) of any conflict. But random drops are rare and exciting in the game as it is designed. And I want the lootable corpses of creatures to last for several minutes.

 - Qlippoth ':blush:'
               
               

               
            

Legacy_SHOVA

  • Hero Member
  • *****
  • Posts: 893
  • Karma: +0/-0
Making sure all remains are deleted, every time
« Reply #1 on: June 23, 2012, 10:24:58 pm »


               Without having the option in Lootcorpse, your going to have to implement a clean area script, of some kind. There are several on the vault, best ones count PC in area, when no PC in area, clean after (Set time).

the other way to deal with your issue, what is dropping loot, that no one wants? Why not remove the creatures loot? Or exchange it for Loot they do want?
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Making sure all remains are deleted, every time
« Reply #2 on: June 24, 2012, 12:51:55 am »


               what i use to clean up lootbags is heartbeat on placeable - since the placeable can be destroyed you can turn the heartbeat on and off again if there are no playrs for example, but the placeable have to be only once in module so its absolutely okay

int GetIsPCInArea(object oArea)//zjisti pocet hracu v lokaci
{
object oPC = GetFirstPC();
 while(GetIsObjectValid(oPC))
 {
  if(GetArea(oPC) == oArea)
  {
  return TRUE;
  }
 oPC = GetNextPC();
 }
return FALSE;
}

void main()
{
int nTh = 1;
object oArea,oItem, oTrash = GetObjectByTag("BodyBag");
 while(GetIsObjectValid(oTrash))
 {
 oArea = GetArea(oTrash);
  if(GetIsObjectValid(oArea))
  {
   if(!GetIsPCInArea(oArea))
   {
   oItem = GetFirstItemInInventory(oTrash);
    while(GetIsObjectValid(oItem))
    {
    DestroyObject(oItem);
    oItem = GetNextItemInInventory(oTrash);
    }
   }
  }
 oTrash = GetObjectByTag("BodyBag",nTh++);
 }
}


the way it works is that it found each lootbag in any area and if there are no players it destroys the lootbag
               
               

               


                     Modifié par ShaDoOoW, 23 juin 2012 - 11:54 .
                     
                  


            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Making sure all remains are deleted, every time
« Reply #3 on: June 24, 2012, 03:04:59 am »


               

ShaDoOoW wrote...

the way it works is that it found each lootbag in any area and if there are no players it destroys the lootbag


Question:

If the leave lootable corpse option is set, Does the  lootable corpse  have a tag of "bodybag"  or is its tag the same as the creature that was kiled. 

Same question for the leave  raisable  corpse option.
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Making sure all remains are deleted, every time
« Reply #4 on: June 24, 2012, 03:13:24 am »


               

Lightfoot8 wrote...

ShaDoOoW wrote...

the way it works is that it found each lootbag in any area and if there are no players it destroys the lootbag


Question:

If the leave lootable corpse option is set, Does the  lootable corpse  have a tag of "bodybag"  or is its tag the same as the creature that was kiled. 

Same question for the leave  raisable  corpse option.

dont know, neither i know how lootable corpse system works and if it clean it.

The script above is made for default bags with loot remaining after killed monsters.
               
               

               
            

Legacy_QlippothVI

  • Full Member
  • ***
  • Posts: 197
  • Karma: +0/-0
Making sure all remains are deleted, every time
« Reply #5 on: June 25, 2012, 04:32:59 am »


               The Lootcorpse script leaves a "corpse" container sunken into the ground. I picked the script because I was under the impression it would delete everything. The thing is, it DOES delete everything, but apparently not all of the time, like when a PC isn't present. If this strange corner case happens it leaves a loot bag "remains" like a non-lootscript module...

Maybe there are too many of these events hapening nd I'm hitting a TMI at the time? It seems that sometimes I show up where a creature has died, and I get a lotcorpse body to appear, but a remains lootbag instead of a lootcorpse containr "Corpse"... Or a dead body but nothing else, no lootbag or Corpse placable whatsoever...

 - Qlippoth '<img'>
               
               

               


                     Modifié par QlippothVI, 25 juin 2012 - 03:38 .
                     
                  


            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Making sure all remains are deleted, every time
« Reply #6 on: June 25, 2012, 05:27:26 am »


               Well, once again, I have no Idea how to help you.   I have no Idea what the  The Lootcorpse script is.

You really should post the Script or a link to the system you are talking about, when asking for help.  

I get so tired of asking,  that a lot of the time when it is assumed that the readers just somehow knows about the system.  I just ingnore the thread.   Since I have never heard of the system the Question was obviously not meant for me.
               
               

               
            

Legacy_ShadowM

  • Hero Member
  • *****
  • Posts: 1373
  • Karma: +0/-0
Making sure all remains are deleted, every time
« Reply #7 on: June 25, 2012, 06:17:59 am »


               QlippothVI are you talking about the old lootcorpse system that uses placables? It was a old system before they even put in the box leave lootable corpse in the toolset. I took it and modified it a great deal and use it in HR base. I never had a problem of it leaving items around unless they were plot. But anyhow why not just have a flush call (like whenever x event happens you flush the areas?)
               
               

               


                     Modifié par ShadowM, 25 juin 2012 - 05:21 .
                     
                  


            

Legacy_QlippothVI

  • Full Member
  • ***
  • Posts: 197
  • Karma: +0/-0
Making sure all remains are deleted, every time
« Reply #8 on: June 25, 2012, 06:35:58 am »


               Ah, sorry. You are quite right. This is Lootable Corpses 3.3 (updated Keron Blackfeld's script):http://nwvault.ign.com/View.php?view=Scripts.Detail&id=2037

I attempted to paste the system scripts in here but it gets all garbled... I miss the good old script method from the old boards. How do I post a script on this forum?

I'll have to perform some tests on HoS, I suspect I'm just running out of time due to all the events with all the creatures doing stuff that the Lootcorpse script gets starved out. I need to disable every living thing I don't need and see if I still have issues.

 - Qlippoth
               
               

               


                     Modifié par QlippothVI, 27 juin 2012 - 04:06 .
                     
                  


            

Legacy_Supreme_Pizza

  • Jr. Member
  • **
  • Posts: 90
  • Karma: +0/-0
Making sure all remains are deleted, every time
« Reply #9 on: January 16, 2013, 07:18:14 am »


               areacleanup.nss


[i]/* areacleanup script
checks the area that it was called for for the presence of pc's,
if there aren't any then it systematically cleans up the area
of extra encounters and loot
*/
void debug(string dstring)
{
    int isdebug = 0;
    if (isdebug == 1)
        SendMessageToPC(GetFirstPC(), dstring);
}



void TrashObject(object oObject)
{
    debug(GetTag(oObject) + " is in trashobject");
    if (GetObjectType(oObject) == OBJECT_TYPE_PLACEABLE) {
        object oItem = GetFirstItemInInventory(oObject);
        while (GetIsObjectValid(oItem))
        {
            debug(GetTag(oItem) + " is in trashobject");
            TrashObject(oItem);
           oItem = GetNextItemInInventory(oObject);
        }
    }
    else
        debug(GetTag(oObject) + " failed to pass as inventory type placeable is getting destroyed");
    AssignCommand(oObject, SetIsDestroyable(TRUE, FALSE, FALSE));
    DestroyObject(oObject);
}

void main()
{
    object oPC;
    oPC = GetFirstPC();
    object tPC = oPC;
    debug("We're starting area cleanup");
    while (oPC != OBJECT_INVALID)
    {
        if (OBJECT_SELF == GetArea(oPC))
            return;
        else oPC = GetNextPC();
    }
    object oObject = GetFirstObjectInArea(OBJECT_SELF);
    while (oObject != OBJECT_INVALID)
    {
        debug(GetTag(oObject));
        if (GetIsEncounterCreature(oObject) && FindSubString(GetTag(oObject), "_BOSS") > -1)
            DestroyObject(oObject);
        int iObjectType = GetObjectType(oObject);
        switch (iObjectType) {
        case OBJECT_TYPE_PLACEABLE:
            if (GetTag(oObject) != "BodyBag") {
                break; }
        case OBJECT_TYPE_ITEM:
            TrashObject(oObject); }
        oObject = GetNextObjectInArea(OBJECT_SELF);
    }
}[/i]

then place this on area exit event / under area properties


[i]/* onexit script:
This script is placed in the onexit event handler for each area.
Its purpose is to check for the presence of remaining pc's in
and area and if it finds none then it activates a delayed call
to an areacleanup script which cleans the area
*/

void main()
{
    float cleanupdelay = 30.0;  //if you change this it alters how long before
    // the area cleans up, if you do change it INCLUDE THE DECIMAL, or it won't
    // work
    if(!GetIsPC(GetExitingObject()) ) {
        return; }
    object oPC = GetExitingObject();
    if (!GetIsPC(oPC))
        return;
    oPC = GetFirstPC();
    while (oPC != OBJECT_INVALID)
    {
        if (OBJECT_SELF == GetArea(oPC))
            return;
        else oPC = GetNextPC();
    }
    DelayCommand(cleanupdelay, ExecuteScript("areacleanup", OBJECT_SELF));
}[/i]

Don't run a heartbeat script. It just is not necessary.
               
               

               


                     Modifié par Supreme_Pizza, 16 janvier 2013 - 07:18 .