I don't need to test my programs. I have an error-correcting modem.
UE3:InventoryManager (UT3)
Contents
- 1 Properties
- 2 Functions
- 2.1 Iterator functions
- 2.2 Exec functions
- 2.3 Events
- 2.4 Other instance functions
- 2.4.1 AddInventory
- 2.4.2 CancelWeaponChange
- 2.4.3 ChangedWeapon
- 2.4.4 ClientSyncWeapon
- 2.4.5 ClientWeaponSet
- 2.4.6 CreateInventory
- 2.4.7 DrawHud
- 2.4.8 GetBestWeapon
- 2.4.9 GetWeaponRatingFor
- 2.4.10 HandlePickupQuery
- 2.4.11 IsActiveWeapon
- 2.4.12 ModifyDamage
- 2.4.13 NextWeapon
- 2.4.14 OwnerEvent
- 2.4.15 PrevWeapon
- 2.4.16 RemoveFromInventory
- 2.4.17 ServerSetCurrentWeapon
- 2.4.18 SetCurrentWeapon
- 2.4.19 SetPendingWeapon
- 2.4.20 SetupFor
- 2.4.21 StartFire
- 2.4.22 StopFire
- 2.4.23 SwitchToBestWeapon
- Package:
- Engine
- Direct subclass:
- UTInventoryManager
- This class in other games:
- UDK
This is an auto-generated page and may need human attention. Please remove the {{autogenerated}} tag if the page seems reasonably complete or replace it with the {{expand}} tag if the page is not yet complete. |
InventoryManager Base class to manage Pawn's inventory This provides a simple interface to control and interact with the Pawn's inventory, such as weapons, items and ammunition. Copyright 1998-2007 Epic Games, Inc. All Rights Reserved.
Properties[edit]
bMustHoldWeapon[edit]
Type: bool
if true, don't allow player to put down weapon without switching to another one
InventoryChain[edit]
Type: Inventory
First inventory item in inventory linked list
LastAttemptedSwitchToWeapon[edit]
Type: Weapon
PendingFire[edit]
Holds the current "Fire" status for both firing modes
PendingWeapon[edit]
Type: Weapon
Player will switch to PendingWeapon, once the current weapon has been put down.
Fixme: laurent -- PendingWeapon should be made protected, because too many bugs result by setting this variable directly. It's only safe to read it, but to change it, SetCurrentWeapon() should be used.
Default values[edit]
Property | Value |
---|---|
bHidden | True |
bOnlyDirtyReplication | True |
bOnlyRelevantToOwner | True |
bReplicateInstigator | True |
bReplicateMovement | False |
CollisionType | COLLIDE_CustomDefault |
NetPriority | 1.4 |
RemoteRole | ROLE_SimulatedProxy |
TickGroup | TG_DuringAsyncWork |
Functions[edit]
Iterator functions[edit]
InventoryActors[edit]
returns all Inventory Actors of class BaseClass
Parameters:
- BaseClass - Inventory actors returned are of, or childs of, this base class.
Output: Inv Inventory actors returned.
Note: this iterator bails if it encounters more than 100 items, since temporary loops in linked list may sometimes be created on network clients while link pointers are being replicated. For performance reasons you shouldn't have that many inventory items anyway.
Exec functions[edit]
DumpWeaponStats[edit]
Dump debug stats in log of all weapons in inventory.
Events[edit]
Destroyed[edit]
Overrides: Actor.Destroyed
Event called when inventory manager is destroyed, called from Pawn.Destroyed()
DiscardInventory[edit]
Discard full inventory, generally because the owner died
FindInventoryType[edit]
returns the inventory item of the requested class if it exists in this inventory manager.
Parameters:
- DesiredClass - class of inventory item we're trying to find.
- bAllowSubclass - whether subclasses of the desired class are acceptable
Returns:
- Inventory actor if found, None otherwise.
PostBeginPlay[edit]
Overrides: Actor.PostBeginPlay
Other instance functions[edit]
AddInventory[edit]
Adds an existing inventory item to the list. Returns true to indicate it was added, false if it was already in the list.
Parameters:
- NewItem - Item to add to inventory manager.
Returns:
- true if item was added, false otherwise.
CancelWeaponChange[edit]
Prevents player from being without a weapon.
ChangedWeapon[edit]
ChangedWeapon is called when the current weapon is finished being deactivated
ClientSyncWeapon[edit]
If the server detects that the client's weapon is out of sync, it will use this function to realign them. Network: LocalPlayer
Parameters:
- NewWeapon - The weapon the server wishes to force the client to
ClientWeaponSet[edit]
Weapon just given to a player, check if player should switch to this weapon Network: LocalPlayer Called from Weapon.ClientWeaponSet()
CreateInventory[edit]
Spawns a new Inventory actor of NewInventoryItemClass type, and adds it to the Inventory Manager.
Parameters:
- NewInventoryItemClass - Class of inventory item to spawn and add.
Returns:
- Inventory actor, None if couldn't be spawned.
DrawHud[edit]
Hook called from HUD actor. Gives access to HUD and Canvas
Parameters:
- H - HUD
GetBestWeapon[edit]
returns the best weapon for this Pawn in loadout
GetWeaponRatingFor[edit]
Returns a weight reflecting the desire to use the given weapon, used for AI and player best weapon selection.
Parameters:
- Weapon - W
Returns:
- Weapon rating (range -1.f to 1.f)
HandlePickupQuery[edit]
Handle Pickup. Can Pawn pickup this item?
Parameters:
- ItemClass - Class of Inventory our Owner is trying to pick up
- Pickup - the Actor containing that item (this may be a PickupFactory or it may be a DroppedPickup)
Returns:
- whether or not the Pickup actor should give its item to Other
IsActiveWeapon[edit]
returns true if ThisWeapon is the Pawn's active weapon.
Parameters:
- ThisWeapon - weapon to test if it's the Pawn's active weapon.
Returns:
- true if ThisWeapon is the Pawn's current weapon
ModifyDamage[edit]
Damage modifier. Is Pawn carrying items that can modify taken damage? Called from GameInfo.ReduceDamage()
NextWeapon[edit]
Switches to Next weapon Network: Client
OwnerEvent[edit]
Used to inform inventory when owner event occurs (for example jumping or weapon change)
Parameters:
- EventName - Name of event to forward to inventory items.
PrevWeapon[edit]
Switches to Previous weapon Network: Client
RemoveFromInventory[edit]
Attempts to remove an item from the inventory list if it exists.
Parameters:
- Item - Item to remove from inventory
ServerSetCurrentWeapon[edit]
ServerSetCurrentWeapon begins the Putdown sequence on the server. This function makes the assumption that if TryPutDown succeeded on the client, it will succeed on the server. This function shouldn't be called from anywhere except SetCurrentWeapon
Network: Dedicated Server
SetCurrentWeapon[edit]
Set DesiredWeapon as Current (Active) Weapon. Network: LocalPlayer
Parameters:
- DesiredWeapon - Desired weapon to assign to player
SetPendingWeapon[edit]
Set the pending weapon for switching. This shouldn't be called outside of SetCurrentWeapon()
SetupFor[edit]
Setup Inventory for Pawn P. Override this to change inventory assignment (from a pawn to another) Network: Server only
StartFire[edit]
Pawn desires to fire. By default it fires the Active Weapon if it exists. Called from PlayerController::StartFire() -> Pawn::StartFire() Network: Local Player
Parameters:
- FireModeNum - Fire mode number.
StopFire[edit]
Pawn stops firing. i.e. player releases fire button, this may not stop weapon firing right away. (for example press button once for a burst fire) Network: Local Player
Parameters:
- FireModeNum - Fire mode number.
SwitchToBestWeapon[edit]
Switch to best weapon available in loadout Network: LocalPlayer