KF [Help]How do I insert another level conditions? 3 conditions,i mean

  • 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/

zzckeroro

FNG / Fresh Meat
Oct 28, 2014
8
0
0
i want to add another level condition to SupportSpec. 3 level conditions:welding, kill monsters with shotgun,kill stalkers with assult rifles.
heres what i have done in SRVetSupportSpec.uc
Code:
static function int GetPerkProgressInt( ClientPerkRepLink StatOther, out int FinalInt, byte CurLevel, byte ReqNum )
{
	switch( CurLevel )
	{
	case 0:
		if( ReqNum==0 )
			FinalInt = 1000;
		else if(ReqNum==1) 
				FinalInt = 1000;
				else FinalInt =10
		break;
	case 1:
		if( ReqNum==0 )
			FinalInt = 2000;
		else if(ReqNum==1)
				FinalInt = 5000;
				else FinalInt = 30;
		break;
	case 2:
		if( ReqNum==0 )
			FinalInt = 7000;
		else if(ReqNum==1)
				FinalInt = 100000;
				else FinalInt = 100;
		break;
	case 3:
		if( ReqNum==0 )
			FinalInt = 35000;
		else if(ReqNum==1)
				FinalInt = 500000;
				else FinalInt = 350;
		break;
	case 4:
		if( ReqNum==0 )
			FinalInt = 120000;
		else if(ReqNum==1)
				FinalInt = 1500000;
				else FinalInt = 1200;
		break;
	case 5:
		if( ReqNum==0 )
			FinalInt = 250000;
		else if(ReqNum==1)
				FinalInt = 3500000;
				else FinalInt = 2300;
		break;
	case 6:
		if( ReqNum==0 )
			FinalInt = 370000;
		else if(ReqNum==1)
				FinalInt = 5500000;
				else FinalInt = 3600;
		break;
	default:
		if( ReqNum==0 )
			FinalInt = 370000+GetDoubleScaling(CurLevel,35000);
		else if(ReqNum==1)
				FinalInt = 5500000+GetDoubleScaling(CurLevel,500000);
				else FinalInt = 3600+GetDoubleScaling(CurLevel,350);
		break;
	}
	if( ReqNum==0 )
		return Min(StatOther.RWeldingPointsStat,FinalInt);
	else if(ReqNum==1)
			return Min(StatOther.RShotgunDamageStat,FinalInt);
			else return Min(StatOther.RStalkerKillsStat,FinalInt);
}

I know there is much more to be done.But i don't know what shall i do next.would you guys help me a little? im a new hand,please tell me how to do it in detail,please.i beg you.:p
 

Dr_Killjoy

FNG / Fresh Meat
Sep 30, 2012
260
0
0
Something like this:
Code:
class SRVeterancyTypes extends KFVeterancyTypes
	abstract;
// Some var delcarations
struct structReqArray
{
	var string StatName;
	var array<int> Level;
	var int DoubleScalingStart;
	var int DoubleScalingStep;
};
var array<structReqArray> RequirementsEx;
// Some var declarations
// Some function definitions
static function int GetPerkProgressInt( ClientPerkRepLink StatOther, out int FinalInt, byte CurLevel, byte ReqNum)
{
	ReqNum = Clamp(0,ReqNum,RequirementsEx.Length-1);
	if (RequirementsEx[ReqNum].Level.Length <= CurLevel)
		FinalInt = RequirementsEx[ReqNum].DoubleScalingStart + GetDoubleScaling(CurLevel,RequirementsEx[ReqNum].DoubleScalingStep);
	else
		FinalInt = RequirementsEx[ReqNum].Level[CurLevel];
	return Min(int(StatOther.GetPropertyText(RequirementsEx[ReqNum].StatName)),FinalInt);
}
// Some function definitions
defaultproperties
{
	// some defaults
	NumRequirements=3
	RequirementsEx(0)=(StatName="RShotgunDamageStat",Level=(0,100000,500000),DoubleScalingStart=245345346245,DoubleScalingStep=53466)
	RequirementsEx(1)=(StatName="RWeldingPointsStat",Level=(0,100,500),DoubleScalingStart=245345346245,DoubleScalingStep=53466)
	RequirementsEx(2)=(StatName="RStalkerKillsStat",Level=(0,5,25),DoubleScalingStart=245345346245,DoubleScalingStep=53466)
	// some defaults
}
Put the numbers by yourself.
 

zzckeroro

FNG / Fresh Meat
Oct 28, 2014
8
0
0
Something like this:
Code:
class SRVeterancyTypes extends KFVeterancyTypes
	abstract;
// Some var delcarations
struct structReqArray
{
	var string StatName;
	var array<int> Level;
	var int DoubleScalingStart;
	var int DoubleScalingStep;
};
var array<structReqArray> RequirementsEx;
// Some var declarations
// Some function definitions
static function int GetPerkProgressInt( ClientPerkRepLink StatOther, out int FinalInt, byte CurLevel, byte ReqNum)
{
	ReqNum = Clamp(0,ReqNum,RequirementsEx.Length-1);
	if (RequirementsEx[ReqNum].Level.Length <= CurLevel)
		FinalInt = RequirementsEx[ReqNum].DoubleScalingStart + GetDoubleScaling(CurLevel,RequirementsEx[ReqNum].DoubleScalingStep);
	else
		FinalInt = RequirementsEx[ReqNum].Level[CurLevel];
	return Min(int(StatOther.GetPropertyText(RequirementsEx[ReqNum].StatName)),FinalInt);
}
// Some function definitions
defaultproperties
{
	// some defaults
	NumRequirements=3
	RequirementsEx(0)=(StatName="RShotgunDamageStat",Level=(0,100000,500000),DoubleScalingStart=245345346245,DoubleScalingStep=53466)
	RequirementsEx(1)=(StatName="RWeldingPointsStat",Level=(0,100,500),DoubleScalingStart=245345346245,DoubleScalingStep=53466)
	RequirementsEx(2)=(StatName="RStalkerKillsStat",Level=(0,5,25),DoubleScalingStart=245345346245,DoubleScalingStep=53466)
	// some defaults
}
Put the numbers by yourself.

i dont understand your code ,but i still want to say thank you very much.i'll study your code .