Remains/Creature Treasure



  • Does anybody know what the ResRef or tag of these things are? The treasure containers that are created when a creature is killed.



  • I don't know what the tag is but heres a script I wrote to destroy all the trash littering up areas on my module.

    It cycles through all the objects in the area and deletes it's contents and then deletes the container. I used the GetName(oTrash) == "Remains" because that's the name of the remains so it works 😛

    // Destroy all items/remains in area of oWP.
    void DespawnTrash(string sWP)
    {
    object oWP;
    object oArea;
    location lLocation;
    object oTrash;
    object oInvItem;
    oWP = GetWaypointByTag(sWP);
    lLocation = GetLocation(oWP);
    oArea = GetAreaFromLocation(lLocation);
    oTrash = GetFirstObjectInArea(oArea);
    while(GetIsObjectValid(oTrash))
    {
    string sTagPrefix = GetStringLeft(GetTag(oTrash), 15);
    if(GetObjectType(oTrash) == OBJECT_TYPE_ITEM || GetName(oTrash) == "Remains")
    {
    AssignCommand(oTrash, SetIsDestroyable(TRUE));
    if(GetHasInventory(oTrash))
    {
    oInvItem = GetFirstItemInInventory(oTrash);
    while(GetIsObjectValid(oInvItem))
    {
    DestroyObject(oInvItem,0.0);
    oInvItem = GetNextItemInInventory(oTrash);
    }
    }
    else
    {
    DestroyObject(oTrash, 0.0);
    }
    DestroyObject(oTrash, 0.0);
    }
    oTrash = GetNextObjectInArea(oArea);
    }

    }



  • Thanks buddy. We already have a script for this, I don't know if it was cancelled or doesnt run in some places or what. There are some issues with running it, like checking it really -should- run right then, so people don't lose out on loot they are about to pick up,m but those can be negated with further checks.


Log in to reply