• 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

Recognizing Composite Bows in scripts?

Quatar

Member
Hi

I'm trying to manually add a feat to Herolabs that increases the damage of Composite Bows by +2, but I'm not sure really how to reliably recognize them.

So far I went with this, and it seems to work well enough.

Code:
foreach pick in hero from BaseWep where "IsWeapon.wCompLong" 
  eachpick.field[wDamBonus].value += 2
nexteach

foreach pick in hero from BaseWep where "IsWeapon.wCompShort" 
  eachpick.field[wDamBonus].value += 2
nexteach

But is there a better way to do it?
 
Code:
where "IsWeapon.wCompLong | IsWeapon.wCompShort"

So you only need a single foreach.

There's not a tag or anything else that specifically distinguishes composite bows from regular bows, so looking for each of the composite weapons specifically is probably the best you can do.
 
Ah thank you that's working.
I've been looking for an OR, but wasn't able to find it. :) I had tried OR and || but didn't think of a single |

"IsWeapon.wComp?" did work as well, but I feared it might suddenly trigger on other weapons that start with Comp for some reason, even though I didn't know if there are any.
 
Yes, a ? in a tag expression matches anything after that point, but I agree that I wouldn't trust users to only use "wComp" for new composite weapons that were added, and wouldn't trust that with all the content that could possibly be added, that some weapon that isn't a composite bow won't end up beginning its Id with "wComp"
 
Back
Top