• 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

Weapons specific damage and attack bonuses

Gumbytie

Well-known member
So I have never tried to apply these bonuses to one particular weapon when equipped.

Example, from the Fantasy Companion the "Pathblocker". It grants the wielder +2 to his Fighting and damage rolls...

So this code works sort of:
Pre-Traits/5000

Code:
if (field[grIsEquip].value <> 0) then
   perform #traitprof[skFighting,+,2,"Pathblocker"]
   perform hero.child[miSFAPathblocker].setfocus
   focus.field[wpDmgBonus].value += 2
endif

Equip the weapon and the bonuses apply. But they apply to Fighting and the damage bonus to EVERY weapon character has, including Unarmed.

So can you make a script that applies bonuses like that JUST to the equipped weapon? I guess the same would apply for an equipped item.

Once again, just additional coding that would prove more useful for someone running game within HeroLab.
 
A good start hint, thank you very much. I can sorta see where I am supposed to going with this but Trademark Weapon uses a Chosen field to drive it.

I need this to work on a magic weapon the character "purchases".

So I get to this:
Code:
if (field[grIsEquip].value <> 0) then
   foreach pick in hero where "component.WeaponBase"
      if (eachpick.uniqindex = field[usrChosen1].chosen.uniqindex) then
        eachpick.field[wpDmgBonus].value += 2
        perform #traitprof[skFighting,+,2,"Pathblocker"]
      endif
   nexteach
endif

This of course throws an error because nothing is "chosen". I am not grokking what I need to replace in this line to move forward.
Code:
if (eachpick.uniqindex = field[usrChosen1].chosen.uniqindex) then

So the field[usrChosen1].chosen. section is what I need to swap out I think. Nothing I have tried so far works.
 
But this isn't a weapon the user "adds" magic ability to. This is a weapon in the existing Fantasy Companion. There are several similar weapons that have these kind of affects (effects?) but there is no code to support a player using character within HeroLab. So I have been going through trying to add code to various magic weapons/armour/items that we are using in our game minus the bunch precluded.

So I was trying to code what I could. In this case, the weapon from Fantasy Companion 2 (SWADE):

PATHBLOCKER: Pathblocker is a long, sturdy spear that grants the wielder +2 to his Fighting and damage rolls and the First Strike Edge.

I know the code within HeroLab right now is for Fantasy Companion Deluxe so some stuff doesn't seem to work in SWADE. Like the Bootstrapping of Edges.

I know you are working on Fantasy Companion 2 for SWADE. I could hold off on too many magic items I guess.

Although the question I have would still pertain...unless in your work you are already accounting for this :)
 
Well, they've completely changed how magic items work as far as construction. In Deluxe, you could do pretty much whatever. In SWADE, there aren't any open construction rules like that.
 
Hmm, okay, but this isn't for construction. Assuming I am understanding.

This is magic weapon listed in the new Fantasy Companion, just something a player can select normally.

I was just going through trying to add code to default magic items that allowed a user more options within HeroLab if they using it for play. Just like we have for many skills, Edges, etc.

I know some are just not possible to code with how HeroLab creating SW so I may be bumping up against limitations.

Maybe I should just wait and see what you complete and gets released for Fantasy Companion 2 and SWADE updates?
 
Heh, I think we got sidetracked. My original problem was the script at top of this thread would affect ALL weapons, etc. I was trying to figure out how to limit the effects to just applying to that weapon when equipped.

Again, this is just trying to push HeroLab a bit so there is more functionality if player/GM using HeroLab while running a game.

The magic items load just fine. There is just no code to support some of the magic effects. Again, I also don't know when I am hitting the limit of what HeroLab can and cannot achieve, or I am not smart enough :).
 
Last edited:
Don't modify Fighting Skill. Add to the items wpBonus. That will just affect the weapon.
And adding to wpDmgBonus is affecting all weapons??
 
So this latest suggestion worked.

Pre-Traits/5000

Code:
if (field[grIsEquip].value <> 0) then
   foreach pick in hero where "thingid.miSFAPath2"
        eachpick.field[wpDmgBonus].value += 2
        eachpick.field[wpBonus].value += 2
   nexteach
endif

No errors and not effecting any other weapon. Thanks Cape!

One more problem licked.
 
Back
Top