Sandcrawler Network

Unreal Modder's Haven => Unreal Engine 2 General Modding Chat => Topic started by: Tycon on May 01, 2011, 09:28:19 AM

Title: Mutators
Post by: Tycon on May 01, 2011, 09:28:19 AM
What are they? i have seen these for KF but how do I make them and what makes them special? Thanks in advance for answering my intense curiosity

EDIT: I found the mutator in the actorclasses. untick placeableclasses, and its in info. anyways, the script says they do this:
// Mutators allow modifications to gameplay while keeping the game rules intact. 
// Mutators are given the opportunity to modify player login parameters with
// ModifyLogin(), to modify player pawn properties with ModifyPlayer(), to change
// the default weapon for players with GetDefaultWeapon(), or to modify, remove,
// or replace all other actors when they are spawned with CheckRelevance(), which
// is called from the PreBeginPlay() function of all actors except those (Decals,
// Effects and Projectiles for performance reasons) which have bGameRelevant==true

It's like a mod that when done be manually editing props would make you unable to join servers, but you can join anyway. I suspect this is how the TX instagib was made, and in CCP server the dc has zoom from a mutator.
Title: Re: Mutators
Post by: Sandcrawler on May 02, 2011, 09:59:32 AM


Last time I messed with mutators they didn't do anything. There is a tutorial someplace for making a simple mutator.

Could try it and see if you can get a result from it.
Title: Re: Mutators
Post by: Tycon on May 02, 2011, 02:05:54 PM
color=#66ff66]What about
http://forums.sandcrawler.net/index.php?topic=1322.0
and http://umh.sandcrawler.net/index.php?page=downloads&command=category&id=7
? those are mutators for Killing Floor.

If you're saying that you couldn't make it work for RC, I know of one, and possibly two, mutators, that are in working RC servers. maybe you didn't do something right. just sayin'
Title: Re: Mutators
Post by: Sandcrawler on May 02, 2011, 04:11:03 PM
I could have, but seeing as it was just a mutator that said hello world I don't think I did...

What mutators do you know of on MP? The admin stuff isn't a mutator, just fixes some missing admin files.
Title: Re: Mutators
Post by: Tycon on May 02, 2011, 05:56:42 PM
The ironsights on CCP server are a mutator, and I suspect TX instagib server to be a mutator too.
Title: Re: Mutators
Post by: frazscotland on May 03, 2011, 02:05:56 PM
TX instagib was created by TAG phobos and he also make some more script based gametype eg king of the hill etc.
Best people to ask on this matter are TAG Phobos, CCP VI ,PFWSKIP 
Title: Re: Mutators
Post by: Tycon on May 03, 2011, 05:06:21 PM
Script stuff is in two catergories: mutators and new gamemodes. if you do a shadow prop fo ryourself, others can join your servers without needeing to download.
Title: Re: Mutators
Post by: {CCP}VI on May 05, 2011, 05:53:12 AM
mutators are similar to gamemodes. you can start them with full onlinecompability. clients can join without having the files.  has the advantage that you can run multiple mutators and use other gamemodes at the same time.
dm_engine?gamemode=mpgame.dmgame?mutator=mutatorpackage.mutatorname
that'd be a commandline with which you could start a mutator.

simple example of a mutator:

class ScopeMutator extends Mutator;

var(Scope) class<DC17mSniperScope>   ScopeAttachment;   
var DC17mSniperScope Scope;

function Mutate(string MutateString, PlayerController Sender)
{
   local vector start;      
   if ((sender.pawn != None) && (sender.pawn.weapon !=None))
   {
      if (MutateString ~= "AddScope")
      {

         Start = Sender.Pawn.weapon.GetBoneLocation('weaponAttach_R');
         Scope = Spawn(ScopeAttachment,,, Start);
         Sender.Pawn.weapon.AttachToBone(Scope,'weaponAttach_R');   
         Scope.SetRelativeLocation(vect(0,0,0));
         Scope.SetRelativeRotation(rot(0,0,0));
         log(" scope should attach now");
      }
   }
}


