I am simply overriding the DeusExPlayer function HandleItemPickup so that whenever we pick up an inventory item under SummerInventory master class, one of three set sounds will be played. In SummerInventory is simply the variables for the three pickup sounds. It seems this function cannot access the variables of whatever item under this inventory master class that is picked up in order to play the right sound.
- Code: Select all
// ----------------------------------------------------------------------
// HandleItemPickup()
// ----------------------------------------------------------------------
function bool HandleItemPickup(Actor FrobTarget, optional bool bSearchOnly)
{
local float rand;
rand = FRand();
if (FrobTarget.IsA('SummerInventory'))
{
if(rand < 0.33)
{
PlaySound(FrobTarget.Inventory.SummerInventory.pickupSound1, SLOT_Interact, 0.5+FRand()*0.25, , 256, 0.95+FRand()*0.1);
}
if(rand < 0.66)
{
PlaySound(FrobTarget.Inventory.SummerInventory.pickupSound2, SLOT_Interact, 0.5+FRand()*0.25, , 256, 0.95+FRand()*0.1);
}
else
PlaySound(FrobTarget.Inventory.SummerInventory.pickupSound3, SLOT_Interact, 0.5+FRand()*0.25, , 256, 0.95+FRand()*0.1);
DoFrob(Self, inHand);
}
}
The error I have the moment is: Unrecognized member 'SummerInventory' in class 'Inventory' despite SummerInventory expanding Inventory.
Thanks for the helpout