Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Pathfinder Roleplaying Game

Notices

Reply
 
Thread Tools Display Modes
Tengu1958
Junior Member
 
Join Date: Nov 2013
Location: Sugar Land, TX
Posts: 27

Old October 14th, 2014, 08:49 PM
I am trying to add +2 damage to the hero when they fight with a single one-hand melee weapon. My current results give every weapon +2 damage.


Pre-attributes Priority 10000 Index 1


~ If we're disabled, do nothing
doneif (tagis[Helper.FtDisable] <> 0)

foreach pick in hero from BaseWep where "wCategory.Melee & (wClass.Light | wClass.OneHanded)"
if (eachpick.field[gIsEquip].value <> 0) then
field[abValue].value += 1
endif
nexteach

~ Add to our damage bonus
hero.child[Damage].field[tDamBonus].value += field[abValue2].value


Thanks for any insight you can provide.
Tengu1958 is offline   #1 Reply With Quote
AndrewD2
Senior Member
 
Join Date: Mar 2007
Location: Muskegon, MI
Posts: 2,977

Old October 14th, 2014, 08:57 PM
Something like this

Code:
      doneif (tagis[Helper.FtDisable] <> 0)

      foreach pick in hero from BaseWep where "wCategory.Melee & (wClass.Light | wClass.OneHanded)"
        if (eachpick.tagis[Hero.MainHand] + eachpick.tagis[Hero.OffHand] = 1) then
          eachpick.field[wDamage].value += 2
        endif
      nexteach
This is untested, but should give you a good start
AndrewD2 is offline   #2 Reply With Quote
Tengu1958
Junior Member
 
Join Date: Nov 2013
Location: Sugar Land, TX
Posts: 27

Old October 14th, 2014, 09:02 PM
I pasted it in real quick and no change in the result. Thanks for responding though.
Tengu1958 is offline   #3 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,728

Old October 14th, 2014, 10:43 PM
Quote:
Originally Posted by Tengu1958 View Post
Code:
      ~ If we're disabled, do nothing
      doneif (tagis[Helper.FtDisable] <> 0)
 
      foreach pick in hero from BaseWep where "wCategory.Melee & (wClass.Light | wClass.OneHanded)"
      if (eachpick.field[gIsEquip].value <> 0) then
     field[abValue].value += 1
      endif
      nexteach
  
      ~ Add to our damage bonus
      hero.child[Damage].field[tDamBonus].value += field[abValue2].value
Thanks for any insight you can provide.
Lets take a quick look at your above logic and it what its done in plain english.

Loop through all "weapons" that are on the character that are Melee and Light or One-handed. For each one you find that is equipped in the main hand only add one to a variable.

Then at the very end you have that variable add to the "Damage" bonus Pick which adds to "EVERY" weapon on the character. So the more equipped weapons on your character the more damage it does.

Andrew's code is 99% correct. But it includes ALL the code you want to include so you especially want to remove the hero.child[Damage] logic that adds to all weapons.

The only part of Andrew's code that is off is the "field[wDamage]" as that is actually the "die size" of the weapon. So that needs to be changed. But I think its best for a person to learn how to find the field themselves.

So go to "Develop->Enable Data File Debugging". Then add a weapon to your character and right click on the "?". In the new window click on "Show Debug Fields for xxxxx". This will display a huge list of "fields" that exist on this "Pick" (ie Weapon) and what its final value is. Do you see any "field" that would work for adding to for "Bonus Damage"?

Hero Lab Resources:
Pathfinder - d20pfsrd and Pathfinder Pack Setup
3.5 D&D (d20) - Community Server Setup
5E D&D - Community Server Setup
Hero Lab Help - Hero Lab FAQ, Editor Tutorials and Videos, Editor & Scripting Resources.
Created by the community for the community
- Realm Works kickstarter backer (Alpha Wolf) and Beta tester.
- d20 HL package volunteer editor.
ShadowChemosh is online now   #4 Reply With Quote
Tengu1958
Junior Member
 
Join Date: Nov 2013
Location: Sugar Land, TX
Posts: 27

