• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

Kick

Frodie

Well-known member
I need help with Firearm kick.

Basically I need to make the str bonuses to be no more that +2.
I can add the str bonus but can't cap it at 2

field[wAttBonus].value += maximum(#attrmod[aSTR], 0)
 
var bonus as number
bonus += maximum(#attrmod[aSTR], 0)

if (bonus > 0) then
bonus = minimum(bonus, 2)
endif

field[wAttBonus].value += bonus
 
Here's a version with even less typing:

Code:
field[wAttBonus].value += minimum(#attrbonus[aSTR],2)

(#attrbonus[] is #attrmod[] with maximum(,0) built in). (There's also #attrbonus1[])
 
Code:
#attrbonus1[aSTR]

is translated by the compiler into:

Code:
maximum(hero.child[aSTR].field[aModBonus].value,1)

(See the v2.4 FAQ entry for the announcement of this one)
 
Sweet!

Thanks, useful macros for putting in my tool belt...

You may want to search the FAQ for "macro"
Yea I should and compile them all together actually. Hmm a wiki would work really well for all this....

So use to having online manuals for my programming languages that I miss it for HL.
 
Back
Top