I search for solutions in this order: Past Code, Unreal Source, Wiki, BUF, groups.yahoo, google, screaming at monitor. – RegularX

Legacy:MutTutorial Code

From Unreal Wiki, The Unreal Engine Documentation Site
Revision as of 09:51, 4 May 2006 by Ip-139-77.station.sony.com (Talk) (*the script wouldn't compile because of missing ; in line 62)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


class MutNeedBetterName extends Mutator;
//creates a new class for your mutator and makes it an extension of the mutator class.
//This makes it so it follows all the rules a mutator does.
var int MultiJumpCount, MultiJumpBoost, StartingHealth, MaximumHealth; // The number of multi-jumps allowed
//The boost the player gets from a multi-jump and the player's starting health
// The var keyword prefixes a variable declaration.
// A variable declaration tells the engine what information this
// object needs to store and what kind of information it is.
// The type of information in this declaration is int, short
// for integer. An integer is a whole number, either positive
// or negative.
// The () puts these variables in a group and makes them
// visible in UnrealEds property browser. Since this is a
// mutator and likely won't be placed in a map, the () is
// probrably unnecessary.
Function Modifyplayer(pawn other)
//A function (set of actions, in the case of Uscript often predefined) that will modify the avatars/bots (pawns).
// Other is a variable that stores a reference to the player
// that we are modifying. The function uses this information
// to find the player amidst all the other things in the game
// world.
//I am using modify player because I want to change the properties of a player, in this case the MultiJumping power.
   // Local is just like the Var keyword - it tells the engine
   // that we need to store some information, and what type of
   // information to store. However, Local declarations go away
   // at the end of the function, while Var ones stay around
   // until this object is destroyed. (Since it's a mutator,
   // it will be destroyed when the level changes.)
   Local Xpawn x; //Xpawn = changeable guy
   // This stores the information we had in Other, in X as well.
   // We cast Other to an xPawn (which is what X is) because an
   // xPawn is a type of Pawn. (which is what Other is) Since
   // every xPawn is a Pawn, but not all Pawns are xPawns, we
   // have to tell the engine that the Pawn in Other is actually
   // an xPawn.
   X = xPawn(other);
   // Now we check to see if X holds valid information or not.
   // If it was a reference to a player that didn't actually
   // exist, or if the statement before this one (where we told
   // the engine that our Pawn (Other) was an xPawn turned out
   // to be untrue, then X might not hold valid information.
   // Most of the time it will hold valid information, but this
   // line checks just to be sure.
   if (X != None)
      // Make X's MaxMultiJump equal to XMultiJump etc.
    x.MaxMultiJump = MultiJumpCount;
    x.MultiJumpBoost = MultiJumpBoost;
    x.Health = StartingHealth;
    x.HealthMax = MaximumHealth;
  FriendlyName="What ever you want the Mutator to be called" //This is the name of the Mutator that will display in game
  Description="Changes your initial health and Multi-Jumping ability"
//Next add this code to the file UT2004.ini: "EditPackages=MutTutorial"
//Move the folder MutTutorial into C:\UT2004 (or where ever you installed UT2004)
//Move the file MutTutorial.int into UT2004\system
//Open Command line (a quick way to do this is to open "run" and type cmd)
//type in "C:\UT2004\System\ucc make" press enter and wait.
//Ucc will go through all the folders and if you edited your UT2004[or 3 i think].ini right it should go through your folder.
//Hopefully it will say success, there were no errors. If it does run Unreal Tourney and you will see under muators Mutation Tutorial