News UnrealEd Files Mods FragBU Liandri Archives
BeyondUnreal Forums

Go Back   BeyondUnreal Forums > Mods > WoD Mod Pod > Ask a Coder

Reply
 
Thread Tools Display Modes
Old 22nd Sep 2001, 03:50 PM   #1
Psycho_Leech
Hug meh
 
Psycho_Leech's Avatar
 
Join Date: Sep. 17th, 2001
Location: In the darkness
Posts: 781
Question Mutators

How do I create a mutator that can be added to the mutator list in order to replace certain weapons and add other stuff, or would I be better off just relying on people to use W.O.R.M or summon shoverifle.shoverifle?
:redeemer:
Psycho_Leech is offline   Reply With Quote
Old 23rd Sep 2001, 05:16 AM   #2
FunnyG
Registered User
 
Join Date: Sep. 5th, 2001
Location: Edinburgh, Scotland
Posts: 15
This is the code I'm using for the gun I'm making:

//=============================================================================
// Bean Gun Mutator :- replaces BioRifle with BeanGun.
//=============================================================================

class BeanMutator extends Mutator;

function bool AlwaysKeep(Actor Other)
{
if(Other.IsA('BeanGun') || Other.IsA('BeanAmmo'))
return true;
return Super.AlwaysKeep(Other);
}

function bool CheckReplacement(Actor Other, out byte bSuperRelevant)
{

if ( Other.IsA('ut_biorifle') )
{
ReplaceWith(Other, "BeanGun.BeanGun");
return false;
}

if ( Other.IsA('BioAmmo'))
{
ReplaceWith(Other,"BeanGun.BeanAmmo");
return false;
}

return true;
}

defaultproperties
{
}

Th 'AlwaysKeep' function makes sure the gun isn't replaced by another weapons mutator, the 'CheckReplacement' function replaces the biorifle and it's ammo with my gun and it's ammo. Just change 'ut_biorifle' and 'BioAmmo' to the gun and ammo you want to replace.
FunnyG is offline   Reply With Quote
Old 23rd Sep 2001, 10:27 AM   #3
FunnyG
Registered User
 
Join Date: Sep. 5th, 2001
Location: Edinburgh, Scotland
Posts: 15
Arrow

You'll need to make an int file as well, use notepad to add;

[public]

Object=(Name=BeanGun.BeanMutator,Class=Class,MetaClass=Engine.Mutator,Description="BeanGun, replaces biorifle & ammo with Niall's Bean Gun and it's ammo.")

Change 'BeanGun.BeanMutator' to 'name_of_your_package.name_of_the_mutator', and save the file as thename of your package.int .
FunnyG is offline   Reply With Quote
Old 24th Sep 2001, 03:10 PM   #4
Psycho_Leech
Hug meh
 
Psycho_Leech's Avatar
 
Join Date: Sep. 17th, 2001
Location: In the darkness
Posts: 781
Smile I think I understand

Thanks, I haven't tried it yet, but how do I add a weapon to a player's inventory to start with?

Psycho_Leech is offline   Reply With Quote
Old 24th Sep 2001, 10:11 PM   #5
Kangus
Zombie on your pwn!
 
Kangus's Avatar
 
Join Date: Jan. 29th, 2001
Location: Illinois, USA
Posts: 978
add this code (mostly taken from DeathMatchPlus) to your mutator, modifying as necessary:

function ModifyPlayer(Pawn Other)
{
GiveWeapon(other, "Botpack.Enforcer");

if ( NextMutator != None )
NextMutator.ModifyPlayer(Other);
}

function GiveWeapon(Pawn PlayerPawn, string aClassName )
{
local class<Weapon> WeaponClass;
local Weapon NewWeapon;

WeaponClass = class<Weapon>(DynamicLoadObject(aClassName, class'Class'));

if( PlayerPawn.FindInventoryType(WeaponClass) != None )
return;
newWeapon = Spawn(WeaponClass);
if( newWeapon != None )
{
newWeapon.RespawnTime = 0.0;
newWeapon.GiveTo(PlayerPawn);
newWeapon.bHeldItem = true;
newWeapon.GiveAmmo(PlayerPawn);
newWeapon.SetSwitchPriority(PlayerPawn);
newWeapon.WeaponSet(PlayerPawn);
newWeapon.AmbientGlow = 0;
if ( PlayerPawn.IsA('PlayerPawn') )
newWeapon.SetHand(PlayerPawn(PlayerPawn).Handedness);
else
newWeapon.GotoState('Idle');
PlayerPawn.Weapon.GotoState('DownWeapon');
PlayerPawn.PendingWeapon = None;
PlayerPawn.Weapon = newWeapon;
}
}
__________________
--Kangus
Kangus is offline   Reply With Quote
Old 20th Oct 2001, 03:20 PM   #6
Wormbo
 
Wormbo's Avatar
 
Join Date: Jun. 4th, 2001
Location: Germany
Posts: 5,785
You could optionally use:

defaultproperties
{
DefaultWeapon=class'YourPackage.YourWeaponClass'
}

This uses less code but replaces the Impact Hammer.
(Shouldn't be a problem during testing.)
Wormbo is offline   Reply With Quote
Old 21st Oct 2001, 04:51 PM   #7
Papapishu
我是康
 
Papapishu's Avatar
 
Join Date: Jun. 18th, 2001
Location: void
Posts: 2,043
Ofcourse a mutator like the beangun (hillarious btw ) replaces all weapons like (in this case) the biorifle so when you pick it up you get it instead of the biorifle...
Papapishu 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 05:44 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