Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - D&D 5th Edition SRD
Register FAQ Community Today's Posts Search

Notices

Reply
 
Thread Tools Display Modes
Mergon
Senior Member
 
Join Date: Sep 2012
Location: Ottawa, Canada
Posts: 788

Old May 29th, 2017, 09:56 AM
Ok, I need help. Here is my feat. It's broken atm but I need help with some scripting I've never used before.

What I need to do is check if an ability like the Goliath's Powerful Build ability is present. If it is I need add +1 to iCount. This allows abilities like Powerful Build to stack with the Brawny feat. (I've highlighted the sample script in red).

I tried using the #hasability macro but it wasn't detecting the presence of the
'ra5CEEMoBo' for some reason.

I think I should be using findchild but am unsure how to go about it.

I am shamelessly asking ShadowChemost for advice.

Phase: Post-attributes, Priority: 11000
Quote:
doneif (tagis[Helper.ShowSpec] = 0)

doneif (tagis[Helper.Disable] <> 0)

var iCount as number
iCount = 2
debug "Count = " & iCount

~ Goliath's Powerful Build ability
if (hero.child[ra5CEEMoBo].tagis[HasAbility.ra5CEEMoBo] <> 0) then
iCount += 1
debug "Count = " & iCount
endif


~ Firbolg's Powerful Build ability

~ Bear Totem Barbarian's 6th level ability
if (hero.child[c5CBbnABBe].tagis[HasAbility.c5CBbnABBe] > 0) then
iCount += 1
debug "Count = " & iCount
endif

var iLgt as number
var iHvy as number
var iMax as number

var iStr as number
iStr = hero.child[aSTR].field[aFinalVal].value

var iTemp as number

iTemp = (15*iStr*iCount)/3
iLgt = round(iTemp,0,-1)
iTemp = (15*iStr*iCount)/2
iHvy = round(iTemp,0,-1)
iTemp = (15*iStr*iCount)/1
iMax = round(iTemp,0,-1)

~herofield[tEncumLgt].value = herofield[tEncumLgt].value * iCount
~herofield[tEncumHvy].value = herofield[tEncumHvy].value * iCount
~herofield[tEncumMax].value = herofield[tEncumMax].value * iCount

herofield[tEncumLgt].value = iLgt
herofield[tEncumHvy].value = iHvy
herofield[tEncumMax].value = iMax

Watch your back, Conserve your ammo,
and NEVER cut a deal with a dragon!
Mergon is offline   #1 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old May 29th, 2017, 05:56 PM
So your checking the HasAbility.? tag on the Child. Sort of different but basically it should work except when using hero.child[] it should be throwing an error when the racial ability is not found.

The easy way here is to look for the Ability tag on the hero which should get placed pretty early. Otherwise the hero HasAbility.? tag is not placed until really late as its meant to be used by Pre-Req scripts.

Try this for an easy solution:
Code:
~ Goliath's Powerful Build ability
if (hero.tagis[Ability.ra5CEEMoBo] <> 0) then
  iCount += 1
endif
If for some reason that does not work which would be surprising to me. Or you need to test for the presence of a Pick very early in timing. You can simply test for the live state:
Code:
~ Goliath's Powerful Build ability LIVE on the Hero
if (hero.childlives[ra5CEEMoBo] <> 0) then
  iCount += 1
endif

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   #2 Reply With Quote
Mergon
Senior Member
 
Join Date: Sep 2012
Location: Ottawa, Canada
Posts: 788

Old May 29th, 2017, 07:50 PM
I'll look at it tomorrow. It should fix my issues I think.

hero.child[] was throwing errors and that was what was driving me batty.

childlives is new to me though. I'll have to remember it and add it to my list of commands.

Watch your back, Conserve your ammo,
and NEVER cut a deal with a dragon!
Mergon is offline   #3 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old May 29th, 2017, 08:08 PM
I sort of said that about hero.child[]. You could also replace the logic with hero.childfound[] instead and then you won't get an error message.

hero.child[] says the Pick "must" exist Live on the hero or throw an error to the user. hero.childfound[] says do stuff to a Pick "if" found else do nothing.

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   #4 Reply With Quote
Mergon
Senior Member
 
Join Date: Sep 2012
Location: Ottawa, Canada
Posts: 788

Old May 30th, 2017, 07:59 AM
Quote:
~ Goliath's Powerful Build ability
if (hero.tagis[Ability.ra5CEEMoBo] <> 0) then
iCount += 1
endif
This code worked perfectly as far as I can tell. I re-used it for the Firbolg and the 6th level Bear Totem barbarian ability and they also worked.

Many, many thanks.

Now I just have to figure out where my problem is with elf Keen Sight perception and my Perceptive feat script and the Unearthed Arcana Skill feats are complete and I'll move on to the racial feats.

Watch your back, Conserve your ammo,
and NEVER cut a deal with a dragon!
Mergon is offline   #5 Reply With Quote
Reply


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 07:19 AM.


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