UE3 - UT3 Weapon Replacement not working

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

DeathoX 8

Beta Toaster
Jan 20, 2008
247
0
0
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?

Code:
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"
}
 
Last edited:

DeathoX 8

Beta Toaster
Jan 20, 2008
247
0
0
Found it out, it was missing a WF.InitializePickup() after WF.WeaponPickupClass = class'UTWeap_LinkGunNew';

Thanks everybody for helping me out!