Mutator Help

The best and quickest support by a group of top-notch editing specialists, guaranteed!

Moderator: Forum Guards

Mutator Help

Postby MainMan » Fri Jan 06, 06 11:52 pm

Ok I need some help with making a mutator. I've never made one before, but i think the one I need is pretty easy to make. I need it to delete all multitools (including ones on respawned players), and instead spawn another class (credit card in my case).

Thanks.
<center>ty m7
</center>
User avatar
MainMan
<i>Tru' Playa' Fer Defs</i>
 
Posts: 4655
Joined: Sun Jun 05, 05 7:38 am
Location: London, UK

Postby Dae » Sat Jan 07, 06 10:27 am

Code: Select all
class SomeMutator extends Mutator config(Mutators);

function PostBeginPlay()
{
   local Multitool M;
   Level.Game.BaseMutator.AddMutator(Self);
   foreach AllActors(Class'Multitool',M)
  {   
        if ( M != None )
        {
           Spawn(Class'{ADD YOUR CLASS NAME HERE}',,,M.Location,M.Rotation);
           M.Destroy();
        }
   }
}

This code will replace all multitools which lie on the ground, but not those which are given to the player when he respawns. Items which are given to the player when he respawns are unfortunately declared in DeusExPlayer and they're not even variables. I have some ideas about how to replace them too without overriding player class, but none of them are good enough. Maybe you could think of something better.

After you've done your mutator, add it to ServerPackages and ServerActors in DeusEx.ini, like this:
Code: Select all
ServerPackages=PackageName
ServerActors=PackageName.MutatorClass
User avatar
Dae
Alpha
 
Posts: 12086
Joined: Sat Sep 06, 03 4:40 pm

Postby MainMan » Sat Jan 07, 06 10:40 am

what about the weapon selector mutator, that can get rid of all multitools, even on the player.

EDIT: How about if you put your code in Function Tick(Float Deltatime)?
<center>ty m7
</center>
User avatar
MainMan
<i>Tru' Playa' Fer Defs</i>
 
Posts: 4655
Joined: Sun Jun 05, 05 7:38 am
Location: London, UK

Postby Dae » Sat Jan 07, 06 11:00 am

We don't have a source of mPack1.u unfortunately :(

And Tick isn't the best way, because
1. it may lag
2. there will be some time when a player will be able to drop multitool out
User avatar
Dae
Alpha
 
Posts: 12086
Joined: Sat Sep 06, 03 4:40 pm

Postby ~ô¿ô~Nobody~ » Sat Jan 07, 06 12:02 pm

you don't need to add it to serverpackages.. since the mutator just works on the server anyways :wink:


btw... what about decompiling mpack1?



EDIT: why that difficult with that tick function

just use function ModifyPlayer(Pawn Other)
of the mutator.. it always gets called after a player respawns
so.. you can right remove the multitool after respawning
Nobody is perfect...
------------------------------
Longc[A]t wrote:I still think Dae is a russian spambot.

~[A]Daedalus~ wrote:There will be a day when my patience goes away and you, along with all who rant with you, will get banned.

ô¿ô¥[GODZ]¥NOCHANC wrote:I can ban any one I want ANY time I want. You have no rights here.
User avatar
~ô¿ô~Nobody~
Alpha
 
Posts: 2520
Joined: Fri Dec 31, 04 3:20 pm
Location: Proclarush Taonas

Postby MainMan » Sat Jan 07, 06 12:07 pm

where do i need to add it then? in the map itself?
<center>ty m7
</center>
User avatar
MainMan
<i>Tru' Playa' Fer Defs</i>
 
Posts: 4655
Joined: Sun Jun 05, 05 7:38 am
Location: London, UK

Postby ~ô¿ô~Nobody~ » Sat Jan 07, 06 12:15 pm

the mutator needs to be placed in the map and needs to be registred in the mutator list..
auto spawning the mutator is done by
Code: Select all
ServerActors=PackageName.MutatorClass

..how dae already said
just serverpackages aren't required
Nobody is perfect...
------------------------------
Longc[A]t wrote:I still think Dae is a russian spambot.

~[A]Daedalus~ wrote:There will be a day when my patience goes away and you, along with all who rant with you, will get banned.

ô¿ô¥[GODZ]¥NOCHANC wrote:I can ban any one I want ANY time I want. You have no rights here.
User avatar
~ô¿ô~Nobody~
Alpha
 
Posts: 2520
Joined: Fri Dec 31, 04 3:20 pm
Location: Proclarush Taonas

Postby MainMan » Sat Jan 07, 06 12:21 pm

~[A]Nobody~ wrote:needs to be registred in the mutator list

How do I do this?

EDIT: nevermind it worked.

Here's the code I used, in case anyone else needs to use it:
Code: Select all
class MMRPGSpawn extends Mutator config(Mutators);

function PostBeginPlay()
{
   Level.Game.BaseMutator.AddMutator(Self);
}

function ModifyPlayer(Pawn Other)
{
   local Multitool M;
   local MMRPGCreditcard C;
   local DeusExPlayer Player;

   if (Other.IsA('DeusExPlayer'))
   {
      Player = DeusExPlayer(Other);
      foreach AllActors(Class'Multitool',M)
      {   
         if ( M.Owner == Player )
         {
            C = Spawn(Class'MMRPGCreditCard',,,M.Location,M.Rotation);
            M.Destroy();
            C.Frob(Player,none);
            C.bInObjectBelt = True;
            if(C.Owner != Player)
               C.Destroy();
              }
      }
   }
}
<center>ty m7
</center>
User avatar
MainMan
<i>Tru' Playa' Fer Defs</i>
 
Posts: 4655
Joined: Sun Jun 05, 05 7:38 am
Location: London, UK

Postby Dae » Sat Jan 07, 06 1:55 pm

Thanks MainMan (for the code) and Nobody (for helping MainMan). :gj:
User avatar
Dae
Alpha
 
Posts: 12086
Joined: Sat Sep 06, 03 4:40 pm


Return to Editing issues

Who is online

Users browsing this forum: No registered users and 0 guests
cron