Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - d20 System

Notices

Reply
 
Thread Tools Display Modes
thegreatone5224
Junior Member
 
Join Date: Aug 2018
Posts: 3

Old August 27th, 2018, 10:50 PM
Hello everyone,

I'm trying to figure out how to go about setting the duration of this custom class feature to a value based on whether or not a different ability was choosen.

Please advise.

if (#hasability[pngEleEBea] <> 0) then
duration = field[xTotalLev].value
else
duration = field[xTotalLev].value / 2
endif
thegreatone5224 is offline   #1 Reply With Quote
Sendric
Senior Member
 
Join Date: Jul 2010
Posts: 3,144

Old August 28th, 2018, 05:52 AM
Quote:
Originally Posted by thegreatone5224 View Post
Hello everyone,

I'm trying to figure out how to go about setting the duration of this custom class feature to a value based on whether or not a different ability was choosen.

Please advise.

if (#hasability[pngEleEBea] <> 0) then
duration = field[xTotalLev].value
else
duration = field[xTotalLev].value / 2
endif
Other than needing to declare the variable (var duration as number) this looks okay assuming #hasability works as intended here, and you're timing is set correctly. Are you getting an error?
Sendric is offline   #2 Reply With Quote
thegreatone5224
Junior Member
 
Join Date: Aug 2018
Posts: 3

Old August 28th, 2018, 07:25 AM
I'm not receiving any errors but the text is not updating as expected. If it helps I'll include everything below:

Code:
Phase: Post-levels
Priority: 10000
Index: 1

~ If we're not shown, just get out now
doneif (tagis[Helper.ShowSpec] <> 1)

~ if we've been disabled, get out now
doneif (tagis[Helper.SpcDisable] <> 0)

~ Set our duration based on class level and element boon
var duration as number

if (#hasability[pngEleEBea] <> 0) then
 duration = field[xTotalLev].value
else
 duration = field[xTotalLev].value / 2
endif

~ Update feature's duration
#duration[pngEleEBa] = duration
field[livename].text = field[thingname].text & " (" & duration & " mins)"
field[listname].text = field[thingname].text & " (" & duration & " mins)"

~ Add tool tip to dex save
#situational[hero.child[svDEX],"Advantage vs. all",field[thingname].text]
This is being done on a level 8 character and the ability with the ID of pngEleEBea was selected as the element boon.

Result: Elemental Body: Air (4 mins)
Expected Result: Elemental Body: Air (8 mins)

Last edited by thegreatone5224; August 28th, 2018 at 07:35 AM.
thegreatone5224 is offline   #3 Reply With Quote
Sendric
Senior Member
 
Join Date: Jul 2010
Posts: 3,144

Old August 28th, 2018, 09:44 AM
Quote:
Originally Posted by thegreatone5224 View Post
I'm not receiving any errors but the text is not updating as expected. If it helps I'll include everything below:

Code:
Phase: Post-levels
Priority: 10000
Index: 1

~ If we're not shown, just get out now
doneif (tagis[Helper.ShowSpec] <> 1)

~ if we've been disabled, get out now
doneif (tagis[Helper.SpcDisable] <> 0)

~ Set our duration based on class level and element boon
var duration as number

if (#hasability[pngEleEBea] <> 0) then
 duration = field[xTotalLev].value
else
 duration = field[xTotalLev].value / 2
endif

~ Update feature's duration
#duration[pngEleEBa] = duration
field[livename].text = field[thingname].text & " (" & duration & " mins)"
field[listname].text = field[thingname].text & " (" & duration & " mins)"

~ Add tool tip to dex save
#situational[hero.child[svDEX],"Advantage vs. all",field[thingname].text]
This is being done on a level 8 character and the ability with the ID of pngEleEBea was selected as the element boon.

Result: Elemental Body: Air (4 mins)
Expected Result: Elemental Body: Air (8 mins)
Try changing this line: if (#hasability[pngEleEBea] <> 0) then

to this: if (hero.childfound[pngEleEBea].tagis[Helper.ShowSpec] <> 0) then

It looks like the #hasability is returning a 0, which could be due to it not working properly or the timing, which can vary depending on the thing in question. I don't use it myself. This new check should work assuming you don't have a script that removes the ShowSpec tag for some reason, and ultimately performs the same function.

An alternative idea is to have the pngEleEBea thing assign a tag to the hero (such as User.EleBea) then you can check for the user tag on the hero. I would try the above method first though.
Sendric is offline   #4 Reply With Quote
thegreatone5224
Junior Member
 
Join Date: Aug 2018
Posts: 3

Old August 28th, 2018, 10:02 AM
That did it, thanks for the help!

I saw something that in my searches but didn't realize it worked quite that way.
thegreatone5224 is offline   #5 Reply With Quote
Sendric
Senior Member
 
Join Date: Jul 2010
Posts: 3,144

Old August 29th, 2018, 03:13 AM
Quote:
Originally Posted by thegreatone5224 View Post
That did it, thanks for the help!

I saw something that in my searches but didn't realize it worked quite that way.
It's not exactly the same, of course, but it looks for the thing in question, then if it finds it, searches for the "ShowSpec" tag. In general, this tag only appears on things that are "activated". For example, the thing "Aura of Courage" exists on a character who is a level 1 Paladin, but the tag "ShowSpec" does not appear on it until level 3. A search such as the one above would return a '0' until level 3 as a result, even though the thing in question exists.
Sendric is offline   #6 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:06 PM.


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