Legacy:EnhancedItems/MultiPickupPlus - Unreal Wiki

# Legacy:EnhancedItems/MultiPickupPlus

### From Unreal Wiki, The Unreal Engine Documentation Site

< Legacy:EnhancedItems
UT :: Actor (UT) >> Inventory (UT) >> MultiPickupPlus (Package: EnhancedItems)

This class is part of the EnhancedItems package by Wormbo.

See MultiPickupBase for a UT2003 version of this custom class.

## Features

- spawns one of up to 20 different item classes
- the next item is chosen either randomly or in the order given in the Items array (see bRandomChoosing, RejectChance[])
- the next item is spawned after the previous one was picked up or a certein amount of time has passed (see bEmulateMultiItem, StopEmulation(), Duration[] and DefaultDuration)
- before the first item is spawned an initial interval of time set for this item has to pass (can be set individually for each item, can be zero)
- each Legacy:EnhancedItems/EnhancedMutator may change values after the MultiPickupPlus has been initialized through the mutator's CheckMPP() function

## Constants

MaxNumItems = 20
  Maximum number of items classes supported by the MultiPickupPlus.

## Properties

### Advanced Group

bool bNoEmulation (globalconfig)
  Whether MultiItem emulation is allowed or not. When this is true, bEmulateMultiItem and bEmulateWhenCoopMode have no effect. "MultiItem emulation" means, that spawned items should be swapped after some time if they didn't get picked up, like it's done by the Chaos UT MultiItem.

### MultiPickupPlus Group

bool bAllowItemFall
  Whether spawned items may have PHYS_Falling.
bool bAllowItemRotation
  Whether spawned items may rotate.
bool bEmulateMultiItem
  Enable "MultiItem emulation", i.e. swap out items that don't get picked up after a while.
bool bEmulateWhenCoopMode
  Enable MultiItem emulation for weapons when the "Weapons Stay" option (aka. coop weapon mode) is enabled. (recommended)
bool bForceItemFall
  Force PHYS_Falling on newly spawned items.
bool bForceItemRotation
  Force the newly spawned item's bRotatingPickup property to be set to True.
bool bNoMutatorCheck
  Don't let any mutator receive CheckMPP() calls from this MultiPickupPlus.
bool bRandomChoosing
  Select items randomly from the Items list.
float DefaultDuration
  Default duration items stay around in MultiItem emulation mode.
float Duration[20]
  Duration for each item.
float InitRespawnTime[20]
  Initial spawn delay for each item type.
class<Inventory (UT)> Item[20]
  The item classes this MultiPickupBase should spawn.
vector LocationOffset[20]
  Location offsets for each item type. (allowes to compensate differnt item sizes, although this usually should be neccessary)
int NumItems
  Number of slots used. This will be clamped to the actual number of items in the MultiPickupBase if it's higher that that, but it will also remove any items with a higher index.
float RejectChance[20]
  Chance for an item to get rejected when randomly selecting the next item chass.
class<Inventory (UT)> ReplacedItem
  The item that was originally in the location the MultiPickupBase now occupies. This is usually only used when a mutator has replayed that item with the MultiPickupBase.

### Internal Variables

bool bDebugMode
  Enables debug logging. Set to the value of Legacy:EnhancedItems/PickupPlus.bDebugMode in PreBeginPlay().
bool bNotified
  Set to True after all mutators have been notified about the new MultiPickupPlus.
bool bStarted
  Set to True after the first item has been spawned.
int CheckCounter
  Used to detect infinite loops while choosing a new item to spawn.
Mutator (UT) CreatedBy
  Reference to the mutator that spawned this MultiPickupPlus. This Legacy:EnhancedItems/EnhancedMutator or Legacy:EnhancedItems/EnhancedArena will not receive a CheckMPP() call by the MultiPickupPlus.
Inventory (UT) CurItem
  Item currently spawned.
int CurItemIndex
  Index of currently selected item.
float CurTime
  How long the currently spawned item is already there.
byte ImportedFromMI[20]
  Contains 1 for every item imported from a Chaos UT MultiItem by the Legacy:EnhancedItems/MIConverter.
int PrevItemIndex
  Index of item spawned before the current item.

## Methods

### Inherited From Actor (UT)

PreBeginPlay( )
  Initializes the MultiPickupPlus, checks its location in the world and Compact()s the Items list.

### Inherited From Inventory (UT)

float BotDesireability(Pawn (UT) Bot)

### New Functions

bool AddItem(coerce string NewItem, optional vector NewItemOffset, optional float NewInitTime, optional float NewChance, optional float NDuration)
  Add a new item class to the MultiPickupPlus.
vector AdjustLocation(int ItemIndex)
  Returns the spawn location for the specified item index.
bool AlwaysKeep(class<Inventory> ItemClass)
  Returns, whether an item should be kept in the Items list. Sends AlwaysKeepInMPP() calls to all Legacy:EnhancedItems/EnhancedMutators and Legacy:EnhancedItems/EnhancedArena mutators and returns True as soon as one of them returns True.
bool AnyClassIsA(coerce string LookFor, out int Index, optional bool bCheckReplaced)
  Returns True if any of the classes in the MultiPickupPlus is of the specified type using the ClassIsA() function.
CheckLocation( )
  Adjusts the MultiPickupPlus' location so it won't try to spawn items inside world geometry. This is neccessary because sometimes it doesn't properly fit into a replaced item's location.
bool ClassIsA(class aClass, coerce string DesiredType)
  Returns whether a class is of a specified type.
Compact( )
  Removes empty slots in the Items list.
DisableCoopMode( )
  Disables "Weapons Stay" mode.
bool FindItem(name LookFor, out int Index, optional bool bIdenticalClasses, optional bool bCheckReplaced )
  Returns True if the specified item type is found.
bool InItem(class<Inventory> LookFor, out int Index, optional bool bSubClasses, optional bool bCheckReplaced )
  Returns True if the specified item type is found.
class<Inventory> LoadItem(coerce string ItemClass)
  Tries to load the specified Inventory (UT) class and returns it on success.
NotifyMutators( )
  Sends CheckMPP() calls to all Legacy:EnhancedItems/EnhancedMutators and Legacy:EnhancedItems/EnhancedArenas except the mutator that spawned this MultiPickupPlus.
bool RemoveItem(int ItemIndex)
  Removes an item from the MultiPickupPlus.
bool ReplaceItem(int ItemIndex, coerce string NewItem, optional vector NewItemOffset, optional float InitTime, optional float Chance, optional float NDuration, optional bool AlwaysAdd )
StopEmulation( )
  Stops MultiItem emulation.

## Known Subclasses

- ArrowPackMPP (Enhanced Chaos Item)
- RandomRocketMPP (RocketsUT)

(Most MPPs in EnhancedItems-based mods are generated on-the-fly.)

Category: Legacy Custom Class (UT)

##### Views

- Legacy
- Discussion
- Current revision

##### Search