I'm recreating the Arm Cannon from the Metroid games as part of a University UDK assignment. I have the shot cost of the primary fire (Power Beam) set to 0, and the secondary fire (Missiles) set to 1. However, when I spend all of my missiles and try and fire again, the weapon is un-equipped because the ammo count is now 0. How can I override this behaviour?
EDIT: I modified my weapon to override WeaponEmpty, which prevents it from switching the weapon out when the ammo count is 0. However, if the player scrolls, the weapon cannot be equipped. I made my own InventoryManager and overrode SwitchWeapon. The line I need to change is:
However, my IDE tells me that WeaponList[NewIndex] and UTWeap_ArmCannon are mismatched, and I'm not sure what I'm supposed to do instead. I've tried 'UTWeap_ArmCannon', class'UTWeap_ArmCannon' UTWeapon(UTWeap_ArmCannon) and Weapon(UTWeap_ArmCannon), but none of these have worked.
EDIT: WeaponList[NewIndex] == UTWeapon(class'UTWeap_ArmCannon') was what I wanted. However, it doesn't seem to make any difference. Even commenting out the 'if' statement prevents me from switching back to my weapon when it's out of ammo.
EDIT: I modified my weapon to override WeaponEmpty, which prevents it from switching the weapon out when the ammo count is 0. However, if the player scrolls, the weapon cannot be equipped. I made my own InventoryManager and overrode SwitchWeapon. The line I need to change is:
Code:
if ( WeaponList[NewIndex].HasAnyAmmo() || WeaponList[NewIndex] == UTWeap_ArmCannon)
EDIT: WeaponList[NewIndex] == UTWeapon(class'UTWeap_ArmCannon') was what I wanted. However, it doesn't seem to make any difference. Even commenting out the 'if' statement prevents me from switching back to my weapon when it's out of ammo.
Comment