Worst-case scenario: the UEd Goblin wipes the map and burns down your house.

UE3:UTInventoryManager (UT3)

From Unreal Wiki, The Unreal Engine Documentation Site
(Redirected from UE3:AmmoStore (UT3))
Jump to: navigation, search
UT3 Object >> Actor >> InventoryManager >> UTInventoryManager
Package: 
UTGame
This class in other games:
UDK

UTInventoryManager UT inventory definition

Copyright 1998-2008 Epic Games, Inc. All Rights Reserved.

Properties[edit]

AmmoStorage[edit]

Type: array<AmmoStore>

Stores the currently stored up ammo

bInfiniteAmmo[edit]

Type: bool

if true, all weapons use no ammo

LastAdjustWeaponTime[edit]

Type: float

last time AdjustWeapon() was called

PendingSwitchWeapon[edit]

Type: UTWeapon

weapon server is retrying switch to because the current weapon temporarily denied it (due to currently firing, etc)

PreviousWeapon[edit]

Type: Weapon

Holds the last weapon used

Default values[edit]

Property Value
bMustHoldWeapon True

Structs[edit]

AmmoStore[edit]

Modifiers: native

This struct defines ammo that is stored in inventory, but for which the pawn doesn't yet have a weapon for.

int Amount 
class<UTWeapon> WeaponClass 

Functions[edit]

Events[edit]

DiscardInventory[edit]

simulated event DiscardInventory ()

Overrides: InventoryManager.DiscardInventory

Discard full inventory, generally because the owner died

Other instance functions[edit]

AddAmmoToWeapon[edit]

function AddAmmoToWeapon (int AmountToAdd, class<UTWeaponWeaponClassToAddTo)

Called by the UTAmmoPickup classes, this function attempts to add ammo to a weapon. If that weapon exists, it adds it otherwise it tracks the ammo in an array for later.

AddInventory[edit]

simulated function bool AddInventory (Inventory NewItem, optional bool bDoNotActivate)

Overrides: InventoryManager.AddInventory

Handle AutoSwitching to a weapon

AdjustWeapon[edit]

simulated function AdjustWeapon (int NewOffset)


AllAmmo[edit]

function AllAmmo (optional bool bAmmoForSuperWeapons)

AllAmmo() All weapons currently in inventory have ammo increased to max allowed value. Super weapons will only have their ammo amount changed if bAmmoForSuperWeapons is true.

ChangedWeapon[edit]

simulated function ChangedWeapon ()

Overrides: InventoryManager.ChangedWeapon

Store the last used weapon for later

CheckSwitchTo[edit]

simulated function CheckSwitchTo (UTWeapon NewWeapon)

checks if we should autoswitch to this weapon (server)

ClientSetCurrentWeapon[edit]

reliable client function ClientSetCurrentWeapon (Weapon DesiredWeapon)

Accessor for the server to begin a weapon switch on the client.

Parameters:

  • DesiredWeapon - The Weapon to switch to

ClientWeaponSet[edit]

simulated function ClientWeaponSet (Weapon NewWeapon, bool bOptionalSet)

Overrides: InventoryManager.ClientWeaponSet

Weapon just given to a player, check if player should switch to this weapon Network: LocalPlayer Called from Weapon.ClientWeaponSet()

CreateInventory[edit]

simulated function Inventory CreateInventory (class<InventoryNewInventoryItemClass, optional bool bDoNotActivate)

Overrides: InventoryManager.CreateInventory

(Description copied from InventoryManager.CreateInventory)
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.

DemoSetCurrentWeapon[edit]

reliable demorecording function DemoSetCurrentWeapon (Weapon DesiredWeapon)

Routes weapon switch events to demos

DisruptInventory[edit]

function bool DisruptInventory ()


DrawHud[edit]

simulated function DrawHud (HUD H)

Overrides: InventoryManager.DrawHud

(Description copied from InventoryManager.DrawHud)
Hook called from HUD actor. Gives access to HUD and Canvas

Parameters:

  • H - HUD

ForceDeployableSwitch[edit]

function ForceDeployableSwitch ()

force switch to deployable after getting out of vehicle.

(In case didn't switch for some reason before getting in vehicle)

GetWeaponList[edit]

simulated function GetWeaponList (out array<UTWeaponWeaponList, optional bool bFilter, optional int GroupFilter, optional bool bNoEmpty)


HasInventoryOfClass[edit]

function Inventory HasInventoryOfClass (class<InventoryInvClass)

Scans the inventory looking for any of type InvClass. If it finds it it returns it, other it returns none.

NeedsAmmo[edit]

function bool NeedsAmmo (class<UTWeaponTestWeapon)


NextWeapon[edit]

simulated function NextWeapon ()

Overrides: InventoryManager.NextWeapon

Switches to Next weapon Network: Client

PrevWeapon[edit]

simulated function PrevWeapon ()

Overrides: InventoryManager.PrevWeapon

Switches to Previous weapon Network: Client

ProcessRetrySwitch[edit]

simulated function ProcessRetrySwitch ()

timer function set by RetrySwitchTo() to actually retry the switch

RemoveFromInventory[edit]

simulated function RemoveFromInventory (Inventory ItemToRemove)

Overrides: InventoryManager.RemoveFromInventory

(Description copied from InventoryManager.RemoveFromInventory)
Attempts to remove an item from the inventory list if it exists.

Parameters:

  • Item - Item to remove from inventory

RetrySwitchTo[edit]

simulated function RetrySwitchTo (UTWeapon NewWeapon)

called to retry switching to the passed in weapon a little later

ServerSetCurrentWeapon[edit]

reliable server function ServerSetCurrentWeapon (Weapon DesiredWeapon)

Overrides: InventoryManager.ServerSetCurrentWeapon

When a client-switch begins on a remote-client, the server needs to be told to start the process as well. SetCurrentWeapon() makes that call.

NETWORK - This function should *ONLY* be called from a remote client's SetCurrentWeapon() function.

Parameters:

  • DesiredWeapon - The Weapon to switch to

SetCurrentWeapon[edit]

reliable client function SetCurrentWeapon (Weapon DesiredWeapon)

Overrides: InventoryManager.SetCurrentWeapon

SetCurrentWeapon starts a weapon change. It calls SetPendingWeapon and then if it's called on a remote client, tells the server to begin the process.

Parameters:

  • DesiredWeapon - The Weapon to switch to

SetPendingWeapon[edit]

simulated function SetPendingWeapon (Weapon DesiredWeapon)

Overrides: InventoryManager.SetPendingWeapon

This is the work-horse of the weapon switch. It will set a new pending weapon and tell the weapon to begin the switch. If the call to Weapon.TryPutdown() returns false, it means that the weapon can't switch at the moment and has deferred it until later

Parameters:

  • DesiredWeapon - The Weapon to switch to

SwitchToBestWeapon[edit]

simulated function SwitchToBestWeapon (optional bool bForceADifferentWeapon)

Overrides: InventoryManager.SwitchToBestWeapon

Cut and pasted here except call ClientWeaponSet on the weapon instead of forcing it. This causes all of the "should I put down" logic to occur

SwitchToPreviousWeapon[edit]

simulated function SwitchToPreviousWeapon ()


SwitchWeapon[edit]

simulated function SwitchWeapon (byte NewGroup)

Handling switching to a weapon group