| Home Page | Recent Changes | Preferences

Stat Points System/Damage Modifier

This is the damage modifying script for the Stat Mut

If you have followed this tutorial in order, go back to the file SPSMinigunFire you created earlier. Add this line of code:

function ModeTick(float dt)
    {
        if (StatPoints > 0)
            DamageMin = default.DamageMin + (StatPoints / 5)
            DamageMax = default.DamageMax + (StatPoints / 5)
        else
            DamageMin = default.DamageMin
            DamageMax = default.DamageMax
    }

So that this:

simulated function PostBeginPlay()
{
    Super.PostBeginPlay();
    FireRate = 1.f / (RoundsPerRotation * BarrelRotationsPerSec);
    MaxRollSpeed = 65536.f*BarrelRotationsPerSec;
    Gun = Minigun(Owner);
    function ModeTick(float dt)
    {
        if (StatPoints > 0)
        {        
                NewFireRate = FireRate + (StatPoints / 5);
        else
                FireRate = 1.f / (RoundsPerRotation * BarrelRotationsPerSec);
    }
    }
}

Will look like this:

simulated function PostBeginPlay()
{
    Super.PostBeginPlay();
    FireRate = 1.f / (RoundsPerRotation * BarrelRotationsPerSec);
    MaxRollSpeed = 65536.f*BarrelRotationsPerSec;
    Gun = Minigun(Owner);
    function ModeTick(float dt)
    {
        if (StatPoints > 0)
        {
            DamageMin = default.DamageMin + (StatPoints / 5)
            DamageMax = default.DamageMax + (StatPoints / 5)
        else
            DamageMin = default.DamageMin
            DamageMax = default.DamageMax
        }
        if (StatPoints > 0)
        {        
                NewFireRate = FireRate + (StatPoints / 5);
        else
                FireRate = 1.f / (RoundsPerRotation * BarrelRotationsPerSec);
    }
    }   
}

For people who havn't done the original Tutorial, go here:

Stat Points System

Any comments or revisions would be helpful.

Comments

Related Topics

[Stat Points System/Max Health Modifier]?

UnrealScript Lessons

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