PDA

View Full Version : UE3 - UT3 Weapon Replacement not working


DeathoX 8
31st May 2011, 04:47 AM
Hi all, I am trying to create a very basic mutator to replace a weapon with a modified one (just a few default properties changed) but I haven't had any luck in making it work.

The code compiles fine and I can select it in the mutator list but it doesn't have any effect. I omitted is filling out the .ini file in the config folder, but shouldn't it work anyway?

Am I missing something?

class NewLink extends UTMutator;

function bool CheckReplacement(Actor Other)
{
local UTWeaponPickupFactory WF;

if (Other.IsA('UTWeap_LinkGun') && !Other.IsA('UTWeap_LinkGunNew'))
{
ReplaceWith(Other, "UTWeap_LinkGunNew");

return true;
}

WF = UTWeaponPickupFactory(Other);
if (WF != None && WF.WeaponPickupClass == class'UTWeap_LinkGun')
{
WF.WeaponPickupClass = class'UTWeap_LinkGunNew';
}

return true;
}

DefaultProperties
{
GroupNames[0]="WEAPONMOD"
}

DeathoX 8
3rd Jun 2011, 04:12 PM
Found it out, it was missing a WF.InitializePickup() after WF.WeaponPickupClass = class'UTWeap_LinkGunNew';

Thanks everybody for helping me out!