• Please make sure you are familiar with the forum rules. You can find them here: https://forums.tripwireinteractive.com/index.php?threads/forum-rules.2334636/

Code How to Extend FP Rage Duration?

Josko

Grizzled Veteran
Nov 2, 2012
107
0
I've been trying to extend FleshPounds rage duration, but I can't get it to work!

I was thought it would be the same like with KFHumanPawn, make a CustomHumanPawn to extend KFHumanPawn, put in the things you want to change, create a CustomPlayerController and put this code in :

Code:
class CustomPlayerController extends KFPlayerController;
function SetPawnClass(string inClass, string inCharacter)
{
    PawnClass = Class'YOUR-PACKAGE-NAME-HERE.CustomHumanPawn';  
    inCharacter = Class'KFGameType'.Static.GetValidCharacter(inCharacter); 
    PawnSetupRecord = class'xUtil'.static.FindPlayerRecord(inCharacter); 
    PlayerReplicationInfo.SetCharacterName(inCharacter); 
}

then finally put these lines into the mutator inside the function PostBeginPlay():

level.Game.PlayerControllerClass = class'Name of package.CustomPlayerController';
level.Game.PlayerControllerClassName = "Name of package.CustomPlayerController";

Doing this works exelent with KFHumanPawn if you want to change let's say the RequiredEquipment so you don't start with a 9mm for example.

But I get stuck when trying to do the same with FleshPoundZombieController.

So far I've made a CustomZombieFleshPound.uc and put this code in it:

Code:
class CustomZombieFleshPound extends ZombieFleshPound;
function BeginState()
 {
        local float DifficultyModifier;
        bChargingPlayer = true;
  if( Level.NetMode!=NM_DedicatedServer )
   ClientChargingAnims();
        // Scale rage length by difficulty
        if( Level.Game.GameDifficulty < 2.0 )
        {
            DifficultyModifier = 3.00;
        }
        else if( Level.Game.GameDifficulty < 4.0 )
        {
            DifficultyModifier = 6.0;
        }
        else if( Level.Game.GameDifficulty < 5.0 )
        {
            DifficultyModifier = 1.25;
        }
        else // Hardest difficulty
        {
            DifficultyModifier = 3.0; // Doubled Fleshpound Rage time for Suicidal and HoE in Balance Round 1
        }
  RageEndTime = (Level.TimeSeconds + 5 * DifficultyModifier) + (FRand() * 6 * DifficultyModifier);
  NetUpdateTime = Level.TimeSeconds - 1;
 }
 function EndState()
 {
        bChargingPlayer = False;
        bFrustrated = false;
        FleshPoundZombieController(Controller).RageFrustrationTimer = 0;
  if( Health>0 )
  {
   GroundSpeed = GetOriginalGroundSpeed();
  }
  if( Level.NetMode!=NM_DedicatedServer )
   ClientChargingAnims();
  NetUpdateTime = Level.TimeSeconds - 1;
 }
 
 defaultproperties
{
     ControllerClass=Class'SuperSpecimen_Xmas.CustomFleshpoundZombieController'
}

Then I made a CustomFleshPoundZombieController.uc and put THIS code in:

Code:
class CustomFleshPoundZombieController extends FleshPoundZombieController;
state ZombieHunt
{
 event SeePlayer(Pawn SeenPlayer)
 {
  if ( !bDoneSpottedCheck && PlayerController(SeenPlayer.Controller) != none )
  {
   // 95% chance of first player to see this Fleshpound saying something
   if ( !KFGameType(Level.Game).bDidSpottedFleshpoundMessage && FRand() < 0.95 )
   {
    PlayerController(SeenPlayer.Controller).Speech('AUTO', 12, "");
    KFGameType(Level.Game).bDidSpottedFleshpoundMessage = true;
   }
   bDoneSpottedCheck = true;
  }
  super.SeePlayer(SeenPlayer);
 }
}

I'm fairly sure I should have some code to connect to CustomZombieFleshPound.uc because it's there the Rage Duration is.

But I have no idea what the code should be, if it should be similar like the code in the CustomPlayerController.uc.

Then after that I should have some code in the mutator itself in the function PreBeginPlay() to load the whole thing into game. And those are the two things im stuck on.

I don't know the code to put in CustomFleshPoundZombieController.uc or if it's similar to the CustomPlayerController.uc code and finally, I'm not sure what I'll write in the mutator to load the whole thing.

Help anyone? :)