Page 1 of 1

Can a zoneinfo destroy a player's inventory?

PostPosted: Sun May 13, 12 6:18 pm
by RedDynasty
Does anyone know if there is an actor that can delete the player's inventory?
I know that the map duskofhorrors had one but i dont know where to get one
Die mentioned a property in the zoneinfo class called bnoinventory, i tried this but it didnt delete my inventory

PostPosted: Mon May 14, 12 2:45 pm
by RedDynasty
anyone..?

PostPosted: Mon May 14, 12 4:15 pm
by Dae
How was it implemented in singleplayer training missions?

PostPosted: Mon May 14, 12 4:18 pm
by Poor
You would need a custom ZoneInfo.

PostPosted: Mon May 14, 12 5:33 pm
by RedDynasty
I think the training mission is a flag not an actor and if its a flag u cant use it in mp( i need it for a mp map, but for testing i also need it for sp, which means i need a working actor that can delete inventory in both sp and mp)
Also poor, do you know how can i get one? or make one?

PostPosted: Mon May 14, 12 7:09 pm
by Poor
I took the code from the training mission and put it in a zoneinfo class. I didn't test it.

Code: Select all
class NoInventoryZone extends ZoneInfo;

event ActorEntered(actor Other)
{
   Super.ActorEntered(Other);

   if(Other.IsA('DeusExPlayer'))
      RemovePlayerInventory(DeusExPlayer(Other));
}

function RemovePlayerInventory(DeusExPlayer Player)
{
   local Inventory item, nextItem, lastItem;

   if (Player.Inventory != None)
   {
      item = Player.Inventory;
      nextItem = item.Inventory;
      lastItem = item;

      do
      {
         if ((item != None) && item.bDisplayableInv || item.IsA('Ammo'))
         {
            // make sure everything is turned off
            if (item.IsA('DeusExWeapon'))
            {
               DeusExWeapon(item).ScopeOff();
               DeusExWeapon(item).LaserOff();
            }
            if (item.IsA('DeusExPickup'))
            {
               if (DeusExPickup(item).bActive)
                  DeusExPickup(item).Activate();
            }

            if (item.IsA('ChargedPickup'))
               Player.RemoveChargedDisplay(ChargedPickup(item));

            Player.DeleteInventory(item);
            item.Destroy();
            item = Player.Inventory;
         }
         else
            item = nextItem;

         if (item != None)
            nextItem = item.Inventory;
      }
      until ((item == None) || (item == lastItem));
   }
}

PostPosted: Mon May 14, 12 7:20 pm
by RedDynasty
nope its not working :S
maybe im using the zone wrong?
u just put it near the place u want for players to lose their inventory right?

PostPosted: Mon May 14, 12 8:39 pm
by Poor
I checked it and it works. Though you can get around it by throwing weapons into the zone.

You have to zone off an area and place a NoInventoryZone in it. Make sure no other zoneinfo's are in the zone, which includes LevelInfo, WaterZone, WarpZoneInfo, and SkyZoneInfo.

If you want something with a radius instead of an entire zone then you need something else.

PostPosted: Mon May 14, 12 8:42 pm
by RedDynasty
So how do i zone off an area?
What i want is when a player goes through a small area with an NoInventoryZone in it, they lose all their inventory( similar like ur cagematch effect where only the players inside the cage get their inventory destroyed)
Also what do i need for the radius?

PostPosted: Tue May 15, 12 8:41 pm
by RedDynasty
Well i tried using the same method as adding a pain zone( used tacks tutorial) and it didnt work :S
I might be doing something wrong.

PostPosted: Tue May 15, 12 10:17 pm
by Alex
Poor wrote:I checked it and it works. Though you can get around it by throwing weapons into the zone.


That can be fixed by setting the bNoInventory variable, as mentioned in the start post. It sets a lifespan of 1.5 on all items in the zone.

PostPosted: Wed May 16, 12 1:02 pm
by RedDynasty
Everyone thanks for your help, i figured out the problem, i was using the zones wrong, it works perfectly.
Also, alex is right, u need to put bnoinventory to true, otherwise it will only destroy dropped weapons.
1 last question, will this work on mp?

PostPosted: Wed May 16, 12 5:57 pm
by Dae
RedDynasty wrote: 1 last question, will this work on mp?

Why don't you want to test it yourself?