| Home Page | Recent Changes

MutTutorial Code With GUI

class MutNeedBetterName extends Mutator config (MutNeedBetterName);

var config int MultiJumpCount, MultiJumpBoost, StartingHealth, MaximumHealth, SuperDuberMaximumHealth;
// The number of multi-jumps allowed, the boost the player gets from a multi-jump,
// the player's starting health, the maximum health and the maximum super health

var localized string MultiJumpCountDisplayText, MultiJumpBoostDisplayText, StartingHealthDisplayText, HealthMaxDisplayText, SuperHealthMaxDisplayText,
                     MultiJumpCountDescText, MultiJumpBoostDescText, StartingHealthDescText, HealthMaxDescText, SuperHealthMaxDescText;

function ModifyPlayer(Pawn Other) {
    local xPawn x; //x is a variable
    x = xPawn(Other);
    if (x != None) {
        x.MaxMultiJump = MultiJumpCount;
        x.MultiJumpBoost = MultiJumpBoost;
        x.Health = StartingHealth;
        x.HealthMax = MaximumHealth;
        x.SuperHealthMax = SuperDuberMaximumHealth;
    }
}

static function FillPlayInfo(PlayInfo PlayInfo) {
    Super.FillPlayInfo(PlayInfo);

    PlayInfo.AddSetting(default.RulesGroup, "MultiJumpCount", default.MultiJumpCountDisplayText, 0, 1, "Text");
    PlayInfo.AddSetting(default.RulesGroup, "MultiJumpBoost", default.MultiJumpBoostDisplayText, 0, 1, "Text");
    PlayInfo.AddSetting(default.RulesGroup, "StartingHealth", default.StartingHealthDisplayText, 0, 1, "Text");
    PlayInfo.AddSetting(default.RulesGroup, "MaximumHealth", default.HealthMaxDisplayText, 0, 1, "Text");
    PlayInfo.AddSetting(default.RulesGroup, "SuperDuberMaximumHealth", default.SuperHealthMaxDisplayText, 0, 1, "Text");

}

static event string GetDescriptionText(string PropName) {
    switch (PropName) {
        case "MultiJumpCount":          return default.MultiJumpCountDescText;
        case "MultiJumpBoost":          return default.MultiJumpBoostDescText;
        case "StartingHealth":          return default.StartingHealthDescText;
        case "MaximumHealth":           return default.HealthMaxDescText;
        case "SuperDuberMaximumHealth": return default.SuperHealthMaxDescText;
    }

    return Super.GetDescriptionText(PropName);
}

static function string GetDisplayText(string PropName) {
  switch (PropName) {
    case "MultiJumpCount":           return default.MultiJumpCountDisplayText;
    case "MultiJumpBoost":           return default.MultiJumpBoostDisplayText;
    case "StartingHealth":           return default.StartingHealthDisplayText;
    case "MaximumHealth":            return default.HealthMaxDisplayText;
    case "SuperDuberMaximumHealth":  return default.SuperHealthMaxDisplayText;
  }
}

defaultproperties
{
  MultiJumpCount=10
  MultiJumpBoost=50
  StartingHealth=250
  MaximumHealth=250
  SuperDuberMaximumHealth=300
  GroupName="MutNeedBetterName"
  FriendlyName="Player Tweaker" //This is the name of the Mutator that will display in game
  Description="Changes your initial/max health and multi-jumping ability."

  MultiJumpCountDisplayText="Multi-Jump Count"
  MultiJumpBoostDisplayText="Multi-Jump Boost"
  StartingHealthDisplayText="Starting Health"
  HealthMaxDisplayText="Maximum Health"
  SuperHealthMaxDisplayText="Maximum SuperHealth"

  MultiJumpCountDescText="The number of times you can multi-jump."
  MultiJumpBoostDescText="The boost you get with each multi-jump."
  StartingHealthDescText="The starting health for the game."
  HealthMaxDescText="The maximum health for the game."
  SuperHealthMaxDescText="The maximum superhealth for the game."
}

mr.bob: :D I wish i could test compile this, but the camp computers don't have the full verson of UT204 yet. YThere is this mut that makes it so that health and shield pickups give you more or less stuff. Good combo with this mutator.

This could obiously use some work, comments and such, but I can tell that it is a rough draft and you are working on it. Now it is only a matter of months before I realace a mutator that people will actually download. Unfortanatly it will be a long time before i have enough skillz to create this mutator: mod ideas/upgrades.

Geist: Just added config (MutNeedBetterName) (so the vars would be saved to MutNeedBetterName.ini) to the class declaration, and renamed a couple vars for readibility as they were renamed in the original tutorial. I have compiled this, and it works.

The Unreal Engine Documentation Site

Wiki Community

Topic Categories

Recent Changes

Offline Wiki

Unreal Engine

Console Commands

Terminology

FAQs

Help Desk

Mapping Topics

Mapping Lessons

UnrealEd Interface

UnrealScript Topics

UnrealScript Lessons

Making Mods

Class Tree

Modeling Topics

Chongqing Page

Log In