wanted to make a code with which you can attach the dc17msniperscope to other weapons.
the function mutate gets called via a console command. the command is "mutate mutatestring" and every client is able to use it. the code checks whether the controller who calls the function has a pawn and a weapon[if ((sender.pawn != None) && (sender.pawn.weapon !=None))] and whether the mutatestring is "addscope" [if (MutateString ~= "AddScope")](that means the real console command would be "mutate addscope") and then it finds out where the location of the bone called weaponattach_r of the 3dmodel of your hudarms is [Start = Sender.Pawn.weapon.GetBoneLocation('weaponAttach_R');] and it spawns the scope[Scope = Spawn(ScopeAttachment,,, Start);], attaches it to the bone [Sender.Pawn.weapon.AttachToBone(Scope,'weaponAttach_R');] and sets the relative location/rotation.
go to the ccpserver, open console and type "mutate addscope" and your blaster will have a scope.
if you use that code you'll have to go to the defaultproperties, open the category "scope" and select the scopeclass.
tx's instagib was not made with a mutator but it would have been easier with it. don't know who made it.
Title: Re: Mutators
Post by: Sandcrawler on May 05, 2011, 01:53:16 PM


Do you mind if I clean up that guide a bit ad add it to the website?

We could also use a general unreal script compiling for RC. I've never used the built in editor/compiler, and RC doesn't have the commandline file (can't recall the name ATM)
Title: Re: Mutators
Post by: {CCP}VI on May 06, 2011, 07:00:42 AM
sure, add it if you like to.
explanation was a bit incomplete. explained only the most important stuff.

oh, and there's one thing i should add. it's not that easy to compile scripts with the unrealed. it works only with the built in script editor. when you make a new actor you'll see that you can't open the script of it("'actor' has no script to edit "or something like that)  to make a scriptable childclass of an actor you have to place that actor(in this class that'd be the class mutator) into your map, select it, go to actorclassbrowser, then to class-> new from selection in the toolbar. then you can name the package and the actor itself and it should be scriptable. go to the actorbrowser, rightclick your actor and select "edit script" and that's it.
Title: Re: Mutators
Post by: Tycon on May 08, 2011, 04:23:11 PM
Wait so basically in a mutator you define a number of functions, and call them with the cheat menu. to call them you enter the function's name followed by it's arguments. am I right?

EDIT: i tried to make it editable, but it didn't work. Could you please just o over that part with more detail? :P
Title: Re: Mutators
Post by: {CCP}VI on May 09, 2011, 04:21:15 AM
Quote from: Tycon on May 08, 2011, 04:23:11 PM
Wait so basically in a mutator you define a number of functions, and call them with the cheat menu. to call them you enter the function's name followed by it's arguments. am I right?
nope :P
works only with the function mutate. was just an example to show what you can do with an mutator. you can also use other functions. the function postbeginplay() gets called when the level starts. if you want to change the settings of pawns i'd use the function ModifyPlayer(Pawn Other).
function ModifyPlayer(Pawn Other)
{
         other.drawscale=2;
}
for example.
this sets the drawscale of the pawn to 2. you may know the popular command (set pawn drawscale 5). drawscale is a variable. every actor can have its own variables and functions(the function mutate exists only in mutators). childclasses contain the functions and variables of their parents(every actor has the variable drawscale, because the mainclass "actor" defines it.

you can also make your own functions. would be a bit offtopic to explain the whole unrealscriptstuff but here's a helpful link. http://udn.epicgames.com/Two/UnrealScriptReference.html (http://udn.epicgames.com/Two/UnrealScriptReference.html)

Quote from: Tycon on May 08, 2011, 04:23:11 PM
EDIT: i tried to make it editable, but it didn't work. Could you please just o over that part with more detail? :P
can't explain it more detailed. sorry.
Title: Re: Mutators
Post by: Tycon on May 09, 2011, 05:51:01 AM
Quote from: {CCP}VI on May 09, 2011, 04:21:15 AM
can't explain it more detailed. sorry.

It'sOK, I figured it out after taking a 37th look at your instructions. and thanks for the link and all the info