Old October 15th, 2014, 07:11 AM
I did not know I could look at those lists of fields like that with the right clicking. Pretty cool. I saw a bunch of fields that might work and tried them all and still not getting bonus weapon damage. This is how my code looks now:

Pre-Levels Priority 5000 Index 1

~ If we're disabled, do nothing
doneif (tagis[Helper.FtDisable] <> 0)

foreach pick in hero from BaseWep where "wCategory.Melee & (wClass.Light | wClass.OneHanded)"
if (eachpick.tagis[Hero.MainHand] + eachpick.tagis[Hero.OffHand] = 1) then
eachpick.field[wDamBonus].value += 2
endif
nexteach


I also tried it with wDamMelee and several of the dmmXXXXXX fields as well, such as enhancement bonus and trait bonus for damage.

Last edited by Tengu1958; October 15th, 2014 at 07:19 AM.
Tengu1958 is offline   #5 Reply With Quote
Tengu1958
Junior Member
 
Join Date: Nov 2013
Location: Sugar Land, TX
Posts: 27

Old October 15th, 2014, 08:51 AM
I forgot to mention that it still does not function.
Tengu1958 is offline   #6 Reply With Quote
AndrewD2
Senior Member
 
Join Date: Mar 2007
Location: Muskegon, MI
Posts: 2,977

Old October 15th, 2014, 09:09 AM
This is the point in time where you start testing the timing, I suggest trying Post-Levels 10000 with the wDamMelee field
AndrewD2 is offline   #7 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,728

Old October 15th, 2014, 11:23 AM
Andrew has a good point. Also you are "equipping" a weapon on the "Weapon" tab right? The above script logic is designed to only work for a light/one-handed weapon that is equipped in the main or off-hand.

The "next" idea also is to use "debug" commands to debug your script. Once added you can see the results by going to "Debugging->View Floating Info Windows->Debug Output". I am not near HL but think that is right so the wording will be close not exact. Sorry:

Code:
debug "Start"
doneif (tagis[Helper.FtDisable] <> 0)
debug "Not Disabled"
      foreach pick in hero from BaseWep where "wCategory.Melee & (wClass.Light | wClass.OneHanded)"
debug "Found: " & eachpick.field[name].text
        if (eachpick.tagis[Hero.MainHand] + eachpick.tagis[Hero.OffHand] = 1) then
debug eachpick.field[name].text & " is equipped"
          eachpick.field[wDamBonus].value += 2
debug "Damage Bonus: " & eachpick.field[wDamBonus].value
        endif
      nexteach

Hero Lab Resources:
Pathfinder - d20pfsrd and Pathfinder Pack Setup
3.5 D&D (d20) - Community Server Setup
5E D&D - Community Server Setup
Hero Lab Help - Hero Lab FAQ, Editor Tutorials and Videos, Editor & Scripting Resources.
Created by the community for the community
- Realm Works kickstarter backer (Alpha Wolf) and Beta tester.
- d20 HL package volunteer editor.
ShadowChemosh is online now   #8 Reply With Quote
AndrewD2
Senior Member
 
Join Date: Mar 2007
Location: Muskegon, MI
Posts: 2,977

Old October 15th, 2014, 11:30 AM
There is also an important question to answer, is this only supposed to work if you're wielding 1 and only 1 weapon in a hand? Or does it work wielding say 2 daggers one in each hand?
AndrewD2 is offline   #9 Reply With Quote
Tengu1958
Junior Member
 
Join Date: Nov 2013
Location: Sugar Land, TX
Posts: 27

Old October 15th, 2014, 08:20 PM
I have been trying this with a long sword equipped.

The timing change did the trick. Apparently I need to study this timing thing a bit more. I also used the wDamMelee. When I was looking at the fields list it seemed the most logical choice.

And to answer you question about wielding. This is for a single one hand weapon wielder. It should not work for a dual wielder, though shields are fine.

And I just added a dagger and that weapon has the bonus damage as well. Let me look at the code Shawdow Chemosh posted.

Thanks both of you for the help. Not a programmer so I have tough time figuring the logic out some times.
Tengu1958 is offline   #10 Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 12:41 PM.


Powered by vBulletin® - Copyright ©2000 - 2021, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.