Tripwire Interactive Forums

Go Back   Tripwire Interactive Forums > Killing Floor Forums > Killing Floor Modifications > Coding

Reply
 
Thread Tools Display Modes
  #1  
Old 05-05-2012, 05:17 PM
Dinamix Dinamix is offline
Senior Member
 
Join Date: Mar 2012
Posts: 190
Default I have a question about wich it will use >=1 or >=11

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 by Dinamix; 05-05-2012 at 05:43 PM. Reason: edit
Reply With Quote
  #2  
Old 05-05-2012, 06:21 PM
FluX FluX is offline
Senior Member
 
Join Date: Oct 2010
Posts: 5,017
Default

Quote:
Originally Posted by Dinamix View Post
So if i am at level 10 i will get 2.0 and when i will be 21lvl i will get 3.05 Right ?
This
__________________

www.fluxiservice.com - Friendly, supportive game server host awaiting your arrival.
>> My Custom Content Archive <<
Reply With Quote
  #3  
Old 05-05-2012, 07:14 PM
Dinamix Dinamix is offline
Senior Member
 
Join Date: Mar 2012
Posts: 190
Default

Quote:
Originally Posted by FluX View Post
This
And could you explain how to understand this ?
return 1.0 + (0.12 * FMin(float(KFPRI.ClientVeteranSkillLevel), 5.0))
and this
return (1.0 + (0.08 * float(Min(KFPRI.ClientVeteranSkillLevel, 5))))
Min-minimum and FMin also minimum or it means the maximum value can be alowed?
Reply With Quote
  #4  
Old 05-05-2012, 07:56 PM
FluX FluX is offline
Senior Member
 
Join Date: Oct 2010
Posts: 5,017
Default

Quote:
Originally Posted by Dinamix View Post
return 1.0 + (0.12 * FMin(float(KFPRI.ClientVeteranSkillLevel), 5.0))
Basically it's going to return a number from this equation (obvious ) 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.
__________________

www.fluxiservice.com - Friendly, supportive game server host awaiting your arrival.
>> My Custom Content Archive <<
Reply With Quote
  #5  
Old 05-05-2012, 08:20 PM
Dinamix Dinamix is offline
Senior Member
 
Join Date: Mar 2012
Posts: 190
Default

Quote:
Originally Posted by FluX View Post
Basically it's going to return a number from this equation (obvious ) 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
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:23 AM.


Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright 2005 - 2014, Tripwire Interactive, LLC