News UnrealEd Files Mods FragBU Liandri Archives
BeyondUnreal Forums

Go Back   BeyondUnreal Forums > Unreal Development > Coding

Reply
 
Thread Tools Display Modes
Old 31st May 2011, 04:47 AM   #1
DeathoX 8
Beta Toaster
 
Join Date: Jan. 20th, 2008
Posts: 245
Weapon Replacement not working

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 by DeathoX 8; 31st May 2011 at 04:49 AM.
DeathoX 8 is offline   Reply With Quote
Old 3rd Jun 2011, 04:12 PM   #2
DeathoX 8
Beta Toaster
 
Join Date: Jan. 20th, 2008
Posts: 245
Found it out, it was missing a WF.InitializePickup() after WF.WeaponPickupClass = class'UTWeap_LinkGunNew';

Thanks everybody for helping me out!
__________________
DeathoX 8 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 11:41 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.

Copyright ©1998 - 2012, BeyondUnreal, Inc.
Privacy Policy | Terms of Use
Bandwidth provided by AtomicGamer