Junior Member
Join Date: Aug 2011
Posts: 21
|
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 |
#1 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
Code:
where "IsWeapon.wCompLong | IsWeapon.wCompShort" 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. |
#2 |
Junior Member
Join Date: Aug 2011
Posts: 21
|
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. |
#3 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
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"
|
#4 |
|
|