• 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 I have a question about wich it will use >=1 or >=11

Dinamix

Grizzled Veteran
Mar 23, 2012
199
1
Hello, I am moding perk bonuses and I have a question:
Code:
if ( KFPRI.ClientVeteranSkillLevel == 0)
	return float(InDamage) * 1.05;
else if ( KFPRI.ClientVeteranSkillLevel >= 1 )
	return float(InDamage) * (1.0 + (0.10 * float(KFPRI.ClientVeteranSkillLevel))); 
else if ( KFPRI.ClientVeteranSkillLevel >= 21 )
        return float(InDamage) * (3.0 + (0.05 * float(KFPRI.ClientVeteranSkillLevel - 20)));

So if i am at level 10 i will get 2.0 and when i will be 21lvl i will get 3.05 Right ? Or just will use the highest return ( from 3.05 in my situation)

Or i have to do it like this ?

Code:
if ( KFPRI.ClientVeteranSkillLevel == 0 )
	return float(InDamage) * 1.05;
else  if ( KFPRI.ClientVeteranSkillLevel >= 1 )
       return float(InDamage) * (1.0 + (0.10 * float(KFPRI.ClientVeteranSkillLevel)));
                if ( KFPRI.ClientVeteranSkillLevel >= 21 )
		          return float(InDamage) * (3.0 + (0.05 * float(KFPRI.ClientVeteranSkillLevel - 20)));
 
Last edited:
return 1.0 + (0.12 * FMin(float(KFPRI.ClientVeteranSkillLevel), 5.0))
Basically it's going to return a number from this equation (obvious :p ) but it does a little formula check within itself.

Ok i'll try explain it to my best and I have coloured it to try make more sense.

Green = The client's current perk level as a number.
Blue = Checks to see what is smaller, the perks level OR "5". If the level was 6, the FMin will choose 5 as the number to use as it is smaller.

Orange = This will be multiplied by the FMin number given, whether it's the perks level or "5". Whatever is the smaller number.

The overal number from the equation is then added to "1" and returning the outcome.

Try figure out the other one for yourself from my explaination above. See it as homework ;)
It's always nice to try figure stuff out yourself to show you have understood something. Ask away if you have anymore questions.
 
Upvote 0
Basically it's going to return a number from this equation (obvious :p ) but it does a little formula check within itself.

Ok i'll try explain it to my best and I have coloured it to try make more sense.

Green = The client's current perk level as a number.
Blue = Checks to see what is smaller, the perks level OR "5". If the level was 6, the FMin will choose 5 as the number to use as it is smaller.

Orange = This will be multiplied by the FMin number given, whether it's the perks level or "5". Whatever is the smaller number.

The overal number from the equation is then added to "1" and returning the outcome.

Try figure out the other one for yourself from my explaination above. See it as homework ;)
It's always nice to try figure stuff out yourself to show you have understood something. Ask away if you have anymore questions.
Thnx Flux i just didin't know what does it mean Fmin ,other things i figured out ,but still maybe other newbies will also understand :).
-Cheers
 
Upvote 0