| Home Page | Recent Changes | Preferences

MultiPickupBase

UT2003 :: Actor >> xPickUpBase >> MultiPickupBase (Package: MultiPickup)

The MultiPickupBase is an xPickUpBase subclass similar to the WildcardBase which can spawn different types of pickups.

It was made for Chaos UT 2: Evolution by Wormbo to replace the limited MultiItem used in the UT version and add features similar to those available in the MultiPickupPlus class. All pickup types are supported and you can add as many as you like.

By default the first pickups is selected randomly, but you can also specify one of the pickups in the list. A new pickup will always be spawned after the current one has been picked up (after that pickup's RespawnTime), but you can also enable respawning after a certain time interval. In this case every pickup can have its own interval or use the default interval. The pickups can either be spawned in sequential or random order. In random order every pickup can have different chances to spawn. Pickups with a higher rating will spawn more often than those with a lower rating.

The MultiPickupBase is designed to work when placed in a map and when created by a mutator. See Using the MultiPickupBase In A Mutator below.

Download

Just extract the files to your UT2003\System directory and you're ready to use it.

http://www.koehler-homepage.de/Wormbo/MultiPickup.zip (15 kB)

Properties

PickUpBase Group (inherited from xPickUpBase)

class<Pickup> PowerUp
The initial value of this property is not used by the MultiPickupBase.
float SpawnHeight
With bNoVisibleBase=False pickups are spawned this distance above the pickup base. With bNoVisibleBase=True pickups are spawned this distance plus their CollisionHeight above the base.
class<Emitter> SpiralEmitter
This emitter is spawned for the pickup base unless bNoVisibleBase is set to True.

MultiPickupBase Group

bool bAllowReset
Advanced. Allows the gametype to reset the MultiPickupBase to its initial state when it resets the map.
bool bChangeOnlyOnPickup (protected)
Setting this to True will cause a behavior similar to the WildcardBase: A new pickup will only be spawned after the previous one was picked up. Setting it to False means that the pickup will be replaced after a certain amount of time if it didn't get picked up.
bool bNoVisibleBase
Hides the MultiPickupBase. Setting this to true causes the MultiPickupBase to be invisible and the SpiralEmitter will not be used. Also SpawnHeight works a bit differently. (see above)
bool bRandomAfterPickup
If set to True this will override the bSequential property if the previous pickup was picked up by a player. The next pickup will be selected randomly then. Using this only makes sense when bChangeOnlyOnPickup is set to False.
bool bSequential
This specifies whether new pickups should be spawned in the order they were listed. This doesn't affect the first pickup spawned.
bool bTriggerable
Allows the mapper to trigger this MultiPickupBase. It will spawn a new pickup when triggered, regardless whether the previous pickup is still there (that pickup will be removed first) or was picked up.
float DefaultDuration
The default duration for each pickup to stay around before another pickup is spawned. This has no effect if bChangeOnlyOnPickup is set to True.
float DefaultSpawnRating
The default spawn rating for each pickup. This will affect both the random initial pickup selection and the random selection after pickup or timeout.
array<PickupType> PickupTypes
Contains a list of pickups to spawn. You can set the PickupClass, Duration and SpawnRating for each pickup in the list. Both Duration and SpawnRating can be set to 0 to use the default duration or spawn rating respectively. See PickupType struct below.
class<Actor> RespawnEffectClass
This Actor will be spawned right before a new pickup is spawned. The default is UT2003's default respawn effect for pickups.
float RespawnEffectTime
After spawning the respawn effect the MultiPickupBase will wait for this amount of time to pass before actually spawning the pickup.
int StartingItem
Specifies, which pickup from the list is spawned when the map starts. Setting this to a negative value will randomly select a pickup from the list.

Internal Variables

float AdditionalRespawnWait (protected)
Used to store the remaining sleeping time of the old pickup if it is in Sleeping state when it should be replaced.
bool bDebugMode (localized)
The MultiPickupBase has a built-in debug mode which causes log file output for its more important functionality. To enable this mode simply create or open the file MultiPickup.int in your UT2003\System directory and put the following two lines in it:
[MultiPickupBase]
bDebugMode=True
bool bInitialized (protected)
Whether the first pickup was spawned.
bool bWasPickedUp (protected)
Set to true if the pickup should be replaced but was picked up already.
int CurrentClass (protected)
Currently selected pickup list index.
int NumClasses (protected)
Number of classes in the pickup list.
Pickup oldPickup (protected)
Temporary reference to the old pickup before it gets destroyed.

Structs

PickupType

float Duration
This specifies the duration in seconds the pickup stays available before it is replaced by another pickup if the MultiPickupBase is in "timed pickup change" mode. (bChangeOnlyOnPickup = False) Leave this 0 to use the DefaultDuration.
class<Pickup> PickupClass
The Pickup class to spawn.
float SpawnRating
A value greater than 0 that specifies, how often the pickup should be selected. A higher value (relative to the SpawnRatings of other pickups) means "spawn more often". Set this to 0 to use the DefaultSpawnRating.

Methods

Static Methods

These functions are designed to be called from other classes, e.g. Mutators, to create a new MultiPickupBase.

MultiPickupBase ConvertToMPB (Actor Other, optional string MPBClassName) [final]
Takes a Pickup or xPickupBase actor and converts it into a MultiPickupBase, which is returned. If the name of a MultiPickupBase class is specified, then that MultiPickupBase class is spawned and the original Pickup or the content of the xPickupBase is added to the new MultiPickupBase. This also works with a WildcardBase.
If no MultiPickupBase class is specified, then a MultiPickup.xMultiPickupBase is spawned.
MultiPickupBase ReplaceWithMPB (Actor Other, optional string MPBClassName) [final]
Takes a Pickup or xPickupBase actor and replaces it with a MultiPickupBase, which is returned. If the name of a MultiPickupBase class is specified, then that MultiPickupBase class is spawned, otherwise a MultiPickup.xMultiPickupBase is spawned.
If no MultiPickupBase class is specified, then a MultiPickup.xMultiPickupBase is spawned.

Public Methods

bool AddPickup (coerce string NewClassName, optional float NewDuration, optional float NewRating)
Adds an item to this MultiPickupBase. A new item will only be added if it isn't present in the list.
Returns true if the item already was in the list or was added successfully. (Used by mutators.)
bool ItemIsIn (class<Pickup> TestClass)
Returns, whether a pickup class is already in this MultiPickupBase's list. Can be used by mutators to prevent adding items twice.
SetChangeOnlyOnPickup (bool bNewChangeMode)
bool GetChangeOnlyOnPickup ( )
Accessor methods for bChangeOnlyOnPickup.
Trigger (Actor Other, Pawn EventInstigator)
Inherited from Actor. The MultiPickupBase can be triggered to immediately spawn a new pickup.
Reset ( )
Inherited from Actor. Resets the MultiPickupBase to its initial state.

Using the MultiPickupBase

...in a Map

First make sure the MultiPickup package is loaded by either adding it to the EditPackage list in UT2003.ini or by manualy loading MultiPickup.u from the Actor Classes browser.

To use MultiPickupBase just place it in the map like you would place any other pickup base. Unlike the WildcardBase a MultiPickupBase initialy doesn't have any pickups in its list, so open its Actor Properties and go to the MultiPickupBase group to add pickups and change other options.

...in a Mutator

MultiPickupBases have their bStatic property set to true, i.e. they can't be spawned from a mutator. The MultiPickup package offers a special notplaceable subclass (xMultiPickupBase) with bStatic set to false which can be spawned from mutators, but won't work if directly placed in a map.

You should extract the MultiPickup package's source code and have a look at the MPBMutator class. The functions CheckPickupBase and CheckPickup illustrate the usage of basic features of the MultiPickupBase class. You can see that the MultiPickupBase can also be used for pickups that didn't have a pickup base.

To test the MPBMutator just create or open the file MultiPickup.int in your UT2003\System directory and add

[Public]
Object=(Class=Class,MetaClass=Engine.Mutator,Name=MultiPickup.MPBMutator)

to make the mutator appear in the mutator list. It will change three things:

  • Add the Redeemer to the pickup base spawning the Ion Painter
  • Minigun ammo and grenade ammo will both spawn at both pickups' locations
  • The Shock Rifle will also spawn at the Link Gun's location (to demonstrate WeaponsStay behavior)

You might want to enable the MultiPickupBase's debug mode when making mods using the MultiPickupBase to get additional information about what's going on.

Known Subclasses

  • xMultiPickupBase (only used for mutators)

Related Topics


Category Class (UT2003)
Category Custom Class

The Unreal Engine Documentation Site

Wiki Community

Topic Categories

Image Uploads

Random Page

Recent Changes

Offline Wiki

Unreal Engine

Console Commands

Terminology

Mapping Topics

Mapping Lessons

UnrealEd Interface

Questions&Answers

Scripting Topics

Scripting Lessons

Making Mods

Class Tree

Questions&Answers

Modeling Topics

Questions&Answers

Log In