Page 1 of 1

Start off inventory

PostPosted: Tue Jan 09, 07 6:33 pm
by Spiderbot01
You know in DXSP, you start off with a pistol, electric prod and a medkit, how do you do this in UnrealEd?

Also, you know in the MJ12 Lab connected to UNATCO, you get your inventory yoinked off you, but if you go to the armory its there, how do you do that?

PostPosted: Tue Jan 09, 07 7:07 pm
by Dae
You know in DXSP, you start off with a pistol, electric prod and a medkit, how do you do this in UnrealEd?

As far as I remember, MissionScript is responsible for that. For multiplayer maps you will definitely need another solution.

Re: Start off inventory

PostPosted: Tue Jan 09, 07 7:07 pm
by MainMan
Longc[A]t wrote:You know in DXSP, you start off with a pistol, electric prod and a medkit, how do you do this in UnrealEd?
It's in function GiveInitialInventory() in DeusExPlayer.uc - it checks whether it is a singleplayer game or it is a MPgame with bStartWithPistol as true, and if yes to either, then it gives you that stuff. No way of doing it through UEd - it's code.

Longc[A]t wrote:Also, you know in the MJ12 Lab connected to UNATCO, you get your inventory yoinked off you, but if you go to the armory its there, how do you do that?

Check the MissionScript for that level.

PostPosted: Tue Jan 09, 07 8:56 pm
by Spiderbot01
I'm not doing it for MP, I rarely map MP anymore :P
Thanks anyway :]

PostPosted: Wed Jan 10, 07 6:10 am
by Allan
Code: Select all
      // remove the player's inventory and put it in a room
         if (Player.Inventory != None)
         {
            item      = Player.Inventory;
            nextItem  = None;

            foreach AllActors(class'SpawnPoint', SP)
            {
               // Find the next item we can process.
               while((item != None) && (item.IsA('NanoKeyRing') || (!item.bDisplayableInv)))
                  item = item.Inventory;

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

                  item.DropFrom(SP.Location);

                  // restore any ammo amounts for a weapon to default
                  if (item.IsA('Weapon') && (Weapon(item).AmmoType != None))
                     Weapon(item).PickupAmmoCount = Weapon(item).Default.PickupAmmoCount;
               }
               
               if (nextItem == None)
                  break;   
               else
                  item = nextItem;
            }


That's the (slightly edited) part of the code you'll need. It gets your inventory, and then looks for SpawnPoints in the map, for which to put it in. Interesting method.

PostPosted: Thu Jan 11, 07 10:42 am
by Spiderbot01
Leik another question.

Imma making a map for DX:MIB, and Ive got lots of police officers. Now is there anyway of looking through like the meaningless 'barks', i.e the ones that come up in an outlined box when you right click on someone, so I can assign them to some of the officers, so they don't just breathe at you?