![]() |
|
|
#1 |
|
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. |
|
|
|
|
|
#2 |
|
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!
__________________
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|