| Home Page | Recent Changes | Preferences

UTClassicGameRules

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

The UTClassicGameRules augments the damage dealing process in the game by increasing the damage by 20%.

Properties

None

Methods

int NetDamage( int OriginalDamage, int Damage, pawn injured, pawn instigatedBy, vector HitLocation, out vector Momentum, class<DamageType> DamageType )
Augments the damage dealing process by increasing the damage by 20%.

Known Subclases

None

Code Walkthrough.

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

class UTClassicGameRules extends GameRules;
    
function int NetDamage( int OriginalDamage, int Damage, pawn injured, pawn instigatedBy, vector HitLocation, out vector Momentum, class<DamageType> DamageType )
{
    Damage = Damage * 1.2;
    if ( NextGameRules != None )
        return NextGameRules.NetDamage( OriginalDamage,Damage,injured,instigatedBy,HitLocation,Momentum,DamageType );
    return Damage;
}

The block of code handles two things: Increases the NetDamage done by 20% and then allows the other GameRules modifiers to go first.

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.


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

FAQs

Help Desk

Mapping Topics

Mapping Lessons

UnrealEd Interface

UnrealScript Topics

UnrealScript Lessons

Making Mods

Class Tree

Modeling Topics

Chongqing Page

Log In