Announcement

Collapse
No announcement yet.

Unreal Championship scripts

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

    Unreal Championship scripts

    Hi guys, I have recently extracted some of the system files from Unreal Championship and was able to open them with a tool called UTPT, I have coding for rocket launcher, UC style species mutator which is more defined than the UT2k3/2k4 version, weapon affinities for characters and others.

    I was wondering if maybe someone can take a look at the coding to see if any can be used for a mod for UT2k4 .


    The following links are to download pre extracted scripts using UTPT and the entire UC system folder.


    Extracted files

    UC system folder

    #2
    HAving not looked at them ATM (too short on time) i imagine some tweaking would render then useable, pending on other files you managed to aquire...

    Comment


      #3
      i had a look at them. beyond my knowledge of uscript. shred told me about this a while ago, and i dont see how much different uc is from ut 03/04, but thats just me.

      Comment


        #4
        Well ther is a big differnce Porc....Go turn on the game and Pick Szygy....then do one forward dodge jump...you'll see the difference then....or Pick a juggy....Look at their health, and also notice how slow Jugies are....

        Can you code this mutator based on the printed scipts here Porc????

        Look BELOW!!!!!

        Comment


          #5
          UT2k4 Species mutator



          code:-------------------------------------------------------------------------------- //================================================== ===========================
          // MutSpeciesStats - species specific stats for players
          //================================================== ===========================
          class MutSpeciesStats extends Mutator;

          function PostBeginPlay()
          {
          local GameRules G;

          Super.PostBeginPlay();
          G = spawn(class'SpeciesGameRules');
          if ( Level.Game.GameRulesModifiers == None )
          Level.Game.GameRulesModifiers = G;
          else
          Level.Game.GameRulesModifiers.AddGameRules(G);
          }

          function ModifyPlayer(Pawn Other)
          {
          local xPawn xp;

          Super.ModifyPlayer(Other);

          xp = xPawn(Other);
          if(xp == None)
          return;
          xp.Species.static.ModifyPawn(xp);
          }
          --------------------------------------------------------------------------------













          Unreal Championship Species


          code:--------------------------------------------------------------------------------
          //================================================== ===========================
          // MutSpeciesStats - species specific stats for players
          //================================================== ===========================
          class MutSpeciesStats 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


            #6
            i think there is way more to it. more info is probably needed. are there any species specific stats/classes? if so, i bet the existing species stats modifier could be altered with whatever stats/variables are needed with those numbers. i think its beyond me, unless you can come up with some specific species stats I've only written simply stupid weapon replacement mutators. this is way more involved. Maybe someday, but right now... doubtful.

            Comment


              #7
              I think youd just need the claases for each species probably and amke it access 2k4 weapon classes instead of UC ones it may work......

              Dang it

              Comment


                #8
                I got some more scripts here, I found a few regaurding player control although im not 100% sure where to find more detail about the actual species mutator.

                get a zip file with my extracts here http://www.bigupload.com/d=6767

                Here's one example:

                (UC1) PlayerProfile.ScriptText

                Code:
                //=============================================================================
                // PlayerProfile.
                // Copyright 2001 Digital Extremes - All Rights Reserved.
                // Confidential.
                //=============================================================================
                class PlayerProfile extends ProfileBase;
                
                
                // --- WARNING --------------------------------------------------------------------------------------------------------
                var  private string     PlayerName;
                
                const cNumStyles = 5;
                enum ECombatStyle
                {
                    ECS_Stealthy,
                    ECS_Evasive,
                    ECS_CoolHeaded,
                    ECS_Aggressive,
                    ECS_Psycho, 
                };
                var float               fCombatStyle;
                var ECombatStyle        CombatStyle;
                var localized string    StyleString[cNumStyles];
                
                var float               Accuracy;
                var float               Tactics;
                var float               Agility;
                
                var EPlayerPos          Position;
                var localized string    PositionCodes[cNumPos];
                
                var int                 Kills;        // Does not count TeamKills
                var int                 TeamKills;
                var int                 Deaths;       // Does not include Suicides
                var int                 Suicides;     // Includes falling etc.
                var int                 Frags;        // Kills - Suicides - TeamKills
                var int                 Specials;     // Head-shots, combos, etc
                var int                 Shots;
                var int                 Hits;
                
                var bool                IsHumanPlayer;
                var int                 PlayerRecordIndex;
                // --- WARNING --------------------------------------------------------------------------------------------------------
                // -Update ULoadSaveManager::MaxSaveGameFileSize if the maximum save game size changes
                // -Update ULoadSaveManager::SaveGameFileVersion if the data layout changes
                // --- WARNING --------------------------------------------------------------------------------------------------------
                
                
                static simulated function PlayerProfile CreatePlayerProfile(GameInfo    game, 
                                                                            string      inGameName,
                                                                            string      inPlayerName, 
                                                                            int         inPlayerRecordIndex, 
                                                                            bool        inHumanPlayer)
                {
                    local PlayerProfile pProfile;
                
                    pProfile = game.SaveGameCreateObject(class'PlayerProfile', inGameName);
                    pProfile.SetPlayerName(inPlayerName);
                    pProfile.PlayerRecordIndex = inPlayerRecordIndex;
                    pProfile.IsHumanPlayer = inHumanPlayer;
                
                    if (!inHumanPlayer)
                        pProfile.Randomize(0.f, 1.f);
                
                    return pProfile;
                }
                
                simulated function SetPlayerName(string inName)
                {
                    PlayerName = CapStringLen(inName);
                }
                
                simulated function string GetPlayerName()
                {
                    return PlayerName;
                }
                
                simulated function NextPositionCode()
                {
                    local int pos;
                    local EPlayerPos posFreelance;
                
                    pos = int(Position);
                    pos++;
                    posFreelance = POS_Freelance;
                    if (pos > int(posFreelance))
                        pos = 0;
                    Position = EPlayerPos(pos);
                }
                
                simulated function PrevPositionCode()
                {
                    local int pos;
                    local EPlayerPos posFreelance;
                
                    pos = int(Position);
                    pos--;
                    posFreelance = POS_Freelance;
                    if (pos < 0)
                        pos = int(posFreelance);
                    Position = EPlayerPos(pos);
                }
                
                simulated function SetPosition(int pos)
                {
                    Position = EPlayerPos(pos);
                }
                
                simulated function ResetPosition()
                {
                    Position = POS_None;
                }
                
                simulated function string GetPositionCode()
                {
                    return default.PositionCodes[int(Position)];
                }
                
                simulated function string GetPositionString()
                {
                    return default.PositionText[int(Position)];
                }
                
                simulated function string GetStyleString()
                {
                    return StaticGetStyleString(CombatStyle);
                }
                   
                static function string StaticGetStyleString(ECombatStyle cs)
                {
                    return default.StyleString[int(cs)];
                }
                
                function ECombatStyle GetCombatStyle(float s)
                {
                    local int i;
                    local ECombatStyle cs;
                    
                    i = int(s*cNumStyles);
                
                    switch (i)
                    {
                        case 0:
                            cs = ECS_Stealthy;
                            break;
                        case 1:
                            cs = ECS_Evasive;
                            break;
                        case 2:
                            cs = ECS_CoolHeaded;
                            break;
                        case 3:
                            cs = ECS_Aggressive;
                            break;
                        case 4:
                            cs = ECS_Psycho;
                            break;
                    }
                    return cs;
                }
                
                function Randomize(float min, float max)
                {
                    local float dev;
                    
                    dev = max - min;
                
                    Accuracy = Lerp( (min + FRand() * dev), AccuracyMin, AccuracyMax, true );
                    Tactics = Lerp( (min + FRand() * dev), TacticsMin, TacticsMax, true );
                    Agility = Lerp( (min + FRand() * dev), AgilityMin, AgilityMax, true );
                
                    fCombatStyle = FRand();
                    CombatStyle = GetCombatStyle(fCombatStyle);
                    Position = EPlayerPos(Rand(cNumPos));
                }
                
                simulated function UpdateStats(PlayerReplicationInfo pri)
                {
                    Kills       += pri.Stats.Overall.Kills;
                    TeamKills   += pri.Stats.Overall.TeamKills;
                    Deaths      += pri.Stats.Overall.Deaths;
                    Suicides    += pri.Stats.Overall.Suicides;
                    Frags       += pri.Stats.Overall.Frags; 
                    Specials    += pri.Stats.Overall.Specials;
                    Shots       += pri.Stats.Overall.Shots;
                    Hits        += pri.Stats.Overall.Hits;
                }
                
                simulated function LogPlayerProfile()
                {
                    log(self$" LogPlayerProfile... PlayerName="$PlayerName);
                    log(self$" LogPlayerProfile... IsHumanPlayer="$IsHumanPlayer);
                    log(self$" LogPlayerProfile... PlayerRecordIndex="$PlayerRecordIndex);
                    log(self$" DONE LogPlayerProfile...");
                }

                Comment


                  #9
                  Found the scripts for UC's seeking rocket Projectile


                  (UT2k4) SeekingRocketProj.ScriptText xWeapons.u
                  Code:
                  class SeekingRocketProj extends RocketProj;
                  
                  var Actor Seeking;
                  var vector InitialDir;
                  
                  replication
                  {
                      reliable if( bNetInitial && (Role==ROLE_Authority) )
                          Seeking, InitialDir;
                  }
                  
                  simulated function Timer()
                  {
                      local vector ForceDir;
                      local float VelMag;
                  
                      if ( InitialDir == vect(0,0,0) )
                          InitialDir = Normal(Velocity);
                           
                  	Acceleration = vect(0,0,0);
                      Super.Timer();
                      if ( (Seeking != None) && (Seeking != Instigator) ) 
                      {
                  		// Do normal guidance to target.
                  		ForceDir = Normal(Seeking.Location - Location);
                  		
                  		if( (ForceDir Dot InitialDir) > 0 )
                  		{
                  			VelMag = VSize(Velocity);
                  		
                  			// track vehicles better
                  			if ( Seeking.Physics == PHYS_Karma )
                  				ForceDir = Normal(ForceDir * 0.8 * VelMag + Velocity);
                  			else
                  				ForceDir = Normal(ForceDir * 0.5 * VelMag + Velocity);
                  			Velocity =  VelMag * ForceDir;  
                  			Acceleration += 5 * ForceDir; 
                  		}
                  		// Update rocket so it faces in the direction its going.
                  		SetRotation(rotator(Velocity));
                      }
                  }
                  
                  simulated function PostBeginPlay()
                  {
                      Super.PostBeginPlay();
                      SetTimer(0.1, true);
                  }
                  (UC1) SeekingRocketProj.ScriptText xWeapons.u
                  Code:
                  class SeekingRocketProj extends RocketProj;
                  
                  var Actor Seeking;
                  var vector InitialDir;
                  
                  replication
                  {
                      reliable if( Role==ROLE_Authority )
                          Seeking, InitialDir;
                  }
                  
                  simulated function Timer()
                  {
                      local vector SeekingDir;
                      local float MagnitudeVel;
                  
                      if ( InitialDir == vect(0,0,0) )
                          InitialDir = Normal(Velocity);
                           
                      if ( (Seeking != None) && (Seeking != Instigator) ) 
                      {
                          SeekingDir = Normal(Seeking.Location - Location);
                          //if ( (SeekingDir Dot InitialDir) > 0 )
                          //{
                              MagnitudeVel = VSize(Velocity);
                              SeekingDir = Normal(SeekingDir * 0.5 * MagnitudeVel + Velocity);
                              Velocity =  MagnitudeVel * SeekingDir;  
                              Acceleration = 40 * SeekingDir; 
                              SetRotation(rotator(Velocity));
                          //}
                      }
                  }
                  
                  simulated function PostBeginPlay()
                  {
                      Super.PostBeginPlay();
                      SetTimer(0.1, true);
                  }

                  Comment

                  Working...
                  X