Making a mutator

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

Moderator: Forum Guards

Making a mutator

Postby Cozmo » Sun Mar 19, 06 6:08 pm

I was thinking about that modifiedcreditcard i made and was thnking of ways to use it normaly with MTL or without needing Admin, then i used the skin mutator and had an idea... :D :shock: :D
I want to make a mutator that changes somthing in the defaultpro's of a certian item, but not like AdminSet because i want it to only work for the player,

basicaly i want some sort of command to be entered like...
Mutate CreditCard.100
so it gives 100 at a time to other players so you can give exact ammounts, instead of constantly pressing 20 over and over again.
I also want the mutator to put a class in beltslot0 at the start of the game - :? ,

This is probbably quite a big request but it i have no idea how to, never made a mutator before.
Cozmo_RPG (v1 & v2)
MPConversations - A tool for creating multiplayer RPG stuff
Cozmo
Master
 
Posts: 1266
Joined: Tue Jun 28, 05 10:53 am
Location: UK

Postby Dae » Sun Mar 19, 06 6:39 pm

There's a source of skin mutator somewhere.
A hint: to work with a request like "mutate something.value" you will have to get rid of first x symbols before dot + dot itself. There's a function in Unreal script for that, query Unreal Wiki search for "string functions".
User avatar
Dae
Alpha
 
Posts: 12086
Joined: Sat Sep 06, 03 4:40 pm

Postby Cozmo » Sun Mar 19, 06 7:15 pm

Bah its "bombarded" me with information again... :evil: ,
im not sure what to look at and there are only 17 DX categorys there. :roll:
Cozmo_RPG (v1 & v2)
MPConversations - A tool for creating multiplayer RPG stuff
Cozmo
Master
 
Posts: 1266
Joined: Tue Jun 28, 05 10:53 am
Location: UK

Postby Dae » Sun Mar 19, 06 7:21 pm

~Cozmo~ wrote:Bah its "bombarded" me with information again... :evil: ,
im not sure what to look at and there are only 17 DX categorys there. :roll:

Internal link.
User avatar
Dae
Alpha
 
Posts: 12086
Joined: Sat Sep 06, 03 4:40 pm

Postby Cozmo » Sun Mar 19, 06 7:43 pm

Ok thanks, (Wow that looks much simpler in .txt :shock: ),
Can someone make a basic mutator code that changes defaultproperties of somthing just so i can get an idea how to make mine...?
Cozmo_RPG (v1 & v2)
MPConversations - A tool for creating multiplayer RPG stuff
Cozmo
Master
 
Posts: 1266
Joined: Tue Jun 28, 05 10:53 am
Location: UK

Postby Dae » Sun Mar 19, 06 9:10 pm

Code: Select all
// An example mutator by Dae for Cozmo
// took 5 minutes, haven't tested it, so it may
// contain mistakes - don't blame me for that
// What it should do:
// in case if player typed on server "mutate makeusrich"
// mutator should give all the players on the server
// 500 bucks more and inform them about this event 

// Declaring the class and .ini file
class CozmoMutator extends Mutator config(Mutators);

// Telling Deus Ex to work with the mutator
simulated function PostBeginPlay()
{
   Level.Game.BaseMutator.AddMutator(Self);
}

// This function is being called by "mutate x" command
// where "x" is S and the caller is "Player"
function Mutate (String S, PlayerPawn Player)
{
// In case if player typed "mutate makeusrich"...
   if (S ~= "makeusrich")
   {
      // ...we have to find all the players in game
      foreach AllActors(Class'DeusExPlayer',DXP)
     {
        // Let's ask every player if he is real
        // (this is a protection against "accessed none" errors)
        if (DXP != None)
        {
           // Wow, he's real. Let's give him 500 more bucks
           // ... += 500 "command" adds value "500" to existing
           // Credits variable of our player
           DXP.Credits += 500;
           // Let player know that he's now kinda rich
           DXP.ClientMessage("You are $500 richer now!");
        }   
     }
   }
}

defaultproperties
{
}

To install mutator, put your compiled file (ie "mymutator.u") to your System directory if it's not there already. Then open deusex.ini file and find
Code: Select all
[DeusEx.DeusExGameEngine]
in it. Somewhere in that block of variables, add
Code: Select all
ServerActors=mymutator.mymutatorclass
If you have any classes in that package with the mutator besides the mutator itself you have to declare the package name in ServerPackages too, so
Code: Select all
ServerPackages=mymutator


+Cozmo, next time make up a better subject for a topic. Think of others, who may have a simular problem.
User avatar
Dae
Alpha
 
Posts: 12086
Joined: Sat Sep 06, 03 4:40 pm

Postby Cozmo » Mon Mar 20, 06 4:43 pm

Ok, i think i have a slight idea how they work... :? ,
allan said somthing about var Classname so maybye i can do it with that or somthing?
il try figure it out myself somehow
thanks dae,

By the way dae, good luck with uni. \:D/
Cozmo_RPG (v1 & v2)
MPConversations - A tool for creating multiplayer RPG stuff
Cozmo
Master
 
Posts: 1266
Joined: Tue Jun 28, 05 10:53 am
Location: UK

Postby Gishank » Mon Mar 20, 06 5:11 pm

Wow, i've learnt from that : P
Image
Gishank
Forum Super Hero
 
Posts: 4235
Joined: Sun Aug 28, 05 9:17 am
Location: London, England.


Return to Editing issues

Who is online

Users browsing this forum: No registered users and 48 guests