Lone Wolf Development Forums  

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

Notices

Reply
 
Thread Tools Display Modes
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old November 30th, 2015, 07:17 PM
Quote:
Originally Posted by stuartwaring View Post
I was using a foreach loop, but that didnt work either, hence my attempt to change it to this. I could try and reinstate the foreach loop, but would I be searching in BaseWep for the Foe-Biting tag?
Yep. All weapons are part of the Component BaseWep. Foe-Biting sets an ability tag on the weapon as "HasAbility.laFoeBite" which can be searched for. I found this tag by adding a Foe-Biter weapon to a character and right clicking on the "?" and selecting "Show Debug Tags". Then in the search section I simply typed in "Foe-Biter" to see what I saw.

So taking the foreach loop from VS feat.
Code:
      ~ Loop through all weapons on the hero except Touch Attacks
      ~ and any Ammunition.
      foreach pick in hero from BaseWep where "!(thingid.wRay|wCategory.Ammunition|thingid.wTouch|wCategory.AmmoCart)"
      nexteach
We can see or read the comments that its going to find every weapon on the hero except touch attacks or ammunition.

We need to add logic so that we only find weapons that have the Foe-Biter ability:
Code:
      ~ Loop through all weapons that have Foe-Biter ability
      foreach pick in hero from BaseWep where "HasAbility.laFoeBite"
      nexteach
Then you can change your logic to not use hero.child[iMagWeapon] and instead use "eachpick". Eachpick represent the current weapon that the foreach loop is processing.

This should cause your logic to now run on any Foe-Biter weapon on your character.

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 offline   #11 Reply With Quote
stuartwaring
Member
 
Join Date: Jan 2015
Location: Wellington, NZ
Posts: 91

Old December 1st, 2015, 09:25 AM
I have changed it all around to use that logic - and now it does not do anything at all!

I cannot figure out why not - as far as i can see and am able to check this should work, unless it is because of the timing (it is Render phase, Priority 200,000)

Here is the current code

Code:
doneif (field[abilActive].value = 0)

    	  var iX    as number
     iX=1


  ~ Loop through all weapons that have Foe-Biter ability
      foreach pick in hero from BaseWep where "HasAbility.laFoeBite"
               
~ Assume one handed damage
        iX = 0
        ~ If two handed weapon set to two-handed damage
        If (eachpick.tagis[wClass.TwoHanded] <> 0) Then
          iX = 1
        ~ If one handed and used in two hands then damage is two-handed
        ElseIf (eachpick.tagis[wClass.OneHanded] + eachpick.tagis[Hero.MainHand] + eachpick.tagis[Hero.OffHand] = 3) Then
          iX = 1
        ~ If used in off-hand
        ElseIf (eachpick.tagis[Hero.OffHand] - eachpick.tagis[Hero.MainHand] = 1) Then
          iX = 4
        Endif

    
~checks if the weapons are legendary and equipped
if (eachpick.field[gIsLegend].value <> 0 ) then 
if (eachpick.field[gIsEquip].value <> 0) then

~Changes the damage shown
eachpick.field[wFixDamage].text = "(" & eachpick.field[wDamageTbl].arraytext[iX] & ") x2"

eachpick.field[wDamExtra].text = ""

endif
endif
nexteach
stuartwaring is offline   #12 Reply With Quote
stuartwaring
Member
 
Join Date: Jan 2015
Location: Wellington, NZ
Posts: 91

Old December 1st, 2015, 09:43 AM
Sorted it out - IaFoeBite needed to be replace with the ID of my version.
stuartwaring is offline   #13 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old December 1st, 2015, 12:38 PM
Quote:
Originally Posted by stuartwaring View Post
Sorted it out - IaFoeBite needed to be replace with the ID of my version.
oh I thought you where running this on a Mechanic or something not on the power itself. In that case you would actually want to use a parent.container with no foreach loop. It would work for all weapons then and be WAY less CPU intensive.

I try and never ever use the Replace Thing ID as it always comes back to bit me later. So I "assumed" this was on a Mechanic script that would be looking to Modify Foe-Bite weapons.

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 offline   #14 Reply With Quote
stuartwaring
Member
 
Join Date: Jan 2015
Location: Wellington, NZ
Posts: 91

Old December 1st, 2015, 03:03 PM
I have never tried that, or even known it was possible. how do you do it as a mechanic?
stuartwaring is offline   #15 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old December 1st, 2015, 03:31 PM
Quote:
Originally Posted by stuartwaring View Post
I have never tried that, or even known it was possible. how do you do it as a mechanic?
On the General tab in the Editor is a "Mechanic" tab. Basically what that means is that a "Mechanic" pick is always attached to the Hero. So you make a new one called "House-Rules" and restart HL. If you look at the Picks on the character you will see the "House-Rules" mechanic now on the hero.

This lets you setup or run "global" scripts for all characters. I have one of these setup for each and Every community Pack actually. In addition I use this as a place to define any "global" dynamic tags as a mechanic always loads and becomes live so those "Tags" then are always around and in a central place.

One step further on this logic is to not make new scripts ON the mechanic itself and instead make a "Simple" Thing to hold the script logic. Then I bootstrap the Simple Thing to the Mechanic Thing and the Simple Thing comes along and will also be "live" on all characters. What makes this so nice is you can then put a Source to the "Simple" thing and only when that "Source" is turned on does your Script execute now.

HERE
is a link to the Simple Thing used in the Campaign Pack to hide all non-Eberron Deities. Its source marked to a option called "Hide Non-Eberron Deities". If you look up further in that link you will see the Campaign Mechanic with different Simple Helper Things attached to it.

Guess that maybe more info than you wanted but hopefully it helps...

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 offline   #16 Reply With Quote
stuartwaring
Member
 
Join Date: Jan 2015
Location: Wellington, NZ
Posts: 91

Old December 3rd, 2015, 08:55 AM
Hi Shadow,

I have tried putting it into a mechanic, but of course, i want this to be an activatable acitivity, and I am not sure how to get an activation checkbox to appear using the mechanic method.

When you talked about making that simple "Thing", where do you do that in the editor? I like the idea, but I have no experience of this sort of methodolgoy, though I am keen enough to lean!
stuartwaring is offline   #17 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,207

Old December 3rd, 2015, 09:00 AM
Quote:
Originally Posted by stuartwaring View Post
When you talked about making that simple "Thing", where do you do that in the editor? I like the idea, but I have no experience of this sort of methodolgoy, though I am keen enough to lean!
"Simple" is one of the tabs in the "General" grouping in the editor.
Mathias is online now   #18 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 02:41 PM.


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