• 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

Swapping INT for DEX modifier in ranged attack

Siminic

Member
Want to swap INT modifier for DEX modifier for a ranged attack weapon...

I have an eval script set to post-attributes, with the following:

Code:
wAttBonus.value = hero.child[Attack].field[tAtkRanged].value
 - hero.child[aDEX].field[aModBonus].value
 + hero.child[aINT].field[aModBonus].value

The part after the = is evaluating fine, but I have no examples that I can find in the tutorial, help, or in the forums for what the code in front of the = should look like.

Suggestions? Improvements to my thinking? I realize I could modify the overall range attack bonus, but want it specific to this weapon.
 
I realize I could modify the overall range attack bonus, but want it specific to this weapon.
So the above eval script is running on a specific weapon then. If that is the case you can just use something like field[wAttRange].value for before the equal sign. I am also thinking you will need to a much later phase/timing as your change could get overridden still.

I am only about 90% sure that is the correct field name. To double check you can add the weapon to a character and then Right click on the "?" to get a list of choices. Take the one called something like "View Field names". Sorry not near HL right now.

If you don't see that you have to go to the develop menu, make sure the first option, "Enable Data File Debugging" is checked. This way you can start seeing the name of the fields on Things and their values. Really helpful. Plus this lets you do a Ctrl-R which does a quick reload of the data set. Also very helpful when making changes.
 
Played around with it a bit more. Thanks for the suggestions.

In the end, I couldn't seem to force the wAttRanged field to get updated last, even running it with a 11111 priority in the render phase, so as a workaround, had it add as a attack bonus based on the difference:

Code:
field[wAttBonus].value = hero.child[aINT].field[aModBonus].value
 - hero.child[aDEX].field[aModBonus].value

Works for positive and negative values. The idea is actually based on a user weapon you created (TouchAttacks.user), so I can send you the code if you want.
 
Back
Top