| Home Page | Recent Changes | Preferences

SpeciesGameRules

UT2003 :: Actor >> Info >> GameRules >> SpeciesGameRules (Package: XGame)

The SpeciesGameRules affects the amount of damage a particular species deals and recieves in the game. Species are defined in subclasses in of SpeciesType and contain their augmented damage ratios in their respective defaultproperties.

Object

  +-SpeciesType
      +-SPECIES_Alien?  
      +-SPECIES_Bot?
      +-SPECIES_Human?
          +-SPECIES_Egypt?
          +-SPECIES_Merc?
          +-SPECIES_Night?
      +-SPECIES_Jugg?

Properties

None

Variables

None

Methods

int NetDamage( int OriginalDamage, int Damage, pawn injured, pawn instigatedBy, vector HitLocation, out vector Momentum, class<DamageType> DamageType )
Augments the amount of damage done by a specific species in the game.

Known Subclases

None

Code Walkthrough.

I thought that these would be useful examples to further demonstrate writing a GameRules for your game.

class SpeciesGameRules extends GameRules;
        
function int NetDamage( int OriginalDamage, int Damage, pawn injured, pawn instigatedBy, vector HitLocation, out vector Momentum, class<DamageType> DamageType )
{
    if ( NextGameRules != None )
        return NextGameRules.NetDamage( OriginalDamage,Damage,injured,instigatedBy,HitLocation,Momentum,DamageType );
    if ( xPawn(injured) != None )
        Damage = xPawn(injured).Species.static.ModifyReceivedDamage(Damage,injured,instigatedBy,HitLocation,Momentum,DamageType);
    if ( (InstigatedBy != Injured) && (xPawn(InstigatedBy) != None) )
        Damage = xPawn(InstigatedBy).Species.static.ModifyImpartedDamage(Damage,injured,instigatedBy,HitLocation,Momentum,DamageType);
    return Damage;
}

defaultproperties
{
}

The block of code handles three things: Allows the other GameRules modifiers to go first; Calculates the damage recieved by the xPawn?; Calculates the damage Imparted by the xPawn?.

This GameRules allows all other GameRules to affect the NetDamage before it augments the damage in play. If you neglect giving the other GameRules a chance to augment NetDamage, then all other GameRules loaded after this GameRules will not have a chance to augment play.

Here is a list of damage received and imparted modifiers.

NetDamange Table

Species Imparted Received
Alien 1.000000 1.300000
Bot 1.200000 1.200000
Human_Egypt 1.000000 1.200000
Human_Merc 1.000000 1.000000
Human_Night Affected By Health 0.700000
Jugg 1.000000 0.700000

Burtlo: Thought I would use the subclasses as a great oppurtunity to show how GameRules work.

Category Class (UT2003)

The Unreal Engine Documentation Site

Wiki Community

Topic Categories

Image Uploads

Random Page

Recent Changes

Offline Wiki

Unreal Engine

Console Commands

Terminology

Mapping Topics

Mapping Lessons

UnrealEd Interface

Questions&Answers

Scripting Topics

Scripting Lessons

Making Mods

Class Tree

Questions&Answers

Modeling Topics

Questions&Answers

Log In