The three virtues of a programmer: Laziness, Impatience, and Hubris. – Larry Wall

Legacy:MutTutorial Code With GUI

From Unreal Wiki, The Unreal Engine Documentation Site
Revision as of 14:30, 9 January 2005 by Nc-69-69-216-171.dyn.sprint-hsd.net (Talk)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
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.