1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

Keep Stamina online

Discussion in 'Troubleshooting' started by Psychomorph, May 4, 2010.

  1. Psychomorph

    Psychomorph  

    Joined:
    Apr 21, 2003
    Messages:
    2,273
    Likes Received:
    2
    XploD says the keep stamina mutator doesn't work online. The position of the mut in the mut-list doesn't matter, it works off-line for me. Is there a way to get it to work online?
     
  2. C.Inigo

    C.Inigo INDIGO

    Joined:
    Nov 17, 2005
    Messages:
    61
    Likes Received:
    0
    I'm not sure if it can be done with a mutator, you will need to experiment with replication.
    The easiest way to do this really is to use a subclass of INFc_CHSoldier for the game type.
    I wrote a version of the INF - Coop Game to use this method where maximum stamina is maintained directly in the player class (ie. INF_CoopSoldier extends INFc_CHSoldier).

    These are the states to keep stamina maxed to the current maximum stamina (which I modified to reflect the player's health).
    Code:
    state PlayerSwimming
    {
    ignores SeePlayer, HearNoise, Bump;
    
    	function PlayerMove( float DeltaTime )
    	{
    		local float BoostedStam;
    
    		Super.PlayerMove(DeltaTime);
    
    		BoostedStam = Health * default.cMaxStamina/100;
    		if( cMaxStamina != BoostedStam)
    			cMaxStamina = BoostedStam;
    		if( MaxStamina != cMaxStamina )
    			MaxStamina = cMaxStamina;
    	}
    }
    
    state PlayerWalking
    {
    ignores SeePlayer, HearNoise, Bump;
    
    	function PlayerMove( float DeltaTime )
    	{
    		local float BoostedStam;
    
    		Super.PlayerMove(DeltaTime);
    
    		BoostedStam = Health * default.cMaxStamina/100;
    		if( cMaxStamina != BoostedStam)
    			cMaxStamina = BoostedStam;
    		if( MaxStamina != cMaxStamina )
    			MaxStamina = cMaxStamina;
    	}
    }
     

Share This Page