Announcement

Collapse
No announcement yet.

Species statistics mutator?

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

    #16
    Originally posted by GreatEmerald View Post
    Well, if I can do it with my limited UScript knowledge then OK
    Well I have some "limited" knowledge too. I bet we can do it. Let me get in touch with one of my old UC buddies, and get him to get me the info

    Comment


      #17
      Link to Species Stats Plus PLEASE

      Comment


        #18
        SpeciesStats works. Look at SpeciesGameRules again and notice how it delegates calls to the species classes of the players.

        Comment


          #19
          Originally posted by Wormbo View Post
          SpeciesStats works. Look at SpeciesGameRules again and notice how it delegates calls to the species classes of the players.
          It does'nt work online. The Nightmare species can can "vampire" if under 100 health. So if I'm Ravage, I have 75 health, I shoot ya with a LG or somethin, and I'll be back at 100. That works offline, but not online.

          Comment


            #20
            What other mutators was the server running when testing that? Some of the Epic mutators have serious compatibility issues in the fields of "GameRules chaining" (ignore the tech term if you don't know what I mean), which may cause either SpeciesStats or another mutator to no longer work as expected. Also, if the server has enabled force models, then everyone will have the species corresponding to the forced models.

            Comment


              #21
              Could someone please link to the species stats plus?

              Comment


                #22
                here you go:
                http://forums.beyondunreal.com/showthread.php?t=130877
                But you have to log in BeyondUnreal to download it.

                Comment


                  #23
                  Originally posted by Unreal4Eva View Post
                  here you go:
                  http://forums.beyondunreal.com/showthread.php?t=130877
                  But you have to log in BeyondUnreal to download it.
                  Thanks! I will downlolad it soon.

                  Comment


                    #24
                    Originally posted by Wormbo View Post
                    What other mutators was the server running when testing that? Some of the Epic mutators have serious compatibility issues in the fields of "GameRules chaining" (ignore the tech term if you don't know what I mean), which may cause either SpeciesStats or another mutator to no longer work as expected. Also, if the server has enabled force models, then everyone will have the species corresponding to the forced models.
                    To my knowledge no other mutators, but it was a long long time ago I that I played a server using the Mutator.

                    I can't help but think this code can work. It's not so much about trying to have a species mutator, but to have EXACTLY the UC1 feel. If I can get this mutator created, I can bring a lot of player back to this game. The UC community has longed for a solid game to play for years and this code in UT2004 would be like Bee's to honey.

                    It would seem there is jsut one little part of the code that is messed up at the very end of class.

                    Line:167
                    Unrecognized Member 'WepAffinty' in class xPawn
                    Here is line 167 (righ below comment line // weapon affinity):
                    Code:
                    if(xp.WepAffinity.WepClass != None )
                    So does that mean that xPawn does'nt have WepAffinty in it's class, or does it mean something is written in correctly in the UCMutSpecies class?

                    Code:
                    //==================================================
                    // MutUCSpeciesStats - species specific stats for players based upon UC1 code
                    // 
                    //==================================================
                    class MutUCSpeciesStats extends Mutator;
                    
                    struct StatMods
                    {
                    var() config float AirControl;
                    var() config float GroundSpeed;
                    var() config float WaterSpeed;
                    var() config float JumpZ;
                    var() config float HealthMax;
                    var() config float AccelRate;
                    var() config float WalkingPct;
                    var() config float CrouchedPct;
                    var() config float DodgeSpeedFactor;
                    var() config float DodgeSpeedZ;
                    };
                    
                    // attenuate stat mods, for easy tweaking of the value of these traits.
                    var() config StatMods statAtten;
                    // species array of stat mods
                    var() config StatMods stats[7];
                    
                    // sjs - called game events, todo: hook this up to stuff
                    function EventNotify(Pawn Other,Pawn Instigator,Name EventName, float value)
                    {
                    if( xPawn(Instigator) == None || xPawn(Other) == None )
                    {
                    Super.EventNotify(Other, Instigator, EventName, value);
                    return;
                    }
                    
                    if( EventName == 'Damage' && Other!=Instigator && value > 0.0)
                    {
                    if( xPawn(Instigator).Species == SPECIES_Night ) // vampiric
                    {
                    if( Instigator.Health < Instigator.HealthMax*2.0 )
                    Instigator.Health = Clamp(int(Instigator.Health+value*0.5), Instigator.Health, Instigator.HealthMax*2.0);
                    }
                    }
                    Super.EventNotify(Other, Instigator, EventName, value);
                    }
                    
                    function RestoreSpecies(xPawn xp)
                    {
                    local int PrevHealth;
                    
                    PrevHealth = xp.Health;
                    ModifySpecies(xp);
                    xp.Health = PrevHealth;
                    }
                    
                    // need to modify the actual class defaults due to plenty of code that uses defaults to restore values after temporary modification
                    function ModifySpecies(xPawn xp)
                    {
                    local int speciesIndex;
                    
                    speciesIndex = xp.Species;
                    
                    //mutlog("Modifying species index:"$speciesIndex);
                    
                    xp.AirControl = class'xPawn'.default.AirControl * stats[speciesIndex].AirControl * statAtten.AirControl;
                    xp.GroundSpeed = class'xPawn'.default.GroundSpeed * stats[speciesIndex].GroundSpeed * statAtten.GroundSpeed;
                    xp.WaterSpeed = class'xPawn'.default.WaterSpeed * stats[speciesIndex].WaterSpeed * statAtten.WaterSpeed;
                    xp.JumpZ = class'xPawn'.default.JumpZ * stats[speciesIndex].JumpZ * statAtten.JumpZ;
                    xp.HealthMax = class'xPawn'.default.HealthMax * stats[speciesIndex].HealthMax * statAtten.HealthMax;
                    xp.Health = xp.HealthMax;
                    xp.AccelRate = class'xPawn'.default.AccelRate * stats[speciesIndex].AccelRate * statAtten.AccelRate;
                    xp.WalkingPct = class'xPawn'.default.WalkingPct * stats[speciesIndex].WalkingPct * statAtten.WalkingPct;
                    xp.CrouchedPct = class'xPawn'.default.CrouchedPct * stats[speciesIndex].CrouchedPct * statAtten.CrouchedPct;
                    xp.DodgeSpeedFactor = class'xPawn'.default.DodgeSpeedFactor * stats[speciesIndex].DodgeSpeedFactor * statAtten.DodgeSpeedFactor;
                    xp.DodgeSpeedZ = class'xPawn'.default.DodgeSpeedZ * stats[speciesIndex].DodgeSpeedZ * statAtten.DodgeSpeedZ;
                    
                    xp.bUsingSpeciesStats = true;
                    }
                    
                    function mutlog(string s, optional name LogName)
                    {
                    // log(s, LogName);
                    }
                    
                    function ModifyAffinityWeapon(xPawn xp, Weapon newWeapon)
                    {
                    local int i;
                    local Ammunition ammo;
                    switch(xp.WepAffinity.Type)
                    {
                    case WepAff_Damage:
                    for(i=0; i<ArrayCount(newWeapon.FireMode); i++)
                    {
                    if( newWeapon.FireMode[i] != None )
                    {
                    //mutlog("WepAff_Damage modifying:"$newWeapon.FireMode[i]);
                    newWeapon.FireMode[i].DamageAtten = xp.WepAffinity.Value;
                    }
                    }
                    break;
                    case WepAff_Ammo:
                    for(i=0; i<ArrayCount(newWeapon.FireMode); i++)
                    {
                    if ( newWeapon.FireMode[i] != None && newWeapon.FireMode[i].AmmoClass != None )
                    {
                    if( i>0 && newWeapon.FireMode[i].AmmoClass == newWeapon.FireMode[i-1].AmmoClass )
                    continue;
                    Ammo = Ammunition(xp.FindInventoryType(newWeapon.FireMode[i].AmmoClass));
                    if ( Ammo != None )
                    {
                    //mutlog("WepAff_Ammo modifying:"$Ammo);
                    Ammo.MaxAmmo *= xp.WepAffinity.Value;
                    Ammo.InitialAmount *= xp.WepAffinity.Value;
                    Ammo.AmmoAmount = Ammo.InitialAmount;
                    }
                    }
                    }
                    break;
                    case WepAff_FireRate:
                    newWeapon.FireRateAtten = xp.WepAffinity.Value;
                    break;
                    case WepAff_Accuracy:
                    for(i=0; i<ArrayCount(newWeapon.FireMode); i++)
                    {
                    if( newWeapon.FireMode[i] != None )
                    {
                    //mutlog("WepAff_FireRate modifying:"$newWeapon.FireMode[i]);
                    //newWeapon.FireMode[i].FireRate *= xp.WepAffinity.Value;
                    }
                    }
                    break;
                    default:
                    mutlog("Unhandled weapon affinity type!",'Error');
                    break;
                    }
                    
                    if( newWeapon.InventoryGroup == 2 ) // assault
                    {
                    // hack so assault rifle affin always has a bit of damage attenutation 
                    // because ammo and firerate kindof suck with it
                    for(i=0; i<ArrayCount(newWeapon.FireMode); i++)
                    {
                    if( newWeapon.FireMode[i] != None )
                    {
                    //mutlog("WepAff_Damage modifying:"$newWeapon.FireMode[i]);
                    newWeapon.FireMode[i].DamageAtten = FMax(newWeapon.FireMode[i].DamageAtten, 1.6);
                    }
                    }
                    }
                    }
                    
                    function ModifyPlayer(Pawn Other)
                    {
                    local xPawn xp;
                    local String WeaponClassName;
                    local class<Weapon> WeaponClass;
                    local Weapon newWeapon;
                    
                    xp = xPawn(Other);
                    if(xp == None)
                    return;
                    
                    mutlog("MutSpeciesStats="$xp.class);
                    ModifySpecies(xp);
                    
                    // weapon affinity
                    if(xp.WepAffinity.WepClass != None )
                    {
                    newWeapon = Weapon(Other.FindInventoryType(xp.WepAffinity.WepC lass)) ;
                    if( newWeapon == None )
                    {
                    WeaponClassName = Level.Game.BaseMutator.GetInventoryClassOverride(S tring(xp.WepAffinity.WepClass));
                    mutlog( "xp.WepAffinity.WepClass:" @ xp.WepAffinity.WepClass );
                    mutlog( "WeaponClassName:" @ WeaponClassName );
                    
                    if( WeaponClassName != "" )
                    WeaponClass = class<Weapon>( DynamicLoadObject(WeaponClassName,class'Class') );
                    
                    if( WeaponClass != None )
                    newWeapon = Spawn(WeaponClass,,,Other.Location);
                    
                    if( newWeapon != None )
                    newWeapon.GiveTo(Other);
                    }
                    if( (newWeapon != None) && (newWeapon.class == xp.WepAffinity.WepClass) )
                    {
                    newWeapon.BringUp();
                    newWeapon.bCanThrow = false; // don't allow default weapon to be thrown out
                    ModifyAffinityWeapon(xp,newWeapon);
                    }
                    }
                    
                    // handle per-species setup
                    if( xp.Species == SPECIES_Egypt )
                    {
                    xp.AdrenalineAtten = 1.5;
                    }
                    
                    Super.ModifyPlayer(Other);
                    }
                    
                    /*
                    0=SPECIES_Alien,
                    1=SPECIES_Bot,
                    2=SPECIES_Egypt,
                    3=SPECIES_Jugg,
                    4=SPECIES_Merc,
                    5=SPECIES_Night,
                    6=SPECIES_None
                    */

                    Comment


                      #25
                      Originally posted by FewPosts View Post
                      So does that mean that xPawn does'nt have WepAffinty in it's class, or does it mean something is written in correctly in the UCMutSpecies class?
                      The former. You'd need to create a custom pawn for that, which isn't always a good idea. The thing is, I have no idea why it even requires an xPawn. It's a Species mutator, so it should only require the Species class. By creating your own species class with weapon affinities, though, you could make the mutator work on species basis (that is, not per player, but per species as a whole).

                      EDIT: Also, for those who want one, here's an alternative mirror for Species Stats Plus: http://www.filefront.com/15912383/Sp...Jackalope.zip/

                      Comment


                        #26
                        Originally posted by GreatEmerald View Post
                        The former. You'd need to create a custom pawn for that, which isn't always a good idea. The thing is, I have no idea why it even requires an xPawn. It's a Species mutator, so it should only require the Species class. By creating your own species class with weapon affinities, though, you could make the mutator work on species basis (that is, not per player, but per species as a whole).

                        EDIT: Also, for those who want one, here's an alternative mirror for Species Stats Plus: http://www.filefront.com/15912383/Sp...Jackalope.zip/
                        What do you think would happen if you just removed the line:

                        Code:
                        if(xp.WepAffinity.WepClass != None )
                        Then there would be no reference to the whole Weapon affinty thing , and theoretically still do the other thing to movement and health etc?

                        Comment


                          #27
                          Theoretically, yes. But you'll probably run into some more errors.

                          Comment


                            #28
                            maybe this is a bit off topic, but im searching a mutator with the original deathsounds/species from ut99, this alredy exist?

                            Comment


                              #29
                              Well I've been tweaking SpeciesStats plus inside the game to work more like UC1. It's set-up kind of close, but it's not right. The Automatons jump REALLY FAR and really high and the Jugs are slower and healthier than configured. These are just small examples. I'll get it tweaked and that should hold in the SpeciesStats.ini file and we'll ahve somethjing very close to UC1 gameplay.

                              Weapon affinty was considered broekn and cheap anywhys so why try to implemet it ?

                              Comment


                                #30
                                It could be interesting to see, and it's part of UC1 legacy. Besides, it's not that hard to implement, at least for offline play.

                                Comment

                                Working...
                                X