I love the smell of UnrealEd crashing in the morning. – tarquin

UE3:InventoryManager instance functions (UDK)

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to: navigation, search
UDK Object >> Actor >> InventoryManager (instance functions)

Instance functions[edit]

AddInventory[edit]

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

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]

simulated function bool CancelWeaponChange ()

Prevents player from being without a weapon.

ChangedWeapon[edit]

simulated function ChangedWeapon ()

ChangedWeapon is called when the current weapon is finished being deactivated

ClearAllPendingFire[edit]

simulated function ClearAllPendingFire (Weapon InWeapon)


ClearPendingFire[edit]

simulated function ClearPendingFire (Weapon InWeapon, int InFiringMode)


ClientSyncWeapon[edit]

reliable client function ClientSyncWeapon (Weapon NewWeapon)

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]

simulated function ClientWeaponSet (Weapon NewWeapon, bool bOptionalSet, optional bool bDoNotActivate)

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)

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]

simulated function DrawHud (HUD H)

Hook called from HUD actor. Gives access to HUD and Canvas

Parameters:

  • H - HUD

GetBestWeapon[edit]

simulated function Weapon GetBestWeapon (optional bool bForceADifferentWeapon)

returns the best weapon for this Pawn in loadout

GetPendingFireLength[edit]

simulated function int GetPendingFireLength (Weapon InWeapon)


GetWeaponRatingFor[edit]

simulated function float GetWeaponRatingFor (Weapon W)

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]

function bool HandlePickupQuery (class<InventoryItemClass, Actor Pickup)

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

InternalSetCurrentWeapon[edit]

simulated private function InternalSetCurrentWeapon (Weapon DesiredWeapon)


IsActiveWeapon[edit]

simulated function bool IsActiveWeapon (Weapon ThisWeapon)

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

IsPendingFire[edit]

simulated function bool IsPendingFire (Weapon InWeapon, int InFiringMode)


ModifyDamage[edit]

function int ModifyDamage (int Damage, Controller instigatedBy, Object.Vector HitLocation, Object.Vector Momentum, class<DamageTypeDamageType)

Damage modifier. Is Pawn carrying items that can modify taken damage? Called from GameInfo.ReduceDamage()

NextWeapon[edit]

simulated function NextWeapon ()

Switches to Next weapon Network: Client

OwnerDied[edit]

function OwnerDied ()

called when our owner is killed

OwnerEvent[edit]

simulated function OwnerEvent (name EventName)

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]

simulated function PrevWeapon ()

Switches to Previous weapon Network: Client

RemoveClassFromInventory[edit]

simulated function RemoveClassFromInventory (class<InventoryDesiredClass, optional bool bAllowSubclass)

Util to completely remove items of a particular class from inventory

RemoveFromInventory[edit]

simulated function RemoveFromInventory (Inventory ItemToRemove)

Attempts to remove an item from the inventory list if it exists.

Parameters:

  • Item - Item to remove from inventory

ServerSetCurrentWeapon[edit]

reliable server function ServerSetCurrentWeapon (Weapon DesiredWeapon)

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]

reliable client function SetCurrentWeapon (Weapon DesiredWeapon)

Set DesiredWeapon as Current (Active) Weapon. Network: LocalPlayer

Parameters:

  • DesiredWeapon - Desired weapon to assign to player

SetPendingFire[edit]

simulated function SetPendingFire (Weapon InWeapon, int InFiringMode)


SetPendingWeapon[edit]

simulated function SetPendingWeapon (Weapon DesiredWeapon)

Set the pending weapon for switching. This shouldn't be called outside of SetCurrentWeapon()

SetupFor[edit]

function SetupFor (Pawn P)

Setup Inventory for Pawn P. Override this to change inventory assignment (from a pawn to another) Network: Server only

StartFire[edit]

simulated function StartFire (byte FireModeNum)

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]

simulated function StopFire (byte FireModeNum)

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]

simulated function SwitchToBestWeapon (optional bool bForceADifferentWeapon)

Switch to best weapon available in loadout Network: LocalPlayer

UpdateController[edit]

simulated function UpdateController ()