Keep Stamina online

  • 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.
Apr 21, 2003
2,274
2
38
Europe
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?
 

STELLAR 7

Why the urge to improve yourself?
Nov 17, 2005
63
0
6
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;
	}
}