Announcement

Collapse

The Infinity Blade Forums Have Moved

We've launched brand new Infinity Blade forums with improved features and revamped layout. We've also included a complete archive of the previous posts. Come check out the new Infinity Blade forums.
See more
See less

How to alter UT3 weapons?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    How to alter UT3 weapons?

    Hello,

    I want to utilize UnrealScript to alter certain UT3 weapons.

    Generally I want to do the following:
    • Adjust the damage scale
    • Adjust the damage scale based on the lvl the hero is at
    • Get rid of push backs
    • Adjust the range


    Can someone plz share a piece of advice or some guidance on where to look at?

    I know have to make a subclass to extend from something but with so many info around its tough to find and besides I'm a rookie programmer.

    For the specifics, here's what I want them to do:

    Rocket Launcher
    • decrease the life span of primary fire.
    • for secondary, only one shot of the grenade (instead of three) temporary slows enemy speed.
      • takes 10 seconds to reload.
        • Hero lvl 1: slows enemies down by 5 seconds.
        • Hero lvl 2: slows enemies down by 10 seconds.
        • Hero lvl 3: slows enemies down by 15 seconds.


    ShockRifle
    • For secondary fire.
      • Hero lvl 1: Goes through 1 enemy.
      • Hero lvl 2: Goes through 2 enemies.
      • Hero lvl 3: Goes through 3 enemies.


    BioRifle (optional)
    • adjust to an even shorter range for both primary & secondary fire.
    • For secondary fire.
      • Hero lvl 1: Shoots a maximum of one huge blob that sticks to the ground.
        • takes 15 seconds to reload and once fired previous blob disappears.
      • Hero lvl 2: Shoots a maximum of two huge blobs that sticks to the ground.
        • takes 15 seconds to reload and once the second blob gets fired, first blob fired disappears.
      • Hero lvl 3: Shoots a maximum of three huge blobs that sticks to the ground.
        • takes 15 seconds to reload and once the second blob gets fired, first blob fired disappears.
        • on contact with enemy, the blob explodes into 4 mini blobs (the size of those from primary fire).
          • enemies who step on the smaller blog will receive 1/4 damage of the big blob.
    • no blobs from primary fire will stick to walls or ground.


    I am doing a MOBA game certain heroes use certain UT3 weapons and levels up (max lvl 3) based how much enemies they defeat.

    #2
    You could start by investigating the code of each weapon (classes with the "UTWeap_" prefix). Most of the damage inflicting code or property is inside the weapon (in case of an instant hit weapon) or the projectile. The projectile casses are setup in the weapon case (in some cases in the content verison of the weapon, with a "_Content" suffix).

    A interesting code snippet to look at would be the Titan mutator (UTMutatorHero) which is replacing the Pawn class. The Pawn class UTHeroPawn is modifying weapons dynamically if the use transform into a Titan.
    Code:
        NewWeapon = GiveWeapon("UTGame.UTWeap_RocketLauncher");
        NewWeapon.WeaponProjectiles[0] = class'UTProj_HeroRocket';
        NewWeapon.WeaponProjectiles[1] = class'UTProj_HeroRocket';
        NewWeapon.FireOffset = GetFamilyInfo().default.HeroFireOffset;
        NewWeapon.bAutoCharge = true;
        NewWeapon.AmmoCount = NewWeapon.MaxAmmoCount;
        NewWeapon.bCanThrow = false;
        NewRL = UTWeap_RocketLauncher(NewWeapon);
        NewRL.SeekingRocketClass = class'UTProj_HeroRocket';
        NewRL.GrenadeClass = class'UTProj_HeroGrenade';
        NewRL.LockAim = 0.97;
        NewRL.LockChecktime = 0.1;
        NewRL.LockAcquireTime = 0.3;
        NewRL.LockTolerance = 3.0;
    
        NewWeapon = GiveWeapon("UTGame.UTWeap_ShockRifle");
        NewWeapon.InstantHitDamageTypes[0] = class'UTDmgType_HeroShockPrimary';
        NewWeapon.WeaponProjectiles[0] = class'UTProj_HeroShockBall';
        NewWeapon.WeaponProjectiles[1] = class'UTProj_HeroShockBall';
        NewWeapon.FireOffset = GetFamilyInfo().default.HeroFireOffset;
        NewWeapon.bAutoCharge = true;
        NewWeapon.bCanThrow = false;
        NewWeapon.AmmoCount = NewWeapon.MaxAmmoCount;

    For a static modification, you need to subclass existing class and change properities statically (as defaultproperties) or logic dynamically (as code).

    Code:
    class MOBAWeap_RocketLauncher extends UTWeap_RocketLauncher;
    
    function class<Projectile> GetProjectileClass()
    {
        // enforce Grenades for secondary
        if (CurrentFireMode == 1)
        {
           return GrenadeClass;
        }
    
        return super.GetProjectileClass();
    }
    defaultproperties
    {
        WeaponProjectiles(0)=class'MOBAProj_Rocket'
        WeaponProjectiles(1)=class'MOBAProj_Rocket'
        LoadedRocketClass=class'MOBAProj_LoadedRocket'
        GrenadeClass=class'MOBAProj_Grenade'
       SeekingRocketClass=class'MOBAProj_SeekingRocket'
    
        MaxLoadCount=3
    }
    With the rocket class
    Code:
    class MOBAProj_Rocket extends UTProj_Rocket;
    
    defaultproperties
    {
        LifeSpan=6.0 // originally 8.0
    }
    The rocket class is also extending UTProj_Rocket therefore it is a bit tricky. If you want to support having a class extending UTProj_LoadedRocket (in case of mods relying on that), you have to extend that class and enter the same adjustments. The other case, you copy-paste the full implementation of that UTProj_LoadedRocket class into your MOBAProj_LoadedRocket class and instead of extending from UTProj_Rocket, you subclass MOBAProj_Rocket.

    Here's the simple class:
    Code:
    class MOBAProj_LoadedRocket extends UTProj_LoadedRocket;
    
    defaultproperties
    {
        // Same changed properties as MOBAProj_Rocket
        LifeSpan=6.0 // originally 8.0
    }
    The seeking rocket is different to the laoded class. It has native implementation (at least it could have it). Therefore, you cannot have the custom SeekingRocket class subclassing your custom Rocket class (MOBAProj_Class). You could still do the same as the custom LoadedClass (and removing the native class specifier) but you will loose the native code logic of that class (therefore it might not be seeking at all). You can still implement a native code manually, but you have to know what it is doing. In most cases where a class is having the native class without a native function it in, it is doing all the work in the Tick function.
    Code:
    class MOBAProj_SeekingRocket extends UTProj_SeekingRocket;
    
    defaultproperties
    {
        // Same changed properties as MOBAProj_Rocket
        LifeSpan=6.0 // originally 8.0
    }

    Code:
    class MOBAProj_Grenade extends UTProj_Grenade;
    
    defaultproperties
    {
    }

    Implementating all the code and giving all the example would be out of the scope. Just try to investigate the exting code. The ShockRifle could use PassThroughDamage for instance.

    Comment


      #3
      I did not understand anything, explain to me again

      Comment


        #4
        Well instead of my re-writing/copy-pasting the whole things, explain what you didn't understand or where you at.

        Comment


          #5
          I didn't expect a response after a long period of time. So truth be told I don't need anymore answers since this is for a school project and the semester has already ended.

          Besides I moved on from UDK to UE4.

          So to any mods, if you want to delete/lock this thread plz do so; I really don't need this thread any longer.

          Comment

          Working...
          X