Aller au contenu

Photo

Looting placeables multiple times


  • Veuillez vous connecter pour répondre
Aucune réponse à ce sujet

#1
sea-

sea-
  • Members
  • 264 messages
I've hit a small snag - I'm trying to create a placeable that refills itself and becomes lootable again at certain points if the player has already taken the items in it.

I've been able to get it to refill itself just fine using the following code:

void RefillHealthBarrel(object oObject)
{
    if (UT_CountItemInInventory(R"gen_im_qck_injury_101.uti", oObject) == 0)
    {
        UT_AddItemToInventory(R"gen_im_qck_injury_101.uti", 2, oObject);
    }
}

Easy, peasy.

The problem is that the placeable can't be looted anymore - it has a loot glint and can be selected, but clicking on it does absolutely nothing. I've examined the core scripts and haven't found any clear bit of information suggesting exactly what the problem is - my guess it has something to do with the SendEventOpened() command setting a variable on the placeable, but I don't know how I'd reverse this.

Anyone have any ideas?

EDIT: Supplementary question. Anyone know how to remove corpses from an area? I have the following script to handle that, but it doesn't seem to work:

void DeadTeamCleanup(int nTeam)
{
    object[] oTeam = GetTeam(nTeam);

    int nSize = GetArraySize(oTeam);
    int index;

    for (index = 0; index < nSize; index++)
    {
        if (IsDead(oTeam[index]) == TRUE)
        {
            Safe_Destroy_Object(oTeam[index]);
        }
    }
}

Modifié par sea-, 28 juillet 2012 - 01:41 .